php-install Digest 10 Jul 2002 12:33:51 -0000 Issue 925

Topics (messages 7679 through 7684):

PHP doesn't except parameters?
        7679 by: Alex P.
        7680 by: Rasmus Lerdorf
        7681 by: Steve Cayford

PHP doesn't accept url parameters
        7682 by: Alex P.
        7683 by: Shrock, Court

PHP on Apache Install
        7684 by: Guerrero, Ruben

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi all, I'm a newbie to PHP. When I installed PHP 4.2 and apache 1.3 onto my
computer, it all worked. I can generate web pages and all that, but when I
tri to pass a parameter through the URL to the PHP script, it doesn't work.
Their are no error messages it just does go through. What's


--- End Message ---
--- Begin Message ---
Turn on register_globals in your php.ini file

On Thu, 4 Jul 2002, Alex P. wrote:

> Hi all, I'm a newbie to PHP. When I installed PHP 4.2 and apache 1.3 onto my
> computer, it all worked. I can generate web pages and all that, but when I
> tri to pass a parameter through the URL to the PHP script, it doesn't work.
> Their are no error messages it just does go through. What's
>
>
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---

On Thursday, July 4, 2002, at 05:59  PM, Alex P. wrote:

> Hi all, I'm a newbie to PHP. When I installed PHP 4.2 and apache 1.3 
> onto my
> computer, it all worked. I can generate web pages and all that, but 
> when I
> tri to pass a parameter through the URL to the PHP script, it doesn't 
> work.
> Their are no error messages it just does go through.

How are you checking for the value?

If your url is something like 
http://yoursite.com/yourscript.php?yourvariable=value

then in yourscript.php you should be able to access the yourvariable 
value through the
auto-global GET array like this: $_GET['yourvariable']

So you could say
print("yourvariable: " . $_GET['yourvariable'] . "<br>\n");

PHP doesn't automatically create a global variable $yourvariable for you 
anymore unless you turn register_globals on.

--- End Message ---
--- Begin Message ---
Hi, I installed PHP 4.2.0 with apache 1.3 on my win98 machine (my only
machine) and It works. Ican can generate web pages and all that, but when I
tried to accept a parameter from the URL, the varible turned up null.
What's going on? Thanx.


--- End Message ---
--- Begin Message ---
In short, you need to access your variable via the superglobal arrays as
specified here:
http://www.php.net/manual/en/language.variables.predefined.php

Also, you can read from
http://www.php.net/manual/en/configuration.php#configuration.file ::

register_globals boolean
Tells whether or not to register the EGPCS (Environment, GET, POST, Cookie,
Server) variables as global variables. For example; if register_globals =
on, the url http://www.example.com/test.php?id=3 will produce $id. Or,
$DOCUMENT_ROOT from $_SERVER['DOCUMENT_ROOT']. You may want to turn this off
if you don't want to clutter your scripts' global scope with user data. As
of PHP 4.2.0, this directive defaults to off. It's preferred to go through
PHP Predefined Variables instead, such as the superglobals: $_ENV, $_GET,
$_POST, $_COOKIE, and $_SERVER. Please read the security chapter on Using
register_globals for related information. 

Please note that register_globals cannot be set at runtime (ini_set()).
Although, you can use .htaccess if your host allows it as described above.
An example .htaccess entry: php_flag register_globals on. 

Note: register_globals is affected by the variables_order directive. 


> -----Original Message-----
> From: Alex P. [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, July 09, 2002 6:49 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-INST] PHP doesn't accept url parameters
> 
> 
> Hi, I installed PHP 4.2.0 with apache 1.3 on my win98 machine (my only
> machine) and It works. Ican can generate web pages and all 
> that, but when I tried to accept a parameter from the URL, 
> the varible turned up null. What's going on? Thanx.
> 
> 
> 
> -- 
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
I am trying to install PHP version 4.2.1 on Apache version 2.0.39 on a Win32
platform.  When I try to load the phpinfo.php script using my browser it
loads a "object can't be found" error.  I checked the location of the script
and everything is where it's suppose to be.

Here's how I installed..........
Downloaded php4apache2.dll and replace it with the existing one in the
"c:\php\sapi" (I had to create the sapi folder because I didn't find it in
the PHP directory.
Modified htppd.conf to include these two lines:
LoadModule php4_module c:/php/sapi/php4apache2.dll 
AddType application/x-httpd-php .php .php3 .php4 .phtml

Any advice or help you could provide me with would be greatly appreciated.
Thanks.

Ruben Guerrero
Spear, Leeds & Kellogg
Network Operations | Engineering
120 Broadway | New York, NY 10005
Phone: (212) 433-7692



--- End Message ---

Reply via email to