Jump to content

no anchor $_SERVER['HTTP_REFERER']


jakebur01

Recommended Posts

How can I get http_referer to retrieve the anchor in the url?  It keeps url variables, but it does not get the anchor.

 

Example:

 

http://example.com/ex.php?id=10#tab=3

 

 

All http_referrer catches is http://example.com/ex.php?id=10

 

code:

$refer = $_SERVER['HTTP_REFERER'];
<script type="text/javascript">
<!--
window.location = "<?PHP echo"$refer";?>"
//-->
</script>

Link to comment
Share on other sites

Still searching on how to store a javascript value into a php variable.  I haven't figured it out yet.

<?PHP $hash="<script type=text/javascript>

document.write(location.hash);

</script>"; ?>

<input type="hidden" name="hash" id="textfield" value="<?php echo"$hash";?>"/>

 

Link to comment
Share on other sites

I basically have a page for updating information with 4 or 5 different tabs to navigate between.  When the info is saved, I submit/post to the same page and I have an if $_POST statement at the top of the page that catches it.  I am then trying to redirect to the the same page and same anchor.

 

 

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.