Jump to content

[SOLVED] Passing parameters through the <a> tag


phpsnipes

Recommended Posts

Hey guys,

 

I have some html embedded into my php application.  I have a table and based on certain things, I need to be able to launch a new report from a certain row of the table.  So, I am using <a href = "http://...">Something</a>.  Now my question is, how can I pass on information about "Something" to the page which will be launched?  I know I can do it with forms and call $POST or $GET to obtain info from a form, but I don't want to do that as that would make the table look hideous.

 

So basically, how do you pass in parameters through a hyperlink and how would the new page be able to extract the values of the parameters passed in?  I would be really grateful if someone could answer my question. 

 

Thanks in advance! 

Link to comment
Share on other sites

example link
[code\<a href="nextpage.php?this=1&that=2&other=wombat>click</a>

 

and in nextpage.php

<?php
$this = $_GET['this']; // equals 1
$that = $_GET['that']; // equals 2
$other = $_GET['other']; // equals "wombat"
... 
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.