Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation unexpected T_BOOLEAN_OR

    I get the following error
    Parse error: syntax error, unexpected T_BOOLEAN_OR, expecting ',' or ')' in test.php on line 50
    I think I've checked the braces properly and syntax are good but couldn't figure out.
    PHP Code:
    <?php
        
    if($_SESSION['userType']=="admin")
        {
            
    // list client
                // action = list/create/delete/edit/modify
            
    $action $_REQUEST['action'];
            
    ?>
            <h1>Client Management</h1>
            <?php
            
    switch ($action)
            {
                case 
    "List":
                    
    ?>
                    <h2>List Clients</h2>
                    
                    <?php
                
    break;
                case 
    "Create":
                    
                    if(isset(
    $_POST['create']) && ($_POST['create']=="submitted"))
                    {
                        if(!isset(
    $_POST['first']) || (strlen($_POST['first'])<=3))
                        {
                            
    $error $error "<br />please type first name<br />";
                        }
                        if(!isset(
    $_POST['last']) || strlen($_POST['last'])<=2)
                        {
                            
    $error $error "please type last name<br />";
                        }
                        if(!isset(
    $_POST['user']) || strlen($_POST['user'])<=3)
                        {
                            
    $error $error "please type username<br />";
                        }
                        if(!isset(
    $_POST['pass']) || strlen($_POST['pass'])<=4)
                        {
                            
    $error $error "please type password, it must be of at least 5 characters<br />";
                        }
                        if(!isset(
    $_POST['confpass']) || ($_POST['pass']!=$_POST['confpass']))
                        {
                            
    $error $error "please confirm password<br />";
                        }
                        if(!isset(
    $_POST['email']) || strlen($_POST['email'])<=10)
                        {
                            
    $error $error "please type email<br />";
                        }
                        if(!isset(
    $_POST['confemail']) || ($_POST['email']!=$_POST['confemail']))
                        {
                            
    $error $error "please confirm email <br />";
                        }
                        if(!isset(
    $_POST['add1']) || (strlen($_POST['add1'])<=1))
                        {
                            
    $error $error "please type address 1<br />";
                        }
                        if(!isset(
    $_POST['state_region'] || strlen($_POST['state_region'])<=1)
                        {
                            
    $error $error "please type state/region<br />";
                        }
                        if(!isset(
    $_POST['country'] || strlen($_POST['country'])<=2)
                        {
                            
    $error $error "please type country<br />";
                        }
                        
                        echo 
    "<h1>>> </h1>".$error;
                        if(!isset(
    $error) )//|| strlen($error)<=2)
                        
    {
                            
    $first          $_POST['first'];           // *
                            
    $middle         $_POST['middle'];
                            
    $last           $_POST['last'];            // *
                            
    $user           $_POST['user'];            // *
                            
    $pass           $_POST['pass'];            // *
                            
    $confpass       $_POST['confpass'];        // *
                            
    $email          $_POST['email'];           // *
                            
    $confemail      $_POST['confemail'];       // *
                            
    $add1           $_POST['add1'];            // *
                            
    $add2           $_POST['add2'];
                            
    $state_region   $_POST['state_region'];    // *
                            
    $country        $_POST['country'];         // *
                            
    $campIDs        $_POST['campIDs'];
                            
    $misc           $_POST['misc'];
                            
                            
    // add slashes
                            
    $first =         addslashes($first);
                            
    $middle =         addslashes($middle);
                            
    $last =         addslashes($last);
                            
    $user =         addslashes($user);
                            
    $pass =         md5(addslashes($pass));
                            
    $confpass =     addslashes($confpass);
                            
    $email =         addslashes($email);
                            
    $confemail =     addslashes($confemail);
                            
    $add1 =         addslashes($add1);
                            
    $add2 =         addslashes($add2);
                            
    $state_region addslashes($state_region);
                            
    $country =         addslashes($country);
                            
    $campIDs =         addslashes($campIDs);
                            
    $misc =         addslashes($misc);
                            
                            
    // first,middle,last,user,pass,confpass,email,confemail,add1,add2,state_region,country,campIDs,misc
                            // check if client exists on database
                            
    $sql "SELECT user,email FROM tbl_clients WHERE user='$user' || email='$email'";
                            
    $result mysql_query($sql)or die(mysql_error());
                            
                            while (
    $row mysql_fetch_row($result))
                            {
                                if(
    $row[0]==$user){$error $error .  "Username already exists, please choose another username<br />";}
                                echo 
    $row[0].",";
                                if(
    $row[1]==$email){$error $error "this email address is already registered, please choose another email<br />";}
                                echo 
    $row[1]."<br />";
                            }
                            echo 
    "<br />rows > ".mysql_num_rows($result);
                            
                            
                            if(!isset(
    $error))// || strlen($error)<=1)
                            
    {
                                
    $sql "INSERT INTO tbl_clients (first,middle,last,user,pass,confpass,email,confemail,add1,add2,state_region,country,campIDs,misc) VALUES(
                                    '$first',
                                    '$middle',
                                    '$last',
                                    '$user',
                                    '$pass',
                                    '$confpass',
                                    '$email',
                                    '$confemail',
                                    '$add1',
                                    '$add2',
                                    '$state_region',
                                    '$country',
                                    '$campIDs',
                                    '$misc'
                                    )"
    ;
                                
    $result mysql_query($sql);
                                
                                
    $success "Client Created $error";
                                
                            }
                            
                        }else{
                                
    $error "<strong>Please correct the following errors</strong><br />".$error;
                        }
                    }
                    
                    
    ?>
                    <h2>Create Clients</h2>
                    <?php
                    $message 
    = (isset($error)?$error:(isset($success)?$success:false));
                    if(
    $message!==false)
                    {
                        
    ?><div class="ErrorBox"><?php echo $message;?></div><?php
                    
    }
                    if((!isset(
    $_POST['create']) && !isset($error)) || (isset($error) && isset($_POST['create'])))
                    {
                        
    ?>
                        <form name="Create" method="POST" >
                            <fieldset>
                                <legend>Full Name</legend>
                                <input type="text" name="first" value="<?php echo $_POST['first'];?>" /> <label for="first">enter first name</label><br />
                                <input type="text" name="middle" value="<?php echo $_POST['middle'];?>" /> <label for="middle">enter middle name</label><br />
                                <input type="text" name="last" value="<?php echo $_POST['last'];?>" /> <label for="last">enter last name</label><br />
                            </fieldset>
                            <fieldset>
                                <legend>Authentication</legend>
                                <input type="text" name="user" value="<?php echo $_POST['user'];?>" /> <label for="user">enter username</label><br />
                                <input type="password" name="pass" value="<?php echo $_POST['pass'];?>" /> <label for="pass">enter password</label><br />
                                <input type="password" name="confpass" value="<?php echo $_POST['confpass'];?>" /> <label for="confpass">confirm password</label><br />
                                <input type="text" name="email" value="<?php echo $_POST['email'];?>" /> <label for="email">email</label><br />
                                <input type="text" name="confemail" value="<?php echo $_POST['confemail'];?>" /> <label for="confemail">confirm email</label><br />
                            </fieldset>
                            <fieldset>
                                <legend>Address</legend>
                                <input type="text" name="add1" value="<?php echo $_POST['add1'];?>" /> <label for="add1">Address 1</label><br />
                                <input type="text" name="add2" value="<?php echo $_POST['add2'];?>" /> <label for="add2">Address 2</label><br />
                                <input type="text" name="state_region" value="<?php echo $_POST['state_region'];?>" /> <label for="state_region">State/Region</label><br />
                                <input type="text" name="country" value="<?php echo $_POST['country'];?>" /> <label for="country">Country</label><br />
                            </fieldset>
                            <fieldset>
                                <legend>Misc</legend>
                                <input type="text" name="campIDs" value="<?php echo $_POST['campIDs'];?>" /> <label for="campIDs">Campaigns</label><br />
                                <input type="text" name="misc" value="<?php echo $_POST['misc'];?>" /> <label for="misc">Miscelleaneous</label><br />
                            </fieldset><br />
                            <input type="submit" name="submit" value="submit" class="button" />
                            <input type="hidden" name="ShowPage" value="clientManagement" />
                            <input type="hidden" name="action" value="Create" />
                            <input type="hidden" name="create" value="submitted" />
                        </form>
                        <?php
                    
    }
                break;
                case 
    "Delete":
                    
    ?>
                    <h2>Delete Clients</h2>
                    
                    <?php
                
    break;
                case 
    "Edit":
                    
    ?>
                    <h2>Edit Clients</h2>
                    
                    <?php
                
    break;
                case 
    "Modify":
                    
    ?>
                    <h2>Modify Clients</h2>
                    
                    <?php
                
    break;
                default:
                    
    ?>
                    <strong>Go to</strong><br />
                    > <a href="<?php echo MAINPATH."/index.php?ShowPage=clientManagement&action=List";?>" title="Click to List Clients">List Clients</a><br />
                    > <a href="<?php echo MAINPATH."/index.php?ShowPage=clientManagement&action=Create";?>" title="Click to Create Clients">Create Clients</a><br />
                    > <a href="<?php echo MAINPATH."/index.php?ShowPage=clientManagement&action=Delete";?>" title="Click to Delete Clients">Delete Client</a><br />
                    > <a href="<?php echo MAINPATH."/index.php?ShowPage=clientManagement&action=Edit";?>" title="Click to Edit Clients">Edit Client</a><br />
                    <?php
                
    break;
            }
        }
    ?>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    if(!isset($_POST['state_region'])
    Missing a ) there.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •