steelmanronald06 Posted September 12, 2006 Share Posted September 12, 2006 Lines 122-153:[code]<?php // Start output buffering ob_start() echo "The following error occured:<br />"; //See which of the two, if not both, is already in use if($email_check > 0) { echo "The email address, $email_address , is already in our database!<br />"; unset($email_address); } if($username_check > 0) { echo "The username, $username , is already in our database!<br />"; } echo "Please fix the above errors!"; //Show bottom layout require_once('../includes/bot.php'); //Reload to the form header("Location: /users/register.php"); //Flush ouput buffering ob_flush(); //Exit the script exit(); }?>[/code]*enclosed in php tags for the color effect :)Error generated:[quote]Parse error: parse error, unexpected T_ECHO in C:\wamp\www\lampgeekz\users\register.php on line 125[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/ Share on other sites More sharing options...
gijew Posted September 12, 2006 Share Posted September 12, 2006 No semi-colon after ob_start() Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90731 Share on other sites More sharing options...
steelmanronald06 Posted September 12, 2006 Author Share Posted September 12, 2006 Line 258 - 278:[code]<?php //Ensure Their Account Was Activated $sql_doublecheck = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$code' AND activated='1'"); $doublecheck = mysql_num_rows($sql_doublecheck); if($doublecheck == 0){ echo "<strong><font color=red>Your account could not be activated!</font></strong>"; //Include the bottom layout require_once('../includes/bot.php'); //Exit the script exit(); } elseif ($doublecheck > 0) { echo "<strong>Your account has been activated!</strong> You may now login!<br />"; //Include the bottom layout require_once('../includes/bot.php') //Exit the script exit(); } ?>[/code]error:[quote]Parse error: parse error, unexpected T_EXIT in C:\wamp\www\lampgeekz\users\register.php on line 277[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90732 Share on other sites More sharing options...
gijew Posted September 12, 2006 Share Posted September 12, 2006 Once again, no semi-colonrequire_once('../includes/bot.php') Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90735 Share on other sites More sharing options...
gijew Posted September 12, 2006 Share Posted September 12, 2006 Been programming too long today? Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90737 Share on other sites More sharing options...
steelmanronald06 Posted September 12, 2006 Author Share Posted September 12, 2006 haha! yes. I wrote that script in 1 hour. there is a total of 286 lines! It is all one big switch! :( Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90738 Share on other sites More sharing options...
steelmanronald06 Posted September 12, 2006 Author Share Posted September 12, 2006 hahaha![code]<?php //Set the variables from the url $username = $_REQUEST['id']; $code = $_REQUEST['code']; //Update their information to activated $sql = mysql_query("UPDATE users SET activated='1' WHERE username='$username' AND password='$code'") or die (mysql_error()); //Set their Private Message Inbox to activated $sql2 = mysql_query("UPDATE users_pm_allow SET activated='1' WHERE username='$username'"); //Ensure Their Account Was Activated $sql_doublecheck = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$code' AND activated='1'"); $doublecheck = mysql_num_rows($sql_doublecheck); if($doublecheck == 0){ echo "<strong><font color=red>Your account could not be activated!</font></strong>"; //Include the bottom layout require_once('../includes/bot.php'); //Exit the script exit(); } elseif ($doublecheck > 0) { echo "<strong>Your account has been activated!</strong> You may now login!<br />"; //Include the bottom layout require_once('../includes/bot.php'); //Exit the script exit(); } ?>[/code]guess what I get?[quote]Your account could not be activated![/quote]No other error but my custom error is returned, and when I echo $username and $code it shows what it should, by matching it to the phpmyadmin entry. so my question, why is it not activating? It isn't updating the row :'( Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90745 Share on other sites More sharing options...
steelmanronald06 Posted September 12, 2006 Author Share Posted September 12, 2006 so just checked something else!see where there is that second update query for the users_pm_allow? that one works! so it is just the one that isn't working :o Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90747 Share on other sites More sharing options...
gijew Posted September 12, 2006 Share Posted September 12, 2006 I would personally check to see what $doublecheck is coming back with. Use the die() function there after your query. I don't know what you're set up like but it seems as if you're posting the right information and still getting the error, you're probably not getting the right info returned from your query. This is why I use Adodb because it does my debugging for me = ) Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90748 Share on other sites More sharing options...
steelmanronald06 Posted September 12, 2006 Author Share Posted September 12, 2006 wow! i don't know what i was doing, but it works now! thanks for the help gijew and neylitalo (im moral support). Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90759 Share on other sites More sharing options...
gijew Posted September 12, 2006 Share Posted September 12, 2006 Ha, good luck and happy coding! Quote Link to comment https://forums.phpfreaks.com/topic/20562-parse-errorob_start/#findComment-90762 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.