Menu

Parse error in line 34?

Help
Bryan
2006-07-20
2013-06-03
  • Bryan

    Bryan - 2006-07-20

    Hi,
    I installed using fantastico to my public_html folder with no problems. I generated my form without too much trouble and have added a linkt o it from my existing website. I can access it from my website but when i hit send I get the following error:
    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/blunny/public_html/PhpForm/use/basesorder/process.php on line 34

    I looked at the code on line 34 in the process.php file and it looks just like other code I've seen posted to this forum so i'm at a loss.
    I'll post my code here:

    <?php
    include("global.inc.php");
    $errors=0;
    $error="The following errors occured while processing your form input.<ul>";
    pt_register('POST','15mmby40mmMagnetEnterquantity');
    pt_register('POST','20mmby40mmMagnet');
    pt_register('POST','30mmby40mmMagnet');
    pt_register('POST','40mmby40mmMagnet');
    pt_register('POST','60mmby40mmMagnet');
    pt_register('POST','80mmby40mmMagnet');
    pt_register('POST','15mmby40mmFlexisteel');
    pt_register('POST','20mmby40mmFlexisteel');
    pt_register('POST','30mmby40mmFlexisteel');
    pt_register('POST','40mmby40mmFlexisteel');
    pt_register('POST','60mmby40mmFlexisteel');
    pt_register('POST','80mmby40mmFlexisteel');
    pt_register('POST','Doyouwanttoorderadditonalitems');
    pt_register('POST','Listotheritems');
    $Listotheritems=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $Listotheritems);pt_register('POST','EmailAddress');
    pt_register('POST','MailingAddress');
    $MailingAddress=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $MailingAddress);pt_register('POST','Comments');
    $Comments=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $Comments);if($EmailAddress=="" || $MailingAddress=="" ){
    $errors=1;
    $error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
    }
    if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
    $error.="
    # Invalid email address entered";
    $errors=1;
    }
    if($errors==1) echo $error;
    else{
    $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
    $message="15mm by 40mm Magnet Enter quantity: ".$15mmby40mmMagnetEnterquantity."
    20mm by 40mm Magnet: ".$20mmby40mmMagnet."
    30mm by 40mm Magnet: ".$30mmby40mmMagnet."
    40mm by 40mm Magnet: ".$40mmby40mmMagnet."
    60mm by 40mm Magnet: ".$60mmby40mmMagnet."
    80mm by 40mm Magnet: ".$80mmby40mmMagnet."
    15mm by 40mm Flexisteel: ".$15mmby40mmFlexisteel."
    20mm by 40mm Flexisteel: ".$20mmby40mmFlexisteel."
    30mm by 40mm Flexisteel: ".$30mmby40mmFlexisteel."
    40mm by 40mm Flexisteel: ".$40mmby40mmFlexisteel."
    60mm by 40mm Flexisteel: ".$60mmby40mmFlexisteel."
    80mm by 40mm Flexisteel: ".$80mmby40mmFlexisteel."
    Do you want to order additonal items: ".$Doyouwanttoorderadditonalitems."
    List other items: ".$Listotheritems."
    Email Address: ".$EmailAddress."
    Mailing Address: ".$MailingAddress."
    Comments: ".$Comments."
    ";
    $message = stripslashes($message);
    mail("bryan@50paces.com","Form Submitted at your website",$message,"From: phpFormGenerator");
    ?>

    <!-- This is the content of the Thank you page, be careful while changing it -->

    <h2>Thank you!</h2>

    <table width=50%>
    <tr><td>15mm by 40mm Magnet Enter quantity: </td><td> <?php echo $15mmby40mmMagnetEnterquantity; ?> </td></tr>
    <tr><td>20mm by 40mm Magnet: </td><td> <?php echo $20mmby40mmMagnet; ?> </td></tr>
    <tr><td>30mm by 40mm Magnet: </td><td> <?php echo $30mmby40mmMagnet; ?> </td></tr>
    <tr><td>40mm by 40mm Magnet: </td><td> <?php echo $40mmby40mmMagnet; ?> </td></tr>
    <tr><td>60mm by 40mm Magnet: </td><td> <?php echo $60mmby40mmMagnet; ?> </td></tr>
    <tr><td>80mm by 40mm Magnet: </td><td> <?php echo $80mmby40mmMagnet; ?> </td></tr>
    <tr><td>15mm by 40mm Flexisteel: </td><td> <?php echo $15mmby40mmFlexisteel; ?> </td></tr>
    <tr><td>20mm by 40mm Flexisteel: </td><td> <?php echo $20mmby40mmFlexisteel; ?> </td></tr>
    <tr><td>30mm by 40mm Flexisteel: </td><td> <?php echo $30mmby40mmFlexisteel; ?> </td></tr>
    <tr><td>40mm by 40mm Flexisteel: </td><td> <?php echo $40mmby40mmFlexisteel; ?> </td></tr>
    <tr><td>60mm by 40mm Flexisteel: </td><td> <?php echo $60mmby40mmFlexisteel; ?> </td></tr>
    <tr><td>80mm by 40mm Flexisteel: </td><td> <?php echo $80mmby40mmFlexisteel; ?> </td></tr>
    <tr><td>Do you want to order additonal items: </td><td> <?php echo $Doyouwanttoorderadditonalitems; ?> </td></tr>
    <tr><td>List other items: </td><td> <?php echo $Listotheritems; ?> </td></tr>
    <tr><td>Email Address: </td><td> <?php echo $EmailAddress; ?> </td></tr>
    <tr><td>Mailing Address: </td><td> <?php echo $MailingAddress; ?> </td></tr>
    <tr><td>Comments: </td><td> <?php echo $Comments; ?> </td></tr>
    </table>
    <!-- Do not change anything below this line -->

    <?php
    }
    ?>

    I don't have any html skills so please keep any instruction simple.
    Thanks in advance for any help.

     
    • TNTEverett

      TNTEverett - 2006-07-20

      You can not use php variable names that start with numbers.  For example:
      You used
      15mmby40mmMagnetEnterquantity
      You should change this to something like
      a15mmby40mmMagnetEnterquantity

      This will solve your problem.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.