PhilipK Posted February 20, 2011 Share Posted February 20, 2011 Is it possible to use #anchors to set a variable in PHP? For instance if I the url was http://example.com/portfolio.php#flash have $location = flash ??? Here is my code so far.. <script type="text/javascript"> Shadowbox.open({ content: '<div id="<?php echo "$location" ?> ">Welcome to my website!</div>', player: "html", title: "Welcome", height: 350, width: 350 }); </script> Thanks in advance Link to comment https://forums.phpfreaks.com/topic/228318-can-i-set-a-var-to-anchor-value/ Share on other sites More sharing options...
BlueSkyIS Posted February 20, 2011 Share Posted February 20, 2011 no. the anchor is for the web client and is not sent to the server. Link to comment https://forums.phpfreaks.com/topic/228318-can-i-set-a-var-to-anchor-value/#findComment-1177337 Share on other sites More sharing options...
PhilipK Posted February 20, 2011 Author Share Posted February 20, 2011 Oh, is their a simple alternative? I see a lot of sites using links like http://example.com/portfolio.php?flash I'm not sure how that works, but I'm open to other solutions to solve this problem. Thanks again Link to comment https://forums.phpfreaks.com/topic/228318-can-i-set-a-var-to-anchor-value/#findComment-1177339 Share on other sites More sharing options...
kenrbnsn Posted February 20, 2011 Share Posted February 20, 2011 You could probably capture it via Javascript and send it back to PHP via AJAX. Ken Link to comment https://forums.phpfreaks.com/topic/228318-can-i-set-a-var-to-anchor-value/#findComment-1177340 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.