bob2006 Posted November 16, 2010 Share Posted November 16, 2010 i have been trying to figure this out for the last hour with no luck i am hopeing some one here can help me the problem is well i really dont know what the problem is but the code should check is the passwords match if they dont it will tell you to reenter your password if(isset($_POST['Submit'])) //isset open { $pass1=$_POST['pass1']; $pass2=$_POST['pass2']; if($pass1 != o) //pass open { echo"<style type='text/css'> <!-- body { background-color: #FFFFFF; } body,td,th { color: #000000; } --> </style></head> <body> <table width='100%' border='1'> <tr> <td><center>Your Password Did Not Match Please Reenter Your Passwrods</center></td> </tr> <tr> <td><form id='form1' name='form1' method='post' action=''> <label>Password <input type='text' name='pass1' id='pass1' /> </label> </td> </tr> <tr> <td> <label>Enter Password Again <input type='text' name='pass2' id='pass2' /> </label> </td> </tr> <tr> <td> <label> <center><input type='submit' name='Submit' id='Submit' value='Submit' /></center> </label> </form> </td> </tr> </table> </body>"; die(); //pass colse } else //pass else open { echo" <form name='redirect'> <center> <font face='Arial'><b>Your Account Has Been Validated You Will Now Be Redirect To The Admin Home Page in<br><br> <form> <input type='text' size='3' name='redirect2'> </form> seconds</b></font> </center> <script> <!-- //change below target URL to your own var targetURL='/test1' //change the second to start counting down from var countdownfrom=5 var currentsecond=document.redirect.redirect2.value=countdownfrom+1 function countredirect(){ if (currentsecond!=1){ currentsecond-=1 document.redirect.redirect2.value=currentsecond } else{ window.location=targetURL return } setTimeout('countredirect()',1000) } countredirect() //--> </script>"; //pass else close } //isset close } Quote Link to comment https://forums.phpfreaks.com/topic/218832-if-statement-not-working/ Share on other sites More sharing options...
Adam Posted November 16, 2010 Share Posted November 16, 2010 if($pass1 != o) Where exactly did you get "o" from? Should be: if ($pass1 != $pass2) Quote Link to comment https://forums.phpfreaks.com/topic/218832-if-statement-not-working/#findComment-1134904 Share on other sites More sharing options...
bob2006 Posted November 16, 2010 Author Share Posted November 16, 2010 i was messing around the code does not work it was set to if($pass1 != $pass2) i forgot to change it back before i posted my code sorry Quote Link to comment https://forums.phpfreaks.com/topic/218832-if-statement-not-working/#findComment-1134908 Share on other sites More sharing options...
Adam Posted November 16, 2010 Share Posted November 16, 2010 I can't see any reason why that wouldn't work. Do you get an error? Blank page? Try a var_dump on each variable to make sure they contain what you expect: var_dump($pass1); var_dump($pass2); Quote Link to comment https://forums.phpfreaks.com/topic/218832-if-statement-not-working/#findComment-1134935 Share on other sites More sharing options...
bob2006 Posted November 16, 2010 Author Share Posted November 16, 2010 i figure it out i had an if statement messed up above this code all better now thanks Quote Link to comment https://forums.phpfreaks.com/topic/218832-if-statement-not-working/#findComment-1134946 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.