Why doesn't this work?

Discussion in 'PHP' started by Complete, Feb 7, 2011.

  1. Complete

    Complete New Member

    Joined:
    Jan 13, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    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?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    What does action=has in the final html
     
  3. pein87

    pein87 Active Member

    Joined:
    Aug 6, 2010
    Messages:
    173
    Likes Received:
    47
    Trophy Points:
    28
    Occupation:
    Web Dev
    Location:
    Limbo
    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice