Re: PHP_SELF in Buttonproblem in PHP5



mk wrote:
The following code was working on a Server with PHP 4.

<?php
if(isset($next)){
echo 'next';
/*... some action here ...*/
} else {
echo 'next does not work';
}
?>

<form action="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>"
method="post">
<input name="next" type="submit" value="Next">
</form>

Now I have set my own Server with PHP5 and the ... isset($next) ...
does not work. Is my code wrong or has the Server to be reconfigured?
and how?

Thanks for a hint.
Markus

I think you have to bring 'next' back via the $_POST array.
Try:

if( isset($_POST['next']) ) {
echo "next\n";
} else {
echo "no next\n";
}

-david-

.


Quantcast