Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Why doesn't this work? (http://www.go4expert.com/forums/doesnt-t24871/)

Complete 7Feb2011 05:58

Why doesn't this work?
 
Why doesn't this work?
Code:

<?php
    if ($_POST['textbox1'] != "")
                $_ENV['mytestzeststring'] = $_POST['textbox1'];
        print $_ENV['mytestzeststring'];
?>

<form name="registerform" id="registerform" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">
          <input type="text" name="testbox1"/>
          <input type="submit" value="Click me!"/>

</form>

Wouldn't this present on the page before the form declaration whatever the user types in the test box?

shabbir 7Feb2011 07:02

Re: Why doesn't this work?
 
What does action=has in the final html

pein87 9Feb2011 06:46

Re: Why doesn't this work?
 
Most servers don't have the super global $_ENV set which may be why. I don't know why your using it to begin with since it has default array keys. $_ENV gets environment data and is not a general all you can store global try using $_GLOBAL instead or your own array or variable.


All times are GMT +5.5. The time now is 12:29.