Neither phpdev nor sokkit allow pages to update using php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jpaul
Forum Newbie
Posts: 1
Joined: Thu Mar 03, 2005 5:47 pm

Neither phpdev nor sokkit allow pages to update using php

Post by jpaul »

This code is supposed to rewrite the page when a particular choice is chosen, in the case the 3rd choice down.

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";
}
}
?>
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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your local install does not have register_globals on (a good thing(tm)), your host does (a bad thing(tm))
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

fyed. Why is register_globals on such a bad thing???????????? You say constantly its bad but why why why?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's a security issue, most often. It can cause bugs in other instances.

There was a reason why the PHP guys turned it off 3 years ago ;) ... have a read: http://php.net/register_globals
Post Reply