...

View Full Version : Another T_String Error ()



inquisitivedzig
08-06-2008, 02:58 PM
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

derzok
08-06-2008, 03:01 PM
2a needs quotes... since it is a string.



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.types.string.php#80672



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum