Page 1 of 1

Problem passing variables in URL...

PostPosted: 29. August 2006 07:09
by philsphiles
I am quite familiar with WAMP but new to XAMPP.

I have successfully installed XAMPP including changing my document source to another hard drive and directory. I strictly run it locally on my desktop as a development environment. Basic webpage display behaviour looks fine.

My problem is that variables are not being passed in the URL. The simple script I am using to examine this problem is as follows;

page1.php

<a href="page2.php?id=World">Hello</a>

page2.php

<?php
if ($_POST['id']<>""){ echo $_POST['id'];}
else {echo "Doh!";}
?>

I have combed the forum, there are many references to similar scenarios but no clear answers. I have tried turning global variables on and off but it makes no difference.

Any suggestions would be greatly appreciated by me and I suspect by some others.

Regards to all.

OS->XP Home SP2

PostPosted: 29. August 2006 09:54
by Wiedmann
What happens (error message, output, ...)?

PostPosted: 29. August 2006 10:28
by Dave_L
For variables passed in a URL, use $_GET, not $_POST.

PostPosted: 29. August 2006 12:23
by philsphiles
And here I thought I had a real problem but it was nothing more than a newbie error @#$%^&

Thanks all.

:oops: