sanderphp Posted May 20, 2008 Share Posted May 20, 2008 I have a login page that has a login button and a register button. I'm trying to make it work that if the register button is pushed it will go to the registration page. The login works, but the register isn't. if(isset($_POST['login'])){ // whole bunch of code header("location:login_success.php"); else { echo "Wrong Username or Password"; } } if(isset($_POST['register'])){ header("location:registrationbackup.php"); } ?> my form code is <form name="form1" method="post" action="checklogin.php"> <td width="5%" > <input type="submit" name="login" value="login"></td> <td width="5%" > <input type="submit" name="register" value="register"></td> Link to comment https://forums.phpfreaks.com/topic/106405-solved-using-2-headers/ Share on other sites More sharing options...
rhodesa Posted May 20, 2008 Share Posted May 20, 2008 looks like the register shouldn't use any PHP code or submits at all.... <td width="5%" > <input type="button" value="register" onclick="window.location.href='registrationbackup.php';"></td> Link to comment https://forums.phpfreaks.com/topic/106405-solved-using-2-headers/#findComment-545417 Share on other sites More sharing options...
sanderphp Posted May 20, 2008 Author Share Posted May 20, 2008 perfect! thanks Link to comment https://forums.phpfreaks.com/topic/106405-solved-using-2-headers/#findComment-545419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.