-1

ive been all around trying to fix the code but i still get an error

Parse error: syntax error, unexpected 'userfirstName' (T_STRING), expecting ',' or ';' in /home/crosswayprinting/public_html/ztest2/functions/shop.php on line 66

here's the code btw whats my mistake :/ ?

 <?php if($user_home->is_logged_in()){
    echo ' 





<div class="row">
                <div class="col-lg-8 col-lg-offset-2">
                    <h2 class="section-heading">Place an Order</h2>
<div class="text-center" style="input, select, textarea{
    color: #000;
}">


</div><BR>

      <form role="form" class="userTrans" method="POST">
    <input type="hidden" value="OrderInsert" name="act_userTrans">


<div class="form-group">
  <label for="typeofservice">Select Type of Service</label>
  <select id="typeofservice" class="form-control" name="typeofservice">
        <option value="Tarpaulin">Tarpaulin</option>
        <option value="Rush ID">Rush ID</option>
        <option value="Photocopy">Photocopy</option>
        <option value="Graphic Layout">Graphic Layout</option>
        <option value="Invitation">Invitation</option>
        <option value="Panaflex">Panaflex</option>
        <option value="Signages">Signages</option>
        <option value="Stickers">Stickers</option>
        <option value="Sintra board">Sintra board</option>
        <option value="Large Format Photo">Large Format Photo</option>
        <option value="PVC ID">PVC ID</option>
        <option value="Lamination">Lamination</option>
        <option value="Bag Tags">Bag Tags</option>
        <option value="Notary Public">Notary Public</option>
        <option value="Scan">Scan</option>
    </select>
    </div>



     <div class="form-group">
  <label for="templateselect">Template Selection</label>
  <select id="templateselect" class="form-control" name="templateselect">
        <option value="Own Made Template">Own Made Template</option>
        <option value="Pre-made Template">Pre-made Template</option>

    </select>
    </div>

    <div class="form-group">
    <label for="text">More details about your order</label>
    <input type="text" class="form-control" id="orderdetails" name="orderdetails">
  </div>

     <div class="form-group">
    <label for="text"> Customer Name</label>
    <input type="text" value=" <?php  echo $row['userfirstName']; ?> " class="form-control" id="customer" name="customer">
    </div>
  /* this is the code btw what makes it an error, i am trying to

echo a customer's name and make it Passive or uneditable textbox so it can register to my orderlist to whom ordered */

  <button type="submit" class="btn btn-default userTrans">Submit</button>
</form>


    ';
                    }


else{
                        echo '


                       <center>  Please Login to Place an Order </center>
';}



                    ?>

1 Answers1

0

Get rid of the echo statements wrapping your HTMl. There's no need, just escape out of the PHP interpreter and print your HTML. Then you won't get an error when you're doing <?php echo $row['userFirstName']; ?>....Something like this:

<?php if($user_home->is_logged_in()){ ?>
    <div class="row">
        <div class="col-lg-8 col-lg-offset-2">
            <h2 class="section-heading">Place an Order</h2>

            <form role="form" class="userTrans" method="POST">
                <input type="hidden" value="OrderInsert" name="act_userTrans">
                <div class="form-group">
                    <label for="typeofservice">Select Type of Service</label>
                    <select id="typeofservice" class="form-control" name="typeofservice">
                        <option value="Tarpaulin">Tarpaulin</option>
                        <option value="Rush ID">Rush ID</option>
                        <option value="Photocopy">Photocopy</option>
                        <option value="Graphic Layout">Graphic Layout</option>
                        <option value="Invitation">Invitation</option>
                        <option value="Panaflex">Panaflex</option>
                        <option value="Signages">Signages</option>
                        <option value="Stickers">Stickers</option>
                        <option value="Sintra board">Sintra board</option>
                        <option value="Large Format Photo">Large Format Photo</option>
                        <option value="PVC ID">PVC ID</option>
                        <option value="Lamination">Lamination</option>
                        <option value="Bag Tags">Bag Tags</option>
                        <option value="Notary Public">Notary Public</option>
                        <option value="Scan">Scan</option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="templateselect">Template Selection</label>
                    <select id="templateselect" class="form-control" name="templateselect">
                        <option value="Own Made Template">Own Made Template</option>
                        <option value="Pre-made Template">Pre-made Template</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="text">More details about your order</label>
                    <input type="text" class="form-control" id="orderdetails" name="orderdetails">
                </div>

                <div class="form-group">
                    <label for="text"> Customer Name</label>
                    <input type="text" value=" <?php  echo $row['userfirstName']; ?> " class="form-control" id="customer" name="customer">
                   <!-- now the above won't give an error -->
                </div>
                <button type="submit" class="btn btn-default userTrans">Submit</button>
            </form>
        </div>
    </div>
<?php } else { ?>
    <!-- Do not use center tags when you're using bootstrap framework -->
    <!--<center>  Please Login to Place an Order </center>-->
    <div class="text-center"> Please Login to Place an Order </div>
<?php } ?>

Also what's going on with your inline styles? That's not how this works:

<div class="text-center" style="input, select, textarea{
    color: #000;
}">

Just move that CSS somewhere else. You can't use targeted selectors within the style="" tag, only relevant CSS.

Ohgodwhy
  • 49,779
  • 11
  • 80
  • 110
  • oh my it worked well! i see :OOO kindof learned the echo somewhere but this one is good and i can see the codes in their own coloreds :3 and yeah still not really get the drift of bootstraps :/ – Jean Louis Mendoza Mar 26 '16 at 17:29