To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > Windows Help

Windows Help Help with the Windows operating system

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-02-2000, 02:48 PM   #1
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
PHP4/Win98/PWS Problem

Hello,

I'm in the process of learning PHP. I've set up PHP4 on my dev machine currently running Win98. I'm fairly solid with ASP but want the cross platform and open source benefits of PHP.

Set up of PHP4 and mySQL seemed to go fine. Hello World worked fine. However, when I decided to pass some info from one page to another I ran into problems.

The output from the following code doesn't include the parameter passed from a form on the previous page although I'm sure it should.

<?php
echo ("<p>Thankyou " .$FName. "We appreciate your time</p>");
?>

All I get is

Thankyou We appreciate your time.

Any thoughts ? The PHP is obviously being processed. I copied some Wrox code and that does exactly the same i.e. is processed but ignores what I would term the QueryString data.

Dave
Anon is offline   Reply With Quote
Old 08-03-2000, 05:50 AM   #2
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: PHP4/Win98/PWS Problem

I've now installed Apache and it's the same so I'm assuming the problem is with PHP....
Anon is offline   Reply With Quote
Old 08-03-2000, 07:16 AM   #3
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: PHP4/Win98/PWS Problem

You can try

$FName = $HTTP_GET_VARS["FName"];


Shang
Anon is offline   Reply With Quote
Old 08-03-2000, 07:50 AM   #4
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: PHP4/Win98/PWS Problem

Just does the same.....perplexing...
Anon is offline   Reply With Quote
Old 08-03-2000, 04:50 PM   #5
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
Installing PHP3 Fixed it

Running on Apache the problem was fixed by installing PHP3 instead of PHP4. Is this an issue with PHP4 then ?
Anon is offline   Reply With Quote
Old 08-04-2000, 06:16 AM   #6
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: PHP4/Win98/PWS Problem

PHP4/NT4/IIS4 no this problem.
You can use phpinfo() to see a list of all
of the PHP variables.
It's very useful.

<?php
$HTTP_VARS = array_merge($HTTP_GET_VARS,$HTTP_POST_VARS);
$FName = $HTTP_VARS["FName"];

echo ("<p>Thankyou " .$FName. "We appreciate your time</p>");

phpinfo();
?>

Anon is offline   Reply With Quote
Old 08-04-2000, 10:33 AM   #7
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: PHP4/Win98/PWS Problem

Check these sections of your php.ini file. They control the HTTP_*_VARS and whether you can take the shortcut using just $fName. I believe I read they were phasing the shortcut out.

register_globals = Off
"Whether or not to register the EGPCS variables as global variables. You may want to turn this off if you don't want to clutter your scripts' global scope with user data. This makes most sense when coupled with track_vars - in which case you can access all of the GPC variables through the $HTTP_*_VARS[], variables."

register_argc_argv = Off
"This directive tells PHP whether to declare the argv&argc variables (that would contain the GET information). If you don't use these variables, you should turn it off for
increased performance"

track_vars = On
"enable the $HTTP_*_VARS[] arrays, where * is one of ENV, POST, GET, COOKIE or SERVER."
Anon is offline   Reply With Quote
Old 08-04-2000, 11:00 AM   #8
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
Probable solution ?

I have just noticed a difference between my PHP3 and PHP4 ini files (as downloaded from php.net) that may be the cause.

PHP3
magic_quotes_gpc = On

PHP4
magic_quotes_gpc = off

I'll go and check.
Anon is offline   Reply With Quote
Old 08-04-2000, 11:18 AM   #9
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
I'm a dummy

If I'd read the ini file notes properly I would have solved this in two seconds flat. Sorry if I've wasted anyones time.....

"; - register_globals = Off
; Global variables are no longer registered for input data (POST, GET, cookies,
; environment and other server variables). Instead of using $foo, you must use
; $HTTP_POST_VARS["foo"], $HTTP_GET_VARS["foo"], $HTTP_COOKIE_VARS["foo"],
; $HTTP_ENV_VARS["foo"] or $HTTP_SERVER_VARS["foo"], depending on which kind
; of input source you're expecting 'foo' to come from.

:-(
Anon is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 09:20 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.