PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 26th, 2004, 10:11 PM
peytons peytons is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 peytons User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question $_GET and $_POST not initialized

I'm having trouble with $_GET and $_POST not being initialized when they should be.

I call the script via a form (with either GET or POST) or via the URL script.php?testvar=testval

In the script, I am sure that nothing in $_GET or $_POST are being initialized (according to phpinfo()).

I have checked register_globals and register_long_arrays, neither seems to be the problem.

Furthermore, I'm not sure whether this is a problem with php.exe or my web server (omni httpd)..

QUERY_STRING does seem to be set correctly.

Can anyone give me some tips on this very strange problem?

Thanks!

-peyton

Reply With Quote
  #2  
Old September 27th, 2004, 07:18 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 16
First off simple test would be to chuck something like this in the target page and see what php kicks out -

PHP Code:
echo '$_GET<br />'
foreach ($_GET as $key => $value)
  echo 
$key ' - ' $value '<br />';

echo 
'<br />$_POST<br />';
foreach (
$_POST as $key => $value)
  echo 
$key ' - ' $value '<br />'


This code was written on the forum and is thus untested (ie probably broken in some way) but should let you see if the arrays are being filled out with anything.

-KM-

Reply With Quote
  #3  
Old September 27th, 2004, 10:00 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 785 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 17
The easy way to check from any PHP script would be :
Code:
<pre>
POST
<?php print_r($_POST); ?>
GET
<?php print_r($_GET); ?>
</pre>
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #4  
Old September 27th, 2004, 03:56 PM
peytons peytons is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 peytons User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
can check, can't initialize

Yep, I have been able to check whether the variables were initialized, it's just that they aren't the arrays are empty!

For now I've switched to php4, but I'm pretty sure this has to do with php5. Also noticed that phpinfo kicks out settings w/out pretty HTML now. Even with html_errors on.

Shrug.

-peyton

Reply With Quote
  #5  
Old December 1st, 2004, 04:45 PM
mel mel is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Colorado
Posts: 7 mel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Not initialized

Using the above test, I get the following output:

POST
Array
(
)
GET
Array
(
)

So it looks like the variables aren't getting initialized - but this is the first I've heard of this, considering they're superglobals, I expected them to be initialized already? My register_globals is on, though I'm stull using $_GET[ID] and I'm not getting anything returned. This is on a migration to a new Linux server, running php 4.3.2. I'm stumped, please advise!

Reply With Quote
  #6  
Old December 1st, 2004, 05:58 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 785 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 17
lets check out your code...

Reply With Quote
  #7  
Old December 1st, 2004, 06:07 PM
mel mel is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Colorado
Posts: 7 mel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrow

well, real simply its:
www.url.com/photo.php?ID=174

and in the page its:
$ID = $_GET['ID'];
echo $ID;

It works locally and on my current hosting server, but I can't figure out why it won't work on this new hosting server when it looks like the php.ini is setup the same.

Thanks for your help.
Mel

Reply With Quote
  #8  
Old December 18th, 2004, 02:57 PM
jcb jcb is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 4 jcb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question same problem

I've got the same problem. Did you figure out what was wrong?

I'm running Apache 1.3.33 & PHP 5.0.2 on windows.

Reply With Quote
  #9  
Old December 20th, 2004, 03:33 PM
mel mel is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Colorado
Posts: 7 mel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post PHP-Wrapper

Apparently my hosting company is using a php-wrapper which is ineffective for the site preview. When DNS propagation completes and I hit the site via it's name, everything works fine.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > $_GET and $_POST not initialized


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap