That didn't work. here is my complete code:
<html>
<body>
<form method="post" action=submitC">
Please complete the following 3 questions
<p><p>
<BR>How many times have you visited this site including today?<BR>
<input type=radio name=choice value=1>1-5<BR>
<input type=radio name=choice value=2>6-15<BR>
<input type=radio name=choice value=3>16-30<BR>
<input type=radio name=choice value=4>31+<BR>
<BR>Did you find what you were looking for on the site?<BR>
<input type=radio name=choice2 value=1>Yes<BR>
<input type=radio name=choice2 value=2>No<BR>
<BR>Would you like the site to remain online?<BR>
<input type=radio name=choice3 value=1>Yes<BR>
<input type=radio name=choice3 value=2>No<BR><BR>
<div align="left"><input type="Submit" name="Submit" value="Submit">
</form>
</body>
</html>
<?php
//VARIABLES
$visits = array ("1", "2-15", "16-30", "31+");
$find = array ("Yes", "No");
$keep = array("Yes","No");
$num = 0;
$num2 = 0;
//END VARIABLES
function submitClick($choice,$choice2,$choice3,$action){
if ($choice == 1){
echo "1-5, ";
$num = 1;
}
elseif ($choice == 2){
echo "6-15, ";
$num = 2;
}
elseif ($choice == 3){
echo "16-30, ";
$num = 3;
}
elseif ($choice == 4){
echo "30+, ";
$num = 4;
}
else{
$num = 0;
}
if ($choice2 == 1){
echo "yes, ";
$num2 = 1;
}
elseif ($choice2 == 2){
echo "no, ";
$num2 = 2;
}
else{
$num2 = 0;
}
if ($choice3 == 1){
echo "yes";
$num3 = 1;
}
elseif ($choice3 == 2){
echo "no";
$num3 = 2;
}
else{
$num3 = 0;
}
$fp = fopen ("file.txt", "a");
$wri = fwrite($fp,$num);
$wri = fwrite($fp,$num2);
$wri = fwrite($fp,$num3);
fclose($fp);
}
if ($action=="submitC" ){
submitClick($choice,$choice2,$choice3,$action);
}
?>
it just keeps saying:
Warning: Undefined variable: action in \php\firstphp.php on line 89
this is my major problem, if anyone solves it, i will be in their debt
