Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/97833-form-variables-broken-on-desktop/
Share on other sites

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.

 

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']

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.