madspof Posted October 22, 2006 Share Posted October 22, 2006 can anyone help me with this script i dont even know if it is the script it could be the php.ini file anyway heres the script it keeps throwing up this error message Use of undefined constant php - assumed 'php' in C:\stuff4free\test\buy.php on l<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><?php if (!isset($shipping)) $shipping = "economy"; echo "Your order will be sent via $shipping shipping";?> <FORM ACTION="buy.php" METHOD=POST></FORM><INPUT TYPE="RADIO" NAME="shipping" VALUE="economy";<?php if ($shipping.php == "economy") echo "CHECKED";?>> Economy<INPUT TYPE="RADIO" NAME="shipping" VALUE="standard";<?php if ($shipping.php == "standard") echo "CHECKED";?>> Standard<INPUT TYPE="RADIO" NAME="shipping" VALUE="express";<?php if ($shipping.php == "express") echo "CHECKED";?>> Express<INPUT TYPE="SUBMIT" VALUE="Change shipping option"></FORM></body></html> Link to comment https://forums.phpfreaks.com/topic/24779-use-of-undefined-constant-php-assumed-php-in-cstuff4freetestbuyphp-on-l/ Share on other sites More sharing options...
trq Posted October 22, 2006 Share Posted October 22, 2006 You cannot use a fullstop in a variable definition so .... $shipping.php is an invalid variable name. Rermove the .php Link to comment https://forums.phpfreaks.com/topic/24779-use-of-undefined-constant-php-assumed-php-in-cstuff4freetestbuyphp-on-l/#findComment-112857 Share on other sites More sharing options...
madspof Posted October 22, 2006 Author Share Posted October 22, 2006 okay thnks tht wrked but for some reason the script will nt change once the change order had been clicked this is the code i have now <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><?php if (!isset($shipping)) $shipping = "economy"; echo "Your order will be sent via $shipping shipping";?> <FORM ACTION="buy.php" METHOD=POST></FORM><p> <INPUT TYPE="RADIO" NAME="shipping" VALUE="economy";<?php if ($shipping == "economy") echo "CHECKED";?>> Economy <INPUT TYPE="RADIO" NAME="shipping" VALUE="standard";<?php if ($shipping == "standard") echo "CHECKED";?>> Standard <INPUT TYPE="RADIO" NAME="shipping" VALUE="express";<?php if ($shipping == "express") echo "CHECKED";?>> Express</p><p> <INPUT TYPE="SUBMIT" VALUE="Change shipping option"> </FORM></p></body></html> Link to comment https://forums.phpfreaks.com/topic/24779-use-of-undefined-constant-php-assumed-php-in-cstuff4freetestbuyphp-on-l/#findComment-112859 Share on other sites More sharing options...
madspof Posted October 22, 2006 Author Share Posted October 22, 2006 it doesnt matter sorry do not reply i am bit of a newbie so i didnt see what was going on thank you for your time Link to comment https://forums.phpfreaks.com/topic/24779-use-of-undefined-constant-php-assumed-php-in-cstuff4freetestbuyphp-on-l/#findComment-112861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.