[PHP] Parse error not understood

2003-08-14 Thread Chris Blake
Greetings learned PHP(eople);

My HTML :
--
input type=input class=input name=usernamebox value=Enter user
name../inputbr
input type=radio name=useroption value=addAdd User/inputbr
input type=radio name=useroption value=editEdit User/inputbr
input type=radio name=useroption value=deleteDelete
User/inputbr

My PHP Code :

?php
include('pbpc_client_connect_db');
//If usernamebox is empty--
if ($_REQUEST['usernamebox'] ==)
{
header('location: user_blank.php');
exit();
}

//If default value is left in
if($_REQUEST['usernamebox'] ==Enter user name..)
{
header('location: user_blank.php');
exit();
}

//If 'Add New User' is selected-
if ( $_REQUEST['useroption'] == 'add')
{
//First, check that the username doesn`t exist already
$query = select count(*) from pbpc_client where username = ' .
$_REQUEST['usernamebox'] . ';;
$result = mysql_query($query);
if(!$result)
{
echo 'Cannot run query.';
exit();
}
$count = mysql_result($result, 0, 0);
if($count0)
{
//User already exists in database
header('location: user_exists.php');
exit();
}   
header(location:add_new_user.php?usernamebox= .
$_REQUEST['usernamebox']);
exit();
}
// If Edit User is selected-
if ( $_REQUEST['useroption'] == 'edit')
{

//First, check that this user account actually exisits in the database
$query = select count(*) from pbpc_client where username = ' .
$_REQUEST['usernamebox'] . ';;
$result = mysql_query($query);
if(!$result)
{
echo 'Cannot run query.';
exit();
}

$count = mysql_result($result, 0, 0);
if($count==0)
{
//User does not exist in the database
header('location: user_not_exists.php');
exit();
}

}
//If Delete User is selected--
if ( $_REQUEST['useroption'] == 'delete')
{
//First, check that the user already exists
$query = select count(*) from pbpc_client where username = ' .
$_REQUEST['usernamebox'] . ';;
$result = mysql_query($query);
if(!$result)
{
echo 'Cannot run query.';
exit();
}

$count = mysql_result($result, 0, 0);
if($count==0)
{
//User does not exist in the database
header('location: user_not_exists.php');
exit();

header('location:del_new_user.php');
exit();
}
//header('location: content.php');
?

No matter which option I select I get the following output :
--
Parse error: parse error, unexpected $ in
/var/www/html/Sessions/userman.php on line 83

Line 83 is '?'..

Any ideas and help greatly appreciatedI been staring at this for an
hour now and can`t see whats wrong.

Thanks


-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

Injustice anywhere is a threat to justice everywhere.
-- Martin Luther King, Jr.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error not understood

2003-08-07 Thread CPT John W. Holmes
From: Chris Blake [EMAIL PROTECTED]
[snip]
 //If Delete User is selected--
 if ( $_REQUEST['useroption'] == 'delete')
 {
[snip]
 No matter which option I select I get the following output :
 --
 Parse error: parse error, unexpected $ in
 /var/www/html/Sessions/userman.php on line 83
 
 Line 83 is '?'..

You're missing a closing brace for the above IF condition...

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php