On 5/13/06, IraqiGeek <[EMAIL PROTECTED]> wrote:
[snip]
<html>
<title>test script</title>
<body>
<?php
        //If the user wants to add a joke
        if(isset($_GET['addtext'])):
?>//If I use METHOD=GET here, the script works flawlessly
<form action="<?php echo($_SERVER['php_self']);?>" METHOD=POST>
[/snip]

The form action should be $_SERVER['PHP_SELF']. Here case
matters, since this is a string and not a variable name.

If action is empty, I believe browsers simply send the request
to whatever URL the page was accessed at. Since you're already
at a GET (with ?addtext), the POST request actually includes
both the GET and the POST, so the the form is shown again.

Just var_dump $_GET and $_POST and you'll see what's happening.

Rabin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to