Ive googled how to pass indentification into a new page and other various keywords and not finding much. The case isnt as simple as using $_SESSION as the id isnt the current users. On the page is a table, in this table is various user id's and a link to a new page in every row. The new page will be the process which interacts with the user id of that row.
User ID - Title - Link
User ID - Title - Link
User ID - Title - Link
User ID - Title - Link
isit possible?
Pass an ID into new page.
Moderator: General Moderators
Re: Pass an ID into new page.
Anything's possible if you wish hard enough. 
Best method is to pass the id in as a get variable
(The Link has been replaced with the html code)
USER ID - Title - Link
1 - Tom - <a href="yourscript.php?id=1">Link</a>
2 - Tom - <a href="yourscript.php?id=2">Link</a>
3 - Tom - <a href="yourscript.php?id=3">Link</a>
In the yourscript.php you can catch the id using this code:
If the id is set, not zero and is a number it will assign the number to $id, otherwise it will set it as zero. 
Best method is to pass the id in as a get variable
(The Link has been replaced with the html code)
USER ID - Title - Link
1 - Tom - <a href="yourscript.php?id=1">Link</a>
2 - Tom - <a href="yourscript.php?id=2">Link</a>
3 - Tom - <a href="yourscript.php?id=3">Link</a>
In the yourscript.php you can catch the id using this code:
Code: Select all
$id = (isset($_GET['id']) && !empty($_GET['id']) && is_numeric($_GET['id'])) ? $_GET['id'] : 0;Re: Pass an ID into new page.
Alan G to the rescue!
I need to buy one of you from my local store
Havnt tested it yet but your replies always work
I need to buy one of you from my local store
Havnt tested it yet but your replies always work
Re: Pass an ID into new page.
As long as the current user doesn't change, you can put whatever you want in $_SESSION. Whatever. It doesn't have to be directly related to the current user.synical21 wrote:The case isnt as simple as using $_SESSION as the id isnt the current users.
Re: Pass an ID into new page.
synical21 wrote:Alan G to the rescue!![]()
I need to buy one of you from my local store
Havnt tested it yet but your replies always work
Re: Pass an ID into new page.
Just tested works like a charm thanks alan