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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    unexpected T_CONSTANT_ENCAPSED_STRING

    i got this error in my php page..while running the page..but i couldn't find out the mistake..can any one plz help me out of this situation?

    here is the code...


    PHP Code:
    <?php include("include/config.php"); ?>
    <?php
    if(!isset($_SESSION['uid']))

    {

    header("location:login_regis.php");

    }
    $qry_user="select * from `user_detail` where `email`='".$_SESSION['uid']."'";
    $res_user=mysql_query($qry_user) or die(mysql_error());
    $row_user=mysql_fetch_array($res_user);

              
    $i="1";
              
    $qry_order="select * from `transaction` where `tid`='".$_SESSION['tid']."'";
              
    $res_order=mysql_query($qry_order) or die(mysql_error());
              
    $row_order=mysql_fetch_array($res_order);
              
              
    $qry_trans="select * from `trans_detail` where `tid`='".$_SESSION['tid']."'";
              
    $res_trans=mysql_query($qry_trans) or die(mysql_error());
              
              
    $transaction_id=$_SESSION['tid'];
              
    $date=$_SESSION['date'];
              
    $time=$_SESSION['time'];
              
    $comment=$_SESSION['comment'];
               
    $emailid=$row_user['email'];
    $to_user=$emailid;
    $to_owner="jayeeta.phoenix@gmail.com";
    $sub_user="Order details in veenatandoori";
    $sub_owner ="New order for veenatandoori";
    $message="<table cellpadding='0' cellpadding='0' width='600px'>
              <tr style='background-color:#FFCC00'>
                <td colspan='4' align='center' style='padding:5px; color:#660000'>
                    Person Detail
                </td>
              </tr>
              <tr>
                 <td>
                     Name:
                 </td>
                 <td>"
                     
    .$row_user['name'].
                 
    "</td>
                 <td>
                     Contact no.:
                 </td>
                 <td>"
                      
    .$row_user['mobile'].
                 
    "</td>
              </tr>
               <tr>
                 <td>
                     Email:
                 </td>
                 <td>"
                     
    .$emailid.
                 
    "</td>
                 <td>
                     Address:
                 </td>
                 <td>"
                      
    .$row_user['address'].
                 
    "</td>
              </tr>"
             
              "<tr style='background-color:#FFCC00'>
                <td align='center' style='padding:5px; color:#660000'>
                    Order Detail
                </td>
                <td colspan='3' align='center' style='padding:5px; color:#660000'>
                    [COLOR="
    Red"]trans id:".$transaction_id."[/COLOR]..i find the error over here
                    </td>
              </tr>
               <tr>
                 <td align='center'>
                     Name
                 </td>
                 <td align='center'>
                     Product Name
                 </td>
                 <td align='center'>
                     Quantity
                 </td>
                 <td align='center'>
                      Amount
                 </td>
              </tr>"
              
    while($row_trans=mysql_fetch_array($res_trans))
              {
                
    $message.= "<tr>
                     <td>"
                         
    .$i.
                     
    "</td>
                     <td>"
                         
    .substr($row_trans['product_name'],0,10).
                     
    "</td>
                     <td>"
                         
    .$row_trans['qty'].
                     
    "</td>
                     <td>"
                         
    .$row_trans['total'].
                     
    "</td>
                 </tr>"
               
    $i++;
               }
                
    $message.= "<tr>
                     <td colspan='4'>
                       <hr />
                     </td>
                 </tr>
                 <tr>
                     <td colspan='3' align='center'>
                       Net Amount
                     </td>
                     <td align='center'>"
                        
    .$qry_order['net_amount'].
                     
    "</td>
                 </tr>
                 <tr style='background-color:#FFCC00'>
                <td colspan='4' align='center' style='padding:5px; color:#660000'>
                    delivery Detail
                </td>
                <tr>
                    <td colspan='2' align='left'>
                    Date of delivery:
                      </td>
                      <td colspan='2' align='left'>"
                    
    .$date.
                      
    "</td>
                </tr>
                <tr>
                   <td colspan='2' align='left'>
                   Time of delivery:
                      </td>
                      <td colspan='2' align='left'>"
                    
    .$time.
                      
    "</td>
                </tr>
                <tr>
                    <td colspan='2' align='left'>
                    place of delivery:
                      </td>
                      <td colspan='2' align='left'>"
                     
    .$row_user['address'].
                      
    "</td>
                </tr>
                <tr>
                    <td colspan='2' align='left'>
                    Comment:
                      </td>
                      <td colspan='2' align='left'>"
                    
    .$comment.
                      
    "</td>
                </tr>
              </tr>
                 </table>"
    ;
    $headers  'MIME-Version: 1.0' "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
    $headers .= 'From: perfectspices.com' "\r\n";
    if(
    mail($to_user$sub_user$message$headers) && mail($to_owner$sub_owner$message$headers))
    {
    header("location:sendmail.php?msg=success");
    }
    else
    {
    header("location:sendmail.php?msg1=failure");
    }
              

    ?>
    Last edited by Spookster; 01-13-2012 at 06:09 AM. Reason: Added [php][/php] tags

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Always post code using PHP tags as it's clearly stated in the sticky thread in this forum
    Please wrap PHP codes using the [PHP][/PHP] tag

    As for your errors you have 3 of them. 2 of them are missing semicolons here

    </tr>" <---- needs semicolon.
    $i++;

    The 3rd one is here
    COLOR="Red"]trans id:".$transaction_id."[/COLOR]..i find the error over here

    you are probably going to need to escape the double quotes around Red.

    FYI this is very sloppy coding with that much HTML in a string scattered all over the place across multiple lines.

    It would be beneficial to you if you maybe started using a decent PHP editor that will autoformat code as well as flag errors in your code. To find your errors I simply pasted your code in my NetBeans for PHP IDE and it immediately showed me your errors.
    http://netbeans.org/features/php/index.html
    Last edited by Spookster; 01-13-2012 at 06:23 AM.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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