Greetings learned PHP(eople);

My HTML :
--------------------------
<input type="input" class="input" name="usernamebox" value="Enter user
name.."></input><br>
<input type="radio" name="useroption" value="add">Add User</input><br>
<input type="radio" name="useroption" value="edit">Edit User</input><br>
<input type="radio" name="useroption" value="delete">Delete
User</input><br>

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($count>0)
                        {
                        //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 appreciated....I 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

Reply via email to