Problem passing variables in URL...

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Problem passing variables in URL...

Postby philsphiles » 29. August 2006 07:09

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
philsphiles
 
Posts: 2
Joined: 29. August 2006 04:27

Postby Wiedmann » 29. August 2006 09:54

What happens (error message, output, ...)?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Dave_L » 29. August 2006 10:28

For variables passed in a URL, use $_GET, not $_POST.
User avatar
Dave_L
 
Posts: 212
Joined: 23. October 2004 00:43

Postby philsphiles » 29. August 2006 12:23

And here I thought I had a real problem but it was nothing more than a newbie error @#$%^&

Thanks all.

:oops:
philsphiles
 
Posts: 2
Joined: 29. August 2006 04:27


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 125 guests