SitePoint Sponsor |
|
User Tag List
Results 1 to 16 of 16
Thread: $_GET works, $_POST doesn't
-
Jan 18, 2007, 04:31 #1
- Join Date
- Feb 2005
- Location
- Aveiro, Portugal
- Posts
- 165
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
$_GET works, $_POST doesn't
Hi all,
I installed a while back Apache2+mysql5.0+php5.2 on my compute (windows xp)
I thought everything went well, but I can't access any $_POST variables.
I can't find anything wrong in my php.ini.
Funny thing is I can access $_GET variables.
Thankx for any help on this.
Mario RamosYours truely
Mário Ramos
-
Jan 18, 2007, 04:38 #2
- Join Date
- Jul 2006
- Location
- jhb, south africa
- Posts
- 23
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
try
PHP Code:print_r($_GET);
print_r($_POST);
print_r($_REQUEST);
whatever the mind
can conceive and believe
it can achieve
-
Jan 18, 2007, 04:40 #3
- Join Date
- May 2005
- Location
- S.W. France
- Posts
- 2,496
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
post you phpinfo() result
A Little Knowledge Is A Very Dangerous Thing.......
That Makes Me A Lethal Weapon !!!!!!!!
Contract PHP Programming
-
Jan 18, 2007, 07:05 #4
- Join Date
- Jun 2003
- Location
- Melbourne, Australia
- Posts
- 440
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jan 19, 2007, 04:54 #5
- Join Date
- Feb 2005
- Location
- Aveiro, Portugal
- Posts
- 165
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
I have a simple form:
<htmlcode>
<FORM METHOD="POST" ACTION="test.php">
<INPUT TYPE="text" NAME="txt1"><br>
<INPUT TYPE="text" NAME="txt2"><br>
<INPUT TYPE="submit" value="Enviar">
</FORM>
</htmlcode>
and the processing script:
<phpcode>
echo "GET: ".print_r($_GET)."<br>";
echo "POST: ".print_r($_POST)."<br>";
echo "REQUEST: ".print_r($_REQUEST)."<br>";
</phpcode>
The output is:
Array ( ) GET: 1
Array ( ) POST: 1
Array ( [box1] => ) REQUEST: 1
in other words, empty!
If I change the form method to GET, the result is:
Array ( [txt1] => value1 [txt2] => value2 ) GET: 1
Array ( ) POST: 1
Array ( [txt1] => value1 [txt2] => value2 [box1] => ) REQUEST: 1
The problem is just concerning POST.
Yes, I did send something through the textboxes...
As requested, a link to my phpinfo. It's just a page where I pasted my phpinfo. It was taken from my pc. It has nothing to do with the server it's on.
<link>http://alunos.fam.ulusiada.pt/~f32000047/test.php.htm</link>Yours truely
Mário Ramos
-
Jan 19, 2007, 05:10 #6
- Join Date
- May 2006
- Location
- Lancaster University, UK
- Posts
- 7,062
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
i don't see any problems in your PHP info.
do you have access to editing test.php? if so, comment out all of the current script, then put this:
PHP Code:<?
echo "txt1: ".$_POST['txt1'];
echo "\n<br>txt2: ".$_POST['txt2'];
?>Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Jan 19, 2007, 05:12 #7
The code is working fine on my machine. BTW, you are using the release candidate version of PHP which might show(though not very likely) some buggy behavior. Try reverting back to a stable version or checking the bug database at php.net
-
Jan 19, 2007, 05:28 #8
- Join Date
- May 2005
- Location
- S.W. France
- Posts
- 2,496
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
A Little Knowledge Is A Very Dangerous Thing.......
That Makes Me A Lethal Weapon !!!!!!!!
Contract PHP Programming
-
Jan 19, 2007, 05:34 #9Wheres the [box1] key coming from ??
-
Jan 19, 2007, 05:36 #10
- Join Date
- Feb 2005
- Location
- Aveiro, Portugal
- Posts
- 165
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Well, I'm not at home right now, so won't be able to test it.
Don't know what/where [box1] is comming from.Yours truely
Mário Ramos
-
Jan 19, 2007, 05:37 #11
- Join Date
- May 2005
- Location
- S.W. France
- Posts
- 2,496
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
A Little Knowledge Is A Very Dangerous Thing.......
That Makes Me A Lethal Weapon !!!!!!!!
Contract PHP Programming
-
Jan 19, 2007, 05:39 #12
- Join Date
- Feb 2005
- Location
- Aveiro, Portugal
- Posts
- 165
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Could it have something to do with variables order?
Mine are "GPCS".Yours truely
Mário Ramos
-
Jan 19, 2007, 05:46 #13
Originally Posted by mjpr
With this setting, cookies and Server variables would overwrite get and post variables should the variable name conflict occur. If get variables show up fine, there is hardly any possibility that post variables would be overwritten.
-
Jan 19, 2007, 05:47 #14
- Join Date
- May 2005
- Location
- S.W. France
- Posts
- 2,496
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
A Little Knowledge Is A Very Dangerous Thing.......
That Makes Me A Lethal Weapon !!!!!!!!
Contract PHP Programming
-
Jan 19, 2007, 05:49 #15
- Join Date
- Feb 2005
- Location
- Aveiro, Portugal
- Posts
- 165
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Ok Guys,
Thanks for all your input.
I will try to re-install the latest stable version and I'll get back to you.Yours truely
Mário Ramos
-
Jan 23, 2007, 10:15 #16
- Join Date
- Feb 2005
- Location
- Aveiro, Portugal
- Posts
- 165
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Hi all,
I removed my php5.2 installation and installed php5.1.6
But I'm still having the same problem.
Here are links to my httpd.conf and php.ini files
<link>
http://alunos.fam.ulusiada.pt/~f32000047/httpd.conf
</link>
<link>
http://alunos.fam.ulusiada.pt/~f32000047/php.ini
</link>
Maybe something wrong in them...
ThankxYours truely
Mário Ramos
Bookmarks