At 17:36 16.11.2002, Chris Jackson said:
--------------------[snip]-------------------- 
>I am havein troubles gettin my form variables to work.
>The "register_globals" in php.ini is set to its default of "off".
>
>the <?php echo $PHP_SELF ?> dosent print anything in the action of the form

That's because register_globals is off :)
The PHP_SELF value is contained in the $_SERVER superglobal array and you
may access it anytime, everywhere as $_SERVER['PHP_SELF'].

>and the
>echo $_POST["answered"]; on the first run gives an error that says that
>"answered" is
>an undefined variable. but on the second submit this error is gone with the
>submitted data
>displaying correctly.


This is not an error you see but a Notice or Warning that you are using a
variable (or an array index) that has not been defined yet. While this is
not necessary in this siziation it might point out a possible source of
problems under other circumstances, allowing you to spot why your script
doesn't work as expected.

You could either
    if (array_key_exists('answered', $_POST))
to avoid the warning, or
    error_reporting(E_ALL & ~(E_NOTICE|E_WARNING))
to switch off notices or warnings for this script, if you are prepared to
do so...

>Im an experianced ASP developer and im getting frustrated with PHP. why is
>it so dificult
>to do the simplest things in php?

It's not difficult at all, it's just slightly different to ASP. You'll love
PHP, promised...


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



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

Reply via email to