Justtechjobs.com Find a programming school near you






Online Campus Both


php-install | 2002112

Re: [PHP-INST] Help, getting nothing from $_GET From: Stephen Edmonds (stephen.edmonds5 <email protected>)
Date: 11/18/02

Also, try calling phpinfo(32);

The 32 settings makes it show all the variables and how to access them
EG _SERVER["NAME"] mysever
Just add on the $ and you have the variable to use

Stephen

----- Original Message -----
From: "Robert Duran" <robert <email protected>>
To: <php-install <email protected>>
Sent: Monday, November 18, 2002 9:22 PM
Subject: [PHP-INST] Help, getting nothing from $_GET

   I've installed PHP and it is working except for parameters in the
URL. I'm aware of the register globals change and am trying to use
$_GET to read parameters passed in the url (i.e.
http://localhost/~me/test.php?myvar=2). I also noticed that if I
register a session, the session url parameter (PHPSESSID) has a new
value every time I visit the page. I only have this problem on my
laptop, I installed the same software on my server and it works fine
there. Here's some info:

Laptop:
PowerBook G4
512 Megs Memory
Mac OS 10.2.2 (Jaguar)
Apache 1.3.26
PHP 4.2.1 (openbase support added)

Server:
Xserve
Dual 1Ghz G4
512 Megs memory
Mac OS 10.2.2
Apache 1.3.26
PHP 4.2.1 (openbase support added)

   Here's a code snippet from inside the body tag of test2.php:

{{

<?php

  $avar = 50;

  $tvar = 60;

  $svar = $_GET[ "svar"];
  echo "$avar";
  echo "test";
  echo "$tvar";
  echo "test";
  echo "$svar";
?>

}}<br><br>

   I call this file with:

http://localhost/~mysite/test2.php?svar=2

   The resulting page displays:

{{ test60test }}

On my server I access the exact same file with:

http://www.mysite.com/test2.php?svar=2

and get:

{{ test60test2 }}

Notice that it saw the svar assignment. Also note that neither case
made the assignment to avar.

I've been trying to resolve this for days. Right now i'm thinking it
has to do with using localhost for my local web service. I've tried
setting ServerName in the apache config to both localhost and 127.0.0.1
and have had no luck. I need to have my website function when my
laptop is not connected to the internet (i.e. no DNS available).

All references to $_GET I find in the archives involve the new register
globals default. That isn't the problem i'm having.

I'm quite at a loss now. Any help would be appreciated.

Thanks (a lot) in advance,

---------------------------------
Robert Duran
robert <email protected>
rduran <email protected>
---------------------------------

-- 
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php