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> Quote Link to comment 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 Quote Link to comment 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> Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.