Adblock breaks this site

[PHP/HTML] Form Actions. Need help!

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

  1. nate_rox2

    nate_rox2 Guest

    Referrals:
    0
    [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">
     
  2. night

    night Member
    Banned

    Joined:
    Apr 21, 2005
    Posts:
    60
    Referrals:
    1
    Sythe Gold:
    5
    [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.
     
  3. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [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
    }
     
  4. nate_rox2

    nate_rox2 Guest

    Referrals:
    0
    [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
     
  5. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP/HTML] Form Actions. Need help!

    Do you know php?
     
  6. Osmosis

    Osmosis Retired Australian Mod
    Banned

    Joined:
    Apr 29, 2005
    Posts:
    2,695
    Referrals:
    2
    Sythe Gold:
    0
    [PHP/HTML] Form Actions. Need help!

    It's easier/better to use PHP.
     
  7. -------owned-------

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

    Joined:
    Jan 27, 2007
    Posts:
    1,225
    Referrals:
    0
    Sythe Gold:
    0
    [PHP/HTML] Form Actions. Need help!

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


 
 
Adblock breaks this site