Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Problem

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Splinter Freelance

Established Member
Impact
1
What do I need to change? Im stumped


Parse error: parse error, unexpected $ in /home/owner05/public_html/includes/mood_change.php on line 33


Here is the code:

PHP:
<?php
if (isset($_POST['mood']))
{
	$change_mood = $_POST['mood'];
}
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
		{
			$session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];

			if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) 
			{
				$session_id = '';
			}
			if ( $session_id )
			{
					$user_id = $userdata['$user_id'];
	
					$sql = "INSERT INTO " . USERS_TABLE . "(  u.user_mood )
							VALUES ('" .  $change_mood .  "') WHERE user_id=" . $user_id;
					if ( !($result = $db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
					}

					if ( !($row = $db->sql_fetchrow($result)) )
					{
						message_die(GENERAL_MESSAGE, 'UID Not found');
					}

					$user_mood = $row['user_mood'];

		}
?>
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
#33 is the last line ?
Maybe there is a missing } at the end of your code (nesting of IF blocks)
 
0
Close
sdsinc said:
#33 is the last line ?
Maybe there is a missing } at the end of your code (nesting of IF blocks)
Yep, appears so...

PHP:
<?php
if (isset($_POST['mood']))
{
    $change_mood = $_POST['mood'];
}
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
        {
            $session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];

            if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
            {
                $session_id = '';
            }
            if ( $session_id )
            {
                    $user_id = $userdata['$user_id'];

                    $sql = "INSERT INTO " . USERS_TABLE . "(  u.user_mood )
                            VALUES ('" .  $change_mood .  "') WHERE user_id=" . $user_id;
                    if ( !($result = $db->sql_query($sql)) )
                    {
                        message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
                    }

                    if ( !($row = $db->sql_fetchrow($result)) )
                    {
                        message_die(GENERAL_MESSAGE, 'UID Not found');
                    }

                    $user_mood = $row['user_mood'];

            }
        }
        
?>
 
0
Close
Found the problem... there was an empty line after the ?>


Now, does any one know how to get the users_id for the logged in user?
 
0
Close
Splinter Freelance said:
Found the problem... there was an empty line after the ?>


Now, does any one know how to get the users_id for the logged in user?
Now, does any one know how to get the users_id for the logged in user? What are you talking about?? How to keep the user logged in??
-CP
 
0
Close
you gotta use cookies for that, and then once you set the cookie, u gotta retrieve it.

i wud help you, but cookies arent one of my php strengths X_X so i dont wanna give misinformation.
 
0
Close
0
Close
I need someone who is familiar with phpBB...
 
0
Close
Issue Resolved... thanx for the help
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back