Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-04-2003, 12:12 PM   #1
LQ Newbie
Registered: Sep 2003
Posts: 6

Rep: Reputation: 0
Unhappy Apache, php auto parameter variable empty

Sorry, don't know if this is a setup, newbie or programming question.

Red Hat Linux 8, Apache/2.0.47 (Unix) PHP/4.3.3

Automatic assignment of html parameters seems not to be working. Setups were all by the book. No changes to defaults.
Same files work with newest windows xp php, apache versions.

Could there be some config needed in php, apache?

I know these are relatively new versions, but this couldn't be a bug could it?

File 1.php ==>

<form method="GET" action="2.php">
<input type="text" name="parm1">
<input type="submit">

Display in browser, enter anything, press submit.

File 2.php ==>

The value of parm1 is : <? echo $parm1; ?> always empty.
Old 09-04-2003, 03:51 PM   #2
Registered: Apr 2002
Location: Los Gatos, CA
Distribution: boring redhat 9
Posts: 163

Rep: Reputation: 30
Recent change in PHP defaults led to this. Two options:

use <? echo $_POST[param1]; ?> (the better way)

in php.ini turn "register_globals" to ON (the lazy way, but needed if you're moving existing code to a newer version)

If you're writing new stuff, use the $_GET $_POST and related variables.
Old 09-04-2003, 05:05 PM   #3
LQ Newbie
Registered: Sep 2003
Posts: 6

Original Poster
Rep: Reputation: 0
That does look like a beter way. Makes variable definition explicit. easier to to debug in long run. You also have to know whether it's a post or get call. Thanks lot.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing one php function result as a parameter to another php function davee Programming 13 09-12-2004 12:08 PM
auto variable vijeesh_ep Programming 1 08-13-2004 02:43 PM
PHP Pass Parameter Gerardoj Programming 2 05-25-2004 08:12 AM
php scripts return empty pages ararag Linux - Software 1 02-23-2004 10:46 AM
PHP/Apache/Redhat 9.0 variable transmission problems gizmogadgetus Red Hat 8 11-02-2003 08:53 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration