Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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
Trades: 0
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
 
 
Register now for full access!
Old 05-22-2008, 12:03 PM Re: PHP configuration: GET and POST not working
VirtuosiMedia's Avatar
Web Design Made Simple

Posts: 1,228
Trades: 0
Try doing this instead:

PHP Code:
$name $_POST['name'];
$age$_POST['age']; 
VirtuosiMedia is offline
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
Trades: 0
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
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
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?
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 05-22-2008, 03:06 PM Re: PHP configuration: GET and POST not working
bez
bez's Avatar
Skilled Talker

Posts: 53
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.27511 seconds with 12 queries