Neither phpdev nor sokkit allow pages to update using php
Posted: Thu Mar 03, 2005 6:03 pm
This code is supposed to rewrite the page when a particular choice is chosen, in the case the 3rd choice down.
It works fine when I upload it to my webspace....http://www.johnkpaul.com/quiz.php, but when I run it on my computer using sokkit AND phpdev, the page doesn't reload when the submit button is clicked. I have tried changing the echo "yoyo"; to php include with a file that just says that in it, and that doesn't work either. For some reason I can't get it to update the page using php. I have no idea what is wrong here but I really really need it fixed because I have a presentation tommorrow that needs something like this to be shown on my computer without access to the internet. Thanks in advance!
Code: Select all
<?php
if(!$submit){ // if the submit button on the form is NOT pressed, print the form
?>
<div align=center><br><BR>
</head>
<form method="post" action="<? echo $PHP_SELF; ?>">
<?
printf("<input type=radio name=choice1 value=1>Click if you want me to be cool and sit down.<br> \n");
printf("<input type=radio name=choice1 value=2>Click if you want me to be cool and sit down.<br> \n");
printf("<input type=radio name=choice1 value=3>Click if you want me to be cool and sit down.<br> \n");
printf("<input type=radio name=choice1 value=4>Click if you want me to be cool and sit down.<br> \n");
?>
<input type="submit" name="submit" value="submit">
<br><br><a href="http://wwww.johnkpaul.com">jOHNkpAUL.com</a>
</form>
</div>
<?
}
if($submit){ // if the submit button IS pressed, then score the quizz
if($choice1==3){
echo "yoyo";
}
}
?>