The specified CGI application misbehaved by not re
I keep getting this message on some forms and not others. I do not know what the difference is. Can someone please explain why I get this error.
Thanks
Rob
The Following doesn't work :(
Form
<HTML>
<head></head>
<body><form action="recursion.php" method=POST>
<p>I would like to know the factorial of:
<input name="value" type="text" />
</p>
<p>
<input type="submit"/>
</p>
</form>
</body>
</HTML>
recursion.php
<HTML>
<HEAD></HEAD>
<body>
<?php
extract ($_POST);
function recursion ($value)
{
if ($value <= 1)
return 1;
else
return $value*recursion($value-1);
}
echo "The factorial of " . $value . " is " . (recurison($value));
?>
</body>
</HTML>
The Following Script Works :)
This is the form:
<HTML>
<HEAD></HEAD>
<BODY>
<B>Namllu Holiday Booking Form</B>
<FORM method=GET action="holiday3.php">
Where do you want to go on holiday?
<BR>
<BR>
<INPUT name="Destination" type="Radio" value="Prague">
Prague
<BR>
<INPUT name="Destination" type="Radio" value="Barcelona">
Barcelona
<BR>
<INPUT name="Destination" type="Radio" value="Vienna">
Vienna
<BR>
<BR>
What grade of hotel do you want to stay at?
<BR>
<BR>
<INPUT name="Grade" type="Radio" value="Three">
Three Star
<BR>
<INPUT name="Grade" type="Radio" value="Four">
Four Star
<BR>
<BR>
<INPUT type=SUBMIT>
</FORM>
</BODY>
</HTML>
This is the PHP part: holiday3.php
<HTML>
<HEAD></HEAD>
<BODY>
<B>Namllu Holiday Booking Form</B>
<BR>
<BR>
<?php
extract ($_GET);
function Calculator($Price, $CityModifier, $StarModifier)
{
return $Price = $Price * $CityModifier * $StarModifier;
}
$Price=500;
$StarModifier=1;
$CityModifier=1;
$DestGrade = $Destination.$Grade;
switch($DestGrade) {
case "BarcelonaThree":
$CityModifier=2;
break;
case "BarcelonaFour":
$CityModifier=2;
$StarModifier=2;
break;
case "ViennaThree":
$CityModifier=3.5;
break;
case "ViennaFour":
$CityModifier=3.5;
$StarModifier=2;
break;
case "PragueThree":
break;
case "PragueFour":
$StarModifier=2;
break;
default:
$CityModifier=0;
echo ("Go back and do it again");
}
if ($CityModifier<>0)
{
echo "The cost for a week in $Destination is " . "$" . Calculator($Price,$CityModifier,$StarModifier);
}
?>
</BODY>
</HTML>
|