Jnerocorp Posted September 27, 2009 Share Posted September 27, 2009 Here is my code <html> <head> <title> Call52 Admin Panel </title> </head> <body bgcolor="e5e4e4"> <center> <h1> Call52 Admin Panel </h1> <?php if(isset($_POST['submit'])){ $user_input = $_POST['password']; $user_input_crypt = crypt($user_input); $password = crypt('password'); if (crypt($user_input, $password) == $password) { ?> <a href="./index.php">Main</a> - <a href="./pins.php">Pins</a> - <a href="./paidusers.php">Paid Users</a> - <a href="./settings.php">Site Settings</a><br><br> <h3> Stats </h3> <?php if (crypt($user_input, $password) == $password) { echo "<font color='green'>Correct Password!</font>"; } else { echo "<font color='red'>Incorrect Password!</font><br><br>"; echo "The Password you typed came back as: $user_input_crypt <br> it should have been: $password"; } } else { $password = crypt('sc55207'); ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="text" name="password"> <input type="submit" name="submit" value="submit"> </form> <?php } ?> </body> </html> Here is the error Parse error: syntax error, unexpected $end in /home/a4428795/public_html/demos/call52/admin/index.php on line 50 Quote Link to comment https://forums.phpfreaks.com/topic/175737-unexpected-end/ Share on other sites More sharing options...
Zane Posted September 27, 2009 Share Posted September 27, 2009 } else { echo "Incorrect Password! "; echo "The Password you typed came back as: $user_input_crypt it should have been: $password"; } } else { unexpected $end almost..pretty much always means you're either missing a bracket or have an unnecessary one someowhere EDIT: now that I look back..you have quite a few missing brackets.. Quote Link to comment https://forums.phpfreaks.com/topic/175737-unexpected-end/#findComment-926099 Share on other sites More sharing options...
Jnerocorp Posted September 27, 2009 Author Share Posted September 27, 2009 i think i have to many if and else statements because they arent liening up correctly Quote Link to comment https://forums.phpfreaks.com/topic/175737-unexpected-end/#findComment-926103 Share on other sites More sharing options...
CarbonCopy Posted September 27, 2009 Share Posted September 27, 2009 Dude, you really need to indent that code. That will help you identify errors Quote Link to comment https://forums.phpfreaks.com/topic/175737-unexpected-end/#findComment-926113 Share on other sites More sharing options...
robert_gsfame Posted September 28, 2009 Share Posted September 28, 2009 you have to add more brackets <html> <head> <title> Call52 Admin Panel </title> </head> <body bgcolor="e5e4e4"> <center> <h1> Call52 Admin Panel </h1> <?php if(isset($_POST['submit'])){ $user_input = $_POST['password']; $user_input_crypt = crypt($user_input); $password = crypt('password'); if (crypt($user_input, $password) == $password) { ?> <a href="./index.php">Main</a> - <a href="./pins.php">Pins</a> - <a href="./paidusers.php">Paid Users</a> - <a href="./settings.php">Site Settings</a><br><br> <h3> Stats </h3> <?php if (crypt($user_input, $password) == $password) { echo "<font color='green'>Correct Password!</font>"; } else { echo "<font color='red'>Incorrect Password!</font><br><br>"; echo "The Password you typed came back as: $user_input_crypt <br> it should have been: $password"; } } else { $password = crypt('sc55207'); ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="text" name="password"> <input type="submit" name="submit" value="submit"> </form> <?php } } <===i guess you miss this bracket...just try to add this bracket ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/175737-unexpected-end/#findComment-926366 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.