[PHP/HTML] Form Actions. Need help!

Discussion in 'Web Programming' started by nate_rox2, Apr 16, 2007.

[PHP/HTML] Form Actions. Need help!
  1. Unread #1 - Apr 16, 2007 at 9:49 AM
  2. nate_rox2
    Referrals:
    0

    nate_rox2 Guest

    [PHP/HTML] Form Actions. Need help!

    I have a HTML page where the user enters a secret code into the form and it e-mails me that code using PHP. I would like to add another action to that form though.



    This is part of the HTML which links to the PHP.
    Code:
      <form action="http://www.domain.com/send.php" method="post" autocomplete="off">

    This is part of the PHP file that e-mails the code to me.
    Code:
    if ($success)if ($success){
      print "<meta http-equiv=\"refresh\" content=\"0;URL=welcome.htm\">";
    }
    Would it be possible to add this in somewhere as well?
    Code:
    <form action="http://domain.com/accounts.html" method="post" autocomplete="off">
     
  3. Unread #2 - Apr 16, 2007 at 4:49 PM
  4. night
    Joined:
    Apr 21, 2005
    Posts:
    60
    Referrals:
    1
    Sythe Gold:
    5

    night Member
    Banned

    [PHP/HTML] Form Actions. Need help!

    do you mean to redirect the user after the php code sends the mail to you, to accounts.html?

    if so, add this into your php code when you want to redirect...
    Code:
    header("Location: accounts.html");
    
    tip: when writing forms, if the files are in the same folder (like send.php and accounts.html) then you can just use action = accounts.html instead of the long domain name, because itd be a huge hassle if you have to transfer domains...

    If i didn't answer your question, then please explain a little clearer, thanks.
     
  5. Unread #3 - Apr 16, 2007 at 6:07 PM
  6. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    [PHP/HTML] Form Actions. Need help!

    Sending mail is different on different servers.

    For the secret code, use inputs.

    <input type="password" name="secretcode">
    That'll make a password field with it's name being secret code. To get the value of that, get rid of your form and replace it with:
    $_POST['secretcode'] (that's the value of the form, to check, do the following)

    if($_POST['secretcode']=="MY SUPER SECRET PASSWORD!!!!!!!1") {
    echo "correct, mailing now!";
    //do your mail stuff here
    }
    else {
    echo "gtfo noob";
    //other stuffs
    }
     
  7. Unread #4 - Apr 17, 2007 at 8:00 AM
  8. nate_rox2
    Referrals:
    0

    nate_rox2 Guest

    [PHP/HTML] Form Actions. Need help!

    i dont want to use echo..
    i want to use two of the form action things... with method=post
     
  9. Unread #5 - Apr 17, 2007 at 8:55 PM
  10. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    [PHP/HTML] Form Actions. Need help!

    Do you know php?
     
  11. Unread #6 - May 4, 2007 at 11:02 PM
  12. Osmosis
    Joined:
    Apr 29, 2005
    Posts:
    2,695
    Referrals:
    2
    Sythe Gold:
    0

    Osmosis Retired Australian Mod
    Banned

    [PHP/HTML] Form Actions. Need help!

    It's easier/better to use PHP.
     
  13. Unread #7 - May 5, 2007 at 3:54 PM
  14. -------owned-------
    Joined:
    Jan 27, 2007
    Posts:
    1,225
    Referrals:
    0
    Sythe Gold:
    0

    -------owned------- Guru
    Banned

    [PHP/HTML] Form Actions. Need help!

    Agreed with post above ^^
     
< Server set up | [PHP] Dynamic Signature Help >

Users viewing this thread
1 guest


 
 
Adblock breaks this site