Web Hosting Talk







View Full Version : PHP Parse error, need help.


Aria
12-16-2003, 12:49 PM
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/xxxxx/public_html/admin/admin.php on line 836



admin.php, line 832 - 847

------------------------------------------------------------------------
function updatePassword()
{
## Check input
$check="$HTTP_REFERER";
$result="$_REQUEST['Username']:$_REQUEST['Password']";

if( emptyString($_REQUEST['Password']) || emptyString($_REQUEST['Username']) )
{
derr(1005, 'Username and/or Password');
}

fileWrite('./admin/.htpasswd', "{$_REQUEST['Username']}:" . crypt($_REQUEST['Password']));

cryptpass($check,$result);

displayMain("Administrative Login Information Updated");
------------------------------------------------------------------------

Any Idea how to solve this problem?

Thank You.
Aria.

Rich2k
12-16-2003, 01:07 PM
## Check input

replace with

// Check input

# is a Perl comment identifier
// is a PHP comment identifier

However I do believe that PHP supports # as shell-type comments (although I have never seen it used in a production PHP script)

Additionally the line you highlight should be

$result = $_REQUEST['Username'] . ":" . $_REQUEST['Password'];

Aria
12-16-2003, 01:22 PM
Rich2k,
Thank you very much for your help.
Problem solved! :)

Burhan
12-16-2003, 05:13 PM
Rich2k :

Nothing wrong with #-type comments, and they are supported in PHP "PHP supports 'C', 'C++' and Unix shell-style comments." @ the manual.

For some reason its discouraged, but I have yet to find a geniune reason why other than "I don't like it".

Rich2k
12-16-2003, 07:31 PM
Annoyed me the other day as I had to update some Perl scripts I hadn't touched in a long time.. and I kept trying to put // as comments :)

Burhan
12-16-2003, 07:45 PM
Heheh -- well that's something else ;)