Jump to content

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.

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.