Jump to content

load link name into php variable??


kate_rose

Recommended Posts

Hi,

 

Is there a php function which allows me to load the name of the link into a variable when the link is clicked on?

 

I am new at this but I have looked for quite a while & have not found a way to do it.  I know you can get the url that visitors to your site come from but I am not sure how to modify that to get the link name or even if I could.

 

Thanks for any help you can provide.

 

Kate

Link to comment
https://forums.phpfreaks.com/topic/83443-load-link-name-into-php-variable/
Share on other sites

So like.... if you had:

 

http://somesite.com/page.php#content1

 

You would to grab content1?

 

If so, you probably want to look into the $_SERVER array especially the QUERY_STRING, REQUEST_URI and any other url related keys....

 

Edit:  Bah... I had suspected this, so I looked into it and was right.... It appears that the # things are just client side (which makes sense), so there's no way to tell from the server what they are.

 

I think javascript can read anchors though if that helps in some weird way.

Archived

This topic is now archived and is closed to further replies.

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