Jump to content

Parse error...ob_start???


steelmanronald06

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]
Link to comment
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]
Link to comment
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 :'(
Link to comment
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 = )
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.