Forum Moderators: coopster

Message Too Old, No Replies

Looking for a PHP script that will call a link by record number

         

dak142

2:57 am on Apr 3, 2004 (gmt 0)

10+ Year Member



Hello,

I am looking for a script, or at least the logic behind this if anyone can help me. I keep my website records/links in mysql database. Curretly, I display them as is, being if you mouse over the link, the actual link can be seen.

What I want to do is, have just the record number included in the link where the link can not been seen when you mouseover. When the link is clicked, a PHP script will go to that record number, extract the link from the record, and open a window to the link. Is there an avaiable script out there to do this? If not what steps are need to accompish this?

VectorJ

3:45 am on Apr 3, 2004 (gmt 0)

10+ Year Member



You'll need to link to a php page that takes the record number as an argument. So the link would be "goto.php?record=1234", then goto.php would read in the record number, look up the record and its associated link, and redirect the user to that link.

dak142

4:05 am on Apr 3, 2004 (gmt 0)

10+ Year Member



Are you saying it would be like a form post to another page that handles the post when it is submited?

I also noticed you made use of a "?" after the proposed link. What is the significance of that? I am still learning PHP, I can write many codes with the help of my books, but not a whole lot offof the top of my head.

VectorJ

4:20 pm on Apr 5, 2004 (gmt 0)

10+ Year Member



Yeah, it would be like a form post, except instead of using a form, you'll construct the GET query manually (by putting it into your link).

The question mark signifies the beginning of the variables that you'll be sending to the php script; otherwise the webserver will not properly interpret the URL (you can see the question mark at work in the url for webmasterworld).