1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$'

Discussion in 'PHP' started by reihau, Nov 28, 2007.

  1. #1
    Hello,

    Sorry I am a complete newbie trying to validate my contact form. I installed the following folders and files into my root folder:

    contact.html
    contact_ack.html
    lib (folder)
    phorm.php
    phormbase.php
    phormconfig.php
    phpinfo.php

    Once I fill out the form, I receive the error on the browser page as follows (see text between the dotted lines):

    ==========

    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/borrowed/www/www/test/lib/functions.php(169) : eval()'d code on line 1

    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/borrowed/www/www/test/lib/functions.php(169) : eval()'d code on line 1
    SEMrush
    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/borrowed/www/www/test/lib/functions.php(169) : eval()'d code on line 1

    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/borrowed/www/www/test/lib/functions.php(169) : eval()'d code on line 1

    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/borrowed/www/www/test/lib/functions.php(169) : eval()'d code on line 1

    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/borrowed/www/www/test/lib/functions.php(169) : eval()'d code on line 1

    ==========

    Below is the code from phorm.php, lines 159-175:

    [ code ]

    // Load the plugins registry.
    if (is_readable("$ph_root/plugins/registry.php") && !$ph_Abort) {
    if ($ph_debug3) echo "<B>NS:</B> Registry Load<BR>";
    $ph_registry = file("$ph_root/plugins/registry.php");

    while (list(, $ph_regline) = each($ph_registry)) {
    $ph_regline = trim($ph_regline);
    if (!$ph_regline || !ereg("^< |^> ", $ph_regline)) continue;

    list($ph_beaf, $ph_stage, $ph_plfile) = explode(" ", trim($ph_regline));
    $ph_plfile = basename($ph_plfile);
    $ph_plugbase = str_replace(strrchr($ph_plfile, "."), "", $ph_plfile);

    if (file_exists("$ph_root/plugins/$ph_plugbase/$ph_plfile"))
    $ph_plfile = "$ph_plugbase/$ph_plfile";

    if ($ph_debug32) echo "<B>Plugin:</B> $ph_beaf|$ph_stage|$ph_plfile<BR>";


    [ /code ]

    Can anyone help me troubleshoot my form? Thanks very much.

    Reihau
     
    reihau, Nov 28, 2007 IP
    SEMrush
  2. Irontree

    Irontree Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    For starters you have two open braces { , you need to close them }
     
    Irontree, Nov 28, 2007 IP
  3. reihau

    reihau Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So sorry for my ignorance, but I do not know which line or which brackets to close. I am looking at the code of line 169 in the phorm.php file, but cannot tell what to do.

    Could you help me again please?

    Thanks very much for your time and patience!!!

    Sincerely,

    Reihau

    P.S. I also attached the phorm.php file, in case anyone wants to look at it...
     
    reihau, Nov 28, 2007 IP
  4. drlaudio

    drlaudio Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Newbie to the forum here. I'm getting a similar error as others have posted in this thread, and I just can't find the problem. I'm making a popcorn order form for our Cub Scout pack, and when I try to run the script, I get:

    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /Library/WebServer/Documents/Pack195/PopcornOrderSend.php on line 13

    And here's the ENTIRE file PopcornOrderSend.php:

    <?php
    $email = $_REQUEST['email'] ;
    $name = $_REQUEST['name'] ;
    $address = $_REQUEST['address'] ;
    $city = $_REQUEST['city'] ;
    $state = $_REQUEST['state'] ;
    $zip = $_REQUEST['zip'] ;
    $phone = $_REQUEST['phone'] ;
    $payment = $_REQUEST['payment'] ;
    $MIL25 = $_REQUEST['MIL25'] ;
    $MIL40 = $_REQUEST['MIL40'] ;
    $CHOCLOV = $_REQUEST['CHOCLOV'] ;
    $3WAY40 = $_REQUEST['3WAY40'] ;
    $3WAY30 = $_REQUEST['3WAY30'] ;
    $TRAIL = $_REQUEST['TRAIL'] ;
    $CHOCTIN = $_REQUEST['CHOCTIN'] ;
    $CARMNUTS = $_REQUEST['CARMNUTS'] ;
    $CARMLIT = $_REQUEST['CARMLIT'] ;
    $MICROBUT = $_REQUEST['MICROBUT'] ;
    $MICROLIT = $_REQUEST['MICROLIT'] ;
    $CARMSML = $_REQUEST['CARMSML'] ;

    mail( "Webmaster@Pack195.org", "Popcorn Order",
    "Name: $name\nAddress: $address, $city $state, $zip\nPhone: $phone\nPayment Preference: $payment\n\nPopcorn Order\nSilver Donation: $MIL25\nGoldDonation: $MIL50\nChocolate Lovers: $CHOCLOV\n3 Way Tin: $3WAY40\nCheese Lovers: $3WAY30\nTrail Mix: $TRAIL\nChocolatey Tin: $CHOCTIN\nGo Nuts: $CARMNUTS\nCaramel Lite: $CARMLIT\nButtery Microwave: $MICROBUT\nLight Microwave: $MICROLIT\nSmall Caramel: $CARMSML", "From: $email" );
    header( "Location: PopcornOrder_ThankYou.php" );
    ?>


    From what I can tell, line 13 is no different than the lines above and below it, so I have no idea why there would be an error on that line. Can anyone help me?


    Thanks
     
    drlaudio, Oct 1, 2009 IP
  5. w47w47

    w47w47 Peon

    Messages:
    255
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    try not to start the veriable with a number also istead of $3WAY40 try $WAY40 but i think that this is only the problem is there are only numbers. but try it anyways.
     
    w47w47, Oct 1, 2009 IP
  6. drlaudio

    drlaudio Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks! That fixed that problem. I figured as long as they were in quotes, letters or numebrs wouldn't matter because they're all strings. I guess not, huh?

    I had one other typo I had to fix as well, but I found that one with no problem.

    But now there's one other problem. I run the script, and it doesn't send the email. I've double and triple and quadruple checked the email address in the mail function (the first part of the function), so I know it's correct. But when I test it, no email shows up. I AM directed to the "Thank You" page, as the final line of the script directs, so I know the script is running al the way through. It's just not sending the email. Is there something else I have to setup for this to work?
     
    drlaudio, Oct 1, 2009 IP