Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem: Passing Variables with href localy

Status
Not open for further replies.

alsaffar

Programmer
Oct 25, 2001
165
KW
Hi guys,

The follwing script is not working localy while its working fine on the net, the problem is I can't see the variable the I passed with the link, I tried so many ways to replace $Parameter with $HTTP_POST_VARS and $HTTP_SESSION_VARS ...etc but nothing is working, I know the solution is realy easy and silly but I couldn't find it by my self.

Please feed me back guys

Test.php:
-----------------------------------------------------------
Parameter:
<? echo $Parameter; ?><BR>
<a href=Test.php?Parameter=1>Test the Parameter</a>
-----------------------------------------------------------

OS: Windows XP Pro
Browser: IE 6
Apache: 2.0.4
PHP: 4.2.2

Ali
 
Test.php:
-----------------------------------------------------------
Parameter:
<? echo $_GET[Parameter]; ?><BR>
<a href=Test.php?Parameter=1>Test the Parameter</a>
----------------------------------------------------------- ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
I've run into the same problem. Here's another related question: Why is this working on the net server but a local network server does not pass the variable?

I have a similar set-up... Mac OSX running Apache with PHP on my home network. I use a Windows 98 box to author pages and then access them on the local Mac test server. The variable $page does not pass on my local OSX test server but it works fine on my hosting provider's server. KarveR's remark is useful but I am curious why this happens in the first place. Can I be enlightened?

<a href=index.php?pagecontent=$page>Click me</a>
 
You probably have register_globals off, while your hoster has it on. If you use $_GET['page'] instead of $page, that line should work. //Daniel
 
Also the difference in versions of PHP will change behaviour of the way globals are assigned and collected. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top