mattd8752 Posted December 29, 2006 Share Posted December 29, 2006 Could someone try and fix the php script I have included as an attachment. It is supposed to include a file which will have the commands for a password protection. This password protection is running from an include. And it is calling the page pass.txt for the md5 encripted version of the password. I don't think that is the problem though, the error recieved isParse error: syntax error, unexpected T_BOOLEAN_OR, expecting ',' or ')' in /home/mattd/public_html/commands/scripts/requestpassword.php on line 10You can check that out at http://mattdsworld.theicy.net/commands/Please help with this as soon as possible. I am trying to develop a command set. If you don't quite understand what the script is doing you can check doc.txt.[attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/32214-solved-password-function-problem-updated-for-new-code/ Share on other sites More sharing options...
kenrbnsn Posted December 29, 2006 Share Posted December 29, 2006 Please post the first 10 lines of the script in question here. Put the script between [nobbc][code][/code][/nobbc] tags.You have a syntax error -- usually a forgotten end quote or semi-colon.Ken Link to comment https://forums.phpfreaks.com/topic/32214-solved-password-function-problem-updated-for-new-code/#findComment-149523 Share on other sites More sharing options...
mattd8752 Posted December 29, 2006 Author Share Posted December 29, 2006 Thanks,[code]<?phpfunction requestpass(){$filename = "./data/pass.txt";$handle = fopen($filename, "r");$cpass = fread($handle, filesize($filename));fclose($handle);$pass = $_POST['pass'];$pass = md5($pass);if (!isset ($_POST['Login'] && $pass != $cpass)) // display form{?><form method="POST" action="<?php echo $PHP_SELF; ?>"><p>Password: <input type="text" name="pass" size="20"><input type="submit" value="Login" name="Login"></p></form><?php}else{ // correct password. Display page.}?><?phpfunction requestpassend(){}}?>[/code]There is the full code. Don't bother with the download. I fixed 1 problem from it, but still the same error. You can still see the results at that website. That page is requestpassword.php. Link to comment https://forums.phpfreaks.com/topic/32214-solved-password-function-problem-updated-for-new-code/#findComment-149530 Share on other sites More sharing options...
mattd8752 Posted December 29, 2006 Author Share Posted December 29, 2006 Please help. Link to comment https://forums.phpfreaks.com/topic/32214-solved-password-function-problem-updated-for-new-code/#findComment-149539 Share on other sites More sharing options...
kenrbnsn Posted December 29, 2006 Share Posted December 29, 2006 Don't bump so quickly -- most of us have other work to do other than solve your problems.Anyway, your missing a closing parenthesis on this line:[code]<?phpif (!isset ($_POST['Login'] && $pass != $cpass)) // display form?>[/code]after "$_POST['Login']It also looks like you have one too many "}" at the end of your script. If you learn to indent your code properly you will be able to see many syntax errors.Ken Link to comment https://forums.phpfreaks.com/topic/32214-solved-password-function-problem-updated-for-new-code/#findComment-149565 Share on other sites More sharing options...
mattd8752 Posted December 30, 2006 Author Share Posted December 30, 2006 Thanks, and sorry for bumping. RESOLVED. Link to comment https://forums.phpfreaks.com/topic/32214-solved-password-function-problem-updated-for-new-code/#findComment-149590 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.