Jump to content


Photo

Use of undefined constant php - assumed 'php' in C:\stuff4free\test\buy.php on l


  • Please log in to reply
3 replies to this topic

#1 madspof

madspof
  • Members
  • PipPipPip
  • Advanced Member
  • 271 posts

Posted 22 October 2006 - 10:44 PM

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...ml4/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>


#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 October 2006 - 11:09 PM

You cannot use a fullstop in a variable definition so .... $shipping.php is an invalid variable name. Rermove the .php

#3 madspof

madspof
  • Members
  • PipPipPip
  • Advanced Member
  • 271 posts

Posted 22 October 2006 - 11:13 PM

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...ml4/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>

#4 madspof

madspof
  • Members
  • PipPipPip
  • Advanced Member
  • 271 posts

Posted 22 October 2006 - 11:17 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users