Jump to content

Archived

This topic is now archived and is closed to further replies.

steelmanronald06

Parse error...ob_start???

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Once again, no semi-colon

require_once('../includes/bot.php')

Share this post


Link to post
Share on other sites
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 :'(

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 = )

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.