Jump to content

[SOLVED] Passing id through URL


Nightkon

Recommended Posts

Hi All,

 

I'm relatively new to PHP and new to these forums. I am having trouble with a relatively simple task. I have a form split over multiple pages and I am trying to pass the id value between these pages in the URL.

 

Currently the page looks like this: http://localhost:8888/OrganiseIDPLAN.php?id=AAO

 

I have created a link to another page that looks like this: <a href="OrganiseIDASX.php?id=">

 

I do not know what to make the id = to pick up the hidden field in which id is stored. I have tried everything I can think of. The data is not sensative though I was wondering if it may be easier to use sessions or cookies to do this.

 

Thanks for your help

Link to comment
https://forums.phpfreaks.com/topic/53151-solved-passing-id-through-url/
Share on other sites

search the forum for $_GET, as this topic has be coved lots of times one of which was less than a day ago!

<a href="OrganiseIDASX.php?id=<?php echo $_GET['id'] ?>">

 

If you have a form with method='GET' all the values from the elements are processed via the URL

 

ie ?id=1&name=madtechie

 

to grab this info use

 

$_GET['id']; //for the ID (1)

$_GET['name']; //for the name (madtechie)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.