Forum Moderators: coopster

Message Too Old, No Replies

help needed processing form parameters in PHP

         

Shafiq

9:37 am on Apr 25, 2008 (gmt 0)

10+ Year Member



i am making simple check box form in html which is retriving data from checkDemo.php file but the problem is this when i try to retriving the data it,s not working can anyone check my code and tell me where i am doing mistake thanks in advace

source code of html file :
<html>
<head>
<title>Checkbox Demo</title>
</head>
<body>
<h1>Checkbox Demo</h1>
<h3>Demonstrates checkboxes</h3>
<form action ="checkDemo.php">
<h3>What would you like with your order?</h3>
<ul>
<li><input type ="checkbox"
name ="chkFries"
value ="1.00">Fries
</li>

<li><input type ="checkbox"
name ="chkSoda"
value =".85">Soda
</li>

<li><input type ="checkbox"
name ="chkShake"
value ="1.30">Shake
</li>

<li><input type ="checkbox"
name ="chkKetchup"
value =".05">Ketchup
</li>
</ul>

<input type ="submit" name ="submit" value ="submit">
</form>

</body>
</html>

source code of php file :
<html>
<head>
<title>Checkbox Demo</title>
</head>
<body>
<h3>Demonstrates reading checkboxes</h3>
<?
print <<<HERE
chkFries: $chkFries <br>
chkSoda: $chkSoda <br>
chkShake: $chkShake <br>
chkKetchup: $chkKetchup <br>
<hr>
HERE;
$total = 0;
if (!empty($chkFries)){
print ("You chose Fries <br> \n");
$total = $total + $chkFries;
} // end if
if (!empty($chkSoda)){
print ("You chose Soda <br> \n");
$total = $total + $chkSoda;
} // end if
if (!empty($chkShake)){
print ("You chose Shake <br> \n");
$total = $total + $chkShake;
} // end if
if (!empty($chkKetchup)){
print ("You chose Ketchup <br> \n");
$total = $total + $chkKetchup;
} // end if
print ("The total cost is \$$total \n");
?>
</body>
</html>

Shafiq

11:17 am on Apr 25, 2008 (gmt 0)

10+ Year Member



i got my answer i was using php 6.0 in php 6.0 resgister_globel variable is disapear that ,why i could not excute my query

coopster

7:10 pm on Apr 25, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Shafiq.

Yes, there are a few directives that have been removed from PHP6 and that is one of them. Glad you got it sorted.