|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-12-02 02:51 UTC] zak@php.net
[2001-12-04 19:41 UTC] sniper@php.net
[2003-11-17 03:11 UTC] christopherbrueck at hotmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
<?php if($HTTP_GET_VARS["delete"]){ echo "delete"; }else{ echo "don't delete"; } ?> <html> <head> </head> <body> <form action="<?php echo $PHP_SELF;?>" method="POST" name="form1"> <input type="text" name="test"> <a href="javascript:document.form1.submit();">Save</a> </form> <a href="<?php echo $PHP_SELF;?>?delete=true">delete</a> </body> </html> The script above don't work correctly. After clicking "delete" the if-statement print "delete". Then you click on "Save" and the if-statement print "delete" just like you click on "delete". If the "echo $PHP_SELF" in the form-tag will be replaced by the plaintext-name of the script everything will work correctly - you can click on "Save" then and the if-statement gives you a "don't delete". It seems like the $PHP_SELF stores the HTTP_GET_VARS, but if I do a "echo $PHP_SELF" I get the script path, the script name and that's all, there are no HTTP_GET_VARS - but the script still works like the HTTP_GET_VARS are there.