BarrieHie Posted February 4, 2007 Share Posted February 4, 2007 Hello All, Here's the snippet of code and here's what's happening. Maybe I understand this incorrectly but the badpass.htm file is displaying under the americaneagleview.htm file. What I'm trying to do is jump to a file depending on the password that's entered. Is there another way to do this??? Is this working correctly by displaying both files??? :-( Barrie if((($PWadmin == "xxxxx")||($PWadmin == "xxx")||($PWadmin == "xxxxxx")||($PWadmin == "xxxxxx")||($PWadmin == "xxxxxx")||($PWadmin == "xxxxxxx"))) { include 'americaneagleview.htm'; } else { include 'badpass.htm'; } Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 4, 2007 Share Posted February 4, 2007 you dont need all those brackets. your understanding isnt quite true... if the password you entered is either of those passwords above then it will include the americaneagleview.html file. if its none of those passwords then it will include the badpass.htm file. Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted February 4, 2007 Share Posted February 4, 2007 if both files are being displayed then the scrip isnt working i dont know about includeing htm files, but try include("file_here"); or require("DITTO"); otherwise i dont know whats happening good luck PS try to have just one valid password, ir would make your if a lot more secure and a lot easier to read Quote Link to comment Share on other sites More sharing options...
.josh Posted February 4, 2007 Share Posted February 4, 2007 It is impossible for both of them to be called form that if..else condition. A condition either evaluates as true or false, not both. If both files are being included, then either: a) the condition is evaluating true, and somewhere later in your script (not in the else), badpass.htm is being called. b) the condition is evaluating false, and somewhere before this condition, americaneagleview.htm is being called. in addition to that, if you insist on hardcoding passwords like this, I would suggest this alternative: $passwords = array("xxxxx","xxx","xxxxxx","xxxxxx","xxxxxx","xxxxxxx"); if(in_array($PWadmin, $passwords)) { include 'americaneagleview.htm'; } else { include 'badpass.htm'; } though I would recommend against hardcoding passwords like that... Quote Link to comment 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.