• Log in or sign up for an account here: https://www.sythe.org/login

[PHP/HTML] Form Actions. Need help!

  • Thread starter Thread starter nate_rox2
  • Start date Start date
N

nate_rox2

Guest
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">
 
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.
 
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
}
 
i dont want to use echo..
i want to use two of the form action things... with method=post
 
Do you know php?
 
Runescape Gamblingrunescape gambling
Back
Top