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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP - Carry link info to next page

Status
Not open for further replies.

Skippie1

Technical User
May 7, 2012
29
0
0
ZA
Hi,

If I have a link on my page for example ABC123 that takes you to an "order" page. How do I get that the link name "ABC123" appear on the "order" page.

So if somebody clicks on the ABC123 link it must display on the "order" page" Thank you for buying ABC123

Thank you in advance!!
 
The question is kind of vague, but if I understand you correctly:

[ul]
[li]You can add a parameter to the link and use that to carry the information over.[/li]

[li]Or you can use a form to submit any data you want to the next page?[/li]

[/ul]

If you can be a bit more specific about what you want we can probably help you with more detailed answers.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
All I require is whatever link somebody click on my website, that particular link name must just appear in the next page. For example lets say I have a link ABC123 or XYX987 it must just be passed on to the next page. So if the person click on ABC123 it must display on the next page for example "Thank you for choosing ABC123." I will then explain to the persons what to do with that code but the particular link code must be displayed on the next page.

Hope this is a better explanation.
 
You can try something like this:

Code:
<a href="pagetocall.php?link=ABC123">ABC123</a>

<a href="pagetocall.php?link=XYX987">XYX987</a>

And then in your Second page
Code:
$LinkValue=$_GET['link'];

$_GET['link'] would have the value of the clicked link in your second page.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Thank you very much. It is working. Just want to find out can I use some sort of variable code because I have to add and delete a lot of products every week and it will be very time consuming to add that link code to each product. Is there a code something like this:

<a href="pagetocall.php?link=XXXXXX">XXXXXX</a>

where the X represent whatever is written in the link?
 
Yes, but that's up to how you build the links.

You can do something like:

Code:
<a href="pagetocall.php?link=<?php echo $linkvariable; ?>"><?php echo $linkvariable; ?></a>

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top