Reply
PHP configuration: GET and POST not working
Old 05-22-2008, 11:32 AM PHP configuration: GET and POST not working
bez
bez's Avatar
Skilled Talker

Posts: 53
hi all

I quickly set up php, mysql & xitami for some development on my win XP box.

It was working fine till I tried using forms. I cannot get the $_GET and $_POST variables to populate with the form variables. Here is my form (pretty basic):

HTML Code:
<form action="http://localhost/webpages/myjobs/index.php" method="get">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
The following PHP:

PHP Code:
var_dump($_GET);
var_dump($_POST);
var_dump($_REQUEST); 
Outputs:
Code:
array(0) { } array(0) { } array(0) { }
However, the following is returned by phpinfo():

Code:
 _SERVER["QUERY_STRING"] => name=x&age=c
So it is picking up the variables, however, $_GET is not been populated. Tried the same thing with post and same result.

Coming back to PHP after a 2 year break, is this some new security feature I haven't heard about?

Any feedback would be gratefully accepted (only set up the box to do some quick dev work, but its turned out to be anything but)
bez is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-22-2008, 12:03 PM Re: PHP configuration: GET and POST not working
VirtuosiMedia's Avatar
Webmaster Talker

Posts: 673
Try doing this instead:

PHP Code:
$name $_POST['name'];
$age$_POST['age']; 
VirtuosiMedia is online now
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Old 05-22-2008, 01:45 PM Re: PHP configuration: GET and POST not working
bez
bez's Avatar
Skilled Talker

Posts: 53
Doesnt work, the $_GET and $_POST arrays are completely empty
bez is offline
Reply With Quote
View Public Profile
 
Old 05-22-2008, 02:57 PM Re: PHP configuration: GET and POST not working
wayfarer07's Avatar
$frontend->developer

Posts: 813
Name: Abel Mohler
Location: Asheville, North Carolina USA
Maybe this is a dumb question, but are you sure the form is targeting the page that the code is on?

Also, can we see more, or even all of the code that is on the page?
__________________
wayfarer07 is online now
Reply With Quote
View Public Profile
 
Old 05-22-2008, 03:06 PM Re: PHP configuration: GET and POST not working
bez
bez's Avatar
Skilled Talker

Posts: 53
I have just removed Xitami and configured Apache, and it's now working.

Must be some Xitami config option (still, pretty strange to disable for variables by default).

Cheers for feedback anyway guys.

CB
bez is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP configuration: GET and POST not working
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13625 seconds with 13 queries