• 0

[PHP] Syntax Error


Question

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/59/6789959/html/eg-includes/changepass.php on line 1

The error I get is what is posted above. I can't seem to figure out what it is.

http://pastebin.com/gyXDmRxC

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/59/6789959/html/eg-includes/changepass.php on line 1

The error I get is what is posted above. I can't seem to figure out what it is.

http://pastebin.com/gyXDmRxC

I couldn't see anything when I skimmed quickly.

Is eg-config.php all working ok?

James

Link to comment
Share on other sites

  • 0

I couldn't see anything when I skimmed quickly.

Is eg-config.php all working ok?

James

Yes I even took out the include and still gave me the same error. I use notepad++ and made sure to convert it so there was no whitespace at the beginning or extra encoding bytes.

Link to comment
Share on other sites

  • 0

Yes I even took out the include and still gave me the same error. I use notepad++ and made sure to convert it so there was no whitespace at the beginning or extra encoding bytes.

Have you tried <?php instead of the shorthand?

Link to comment
Share on other sites

  • 0

Have you tried <?php instead of the shorthand?

Yeah it was originally <?php and was trying a few different things. Really can't figure out what is wrong.

Link to comment
Share on other sites

  • 0

It's been a LONG time since I've worked with PHP (2 or 3 years...), but I BELIEVE you forgot a semicolen. All I remember from that error was that I could never figure out what was wrong. What's inside eg-config.php, seeing as that's the line number error.

Link to comment
Share on other sites

  • 0

I stuck your code into my editor (PHPDesigner) and it shows these lines are not authenticating:

    $sql_u = "UPDATE 'T_USER' SET 'pass' = '$new_pass' WHERE `login` = '$row['login']'";

$sql = "SELECT * FROM `T_USER` WHERE `auth_key` = '$_GET['auth']'";

    $sql_u = "UPDATE `T_USER` SET `pass` = '$new_pass', `auth_key` = '$new_auth' WHERE `login` = '$row['login']'";

May I suggest you not put "$row['login'] into a query, but declare this just above:

$Login = $row['login'];
$sql_u = "UPDATE 'T_USER' SET 'pass' = '$new_pass' WHERE `login` = '$Login'";

Link to comment
Share on other sites

  • 0

if you want to insert array entries directly into a string, you can do it like this:

$sql_u = "UPDATE 'T_USER' SET 'pass' = '$new_pass' WHERE `login` = '{$row['login']}'";

Link to comment
Share on other sites

  • 0

if you want to insert array entries directly into a string, you can do it like this:

$sql_u = "UPDATE 'T_USER' SET 'pass' = '$new_pass' WHERE `login` = '{$row['login']}'";

or...

$sql_u = "UPDATE 'T_USER' SET 'pass' = '$new_pass' WHERE `login` = '" . $row['login'] . "'";

Link to comment
Share on other sites

  • 0

Thanks alot guys. I got it all fixed it. The sql was the problem. I forgot the . in the previous attempt in using the array variables in the query.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.