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
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Another T_String Error ()

    There is alot of code... but it says there is an error on line 31 and this is line 31:

    if($_POST['p2'] == 2a){$costperfoot = $costperfoot + 0.00;}

    The code it is in looks like this

    if($_POST['p6'] > ""){
    if($_POST['p2'] == 2a){$costperfoot = $costperfoot + 0.00;}
    if($_POST['p2'] == 2a){$costperfoot = $costperfoot + 0.38;}
    }

    if($_POST['p7'] > ""){
    if($_POST['p2'] == 2a){$costperfoot = $costperfoot + 0.00;}
    if($_POST['p2'] == 2a){$costperfoot = $costperfoot + 0.38;}
    }

    The entire file is attached
    Attached Files Attached Files

  • #2
    Regular Coder
    Join Date
    May 2008
    Location
    Ohio
    Posts
    231
    Thanks
    3
    Thanked 21 Times in 21 Posts
    2a needs quotes... since it is a string.

    PHP Code:
    if($_POST['p2'] == '2a'){$costperfoot $costperfoot 0.00;} 
    Edit: also be careful about using < > operators for string comparisons - they don't always work how you think. http://us.php.net/manual/en/language...ring.php#80672
    Last edited by derzok; 08-06-2008 at 02:10 PM.
    zok@zoklet:~$ whereis zok
    zok: http://zoklet.net | http://zoklet.net/otg | /derzok/at/gmail/dot/com


  •  

    Posting Permissions

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