Posting anchor string to another page.

Hi. I am fairly new to php so the solution may be obvious to some of you.

On one of my pages I retrieve a query from my database and the results is echoed out inside individual anchor tags as hyperlinks.

I want to then post the value of whichever hyperlink the user clicks on too another page. I assume hidden forms will have to be used for this but I am not sure.

So, right now I have this:

//PHP file runs query returning the following results



If user clicks on “result1”, I want to then POST this value onto another page and then pull more data about this db entry.

How do I achieve this?

Thanks. :slight_smile:

I’m not sure if you want to POST the value rather than GET the value? Do you know the difference between POST and GET?

Let’s say you have a URL like myscript.php?myvariable=result1

In myscript.php you would GET myvariable e.g. $_GET[‘myvariable’] which would be ‘result1’

Sponsor our Newsletter | Privacy Policy | Terms of Service