fifthleg Posted March 25, 2008 Share Posted March 25, 2008 I know this is dumb, but . . . I've installed Apache, PHP, MySQL on my Windows XP desktop machine. I can't get variables from forms to work in my PHP scripts. If I upload the same scripts to my website, they work fine. Everything else in PHP seems to be fine on my desktop, it just doesn't create variables from my (POST) forms. I'm guessing I need to change something in Apache or PHP configuration, but I don't know where to look. Thanks for any help! Quote Link to comment Share on other sites More sharing options...
trq Posted March 25, 2008 Share Posted March 25, 2008 You might want to post your code. Are you accessing these variables within the $_POST array? Quote Link to comment Share on other sites More sharing options...
fifthleg Posted March 25, 2008 Author Share Posted March 25, 2008 Even the simplest things like this don't give me anything: <form method="post" action="<?php echo $PHP_SELF;?>"> First Name:<input type="text" name="Fname"><br /> <input type="submit" name="submit" id="submit" value="Submit" /> </form> <?php echo("$Fname"); ?> But if I skip the form and just say $Fname = "Oliver"; it will echo correctly. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 25, 2008 Share Posted March 25, 2008 Your script requires register_globals to be enabled in order to function. Register_globals is now depreciated (and is to be removed completely when PHP6 is released) and has been disabled by default as it can cause security exploits within your code. Now to get the value from the Fname field, you'll need to use $_POST['Fname'] also $PHP_SELF will need to be $_SERVER['PHP_SELF'] Quote Link to comment Share on other sites More sharing options...
fifthleg Posted March 25, 2008 Author Share Posted March 25, 2008 You're exactly right. That fixed it. Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.