Solved

get var? after hashtag from url

Posted on 2014-11-20
2
163 Views
Last Modified: 2014-11-20
I used to have  a wordpress plugin that, when being used, would include a ? in the url.

I would test for that var it used, and adjust my code accordingly, to display certain things, like this:

if ( isset( $wp_query->query_vars['sample'] ) ) {

I just updated the plugin and now, instead of having a ?, then have a hashtag, and then the var I need to look for.

Apparently, my 'if' is not triggered anymore, so I'm thinking the change makes it not a query var.

So... with it as a hashtag, how can I write an if for it?

Thanks for any help,

Chris
0
Comment
Question by:St_Aug_Beach_Bum
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40456626
Anything after the hashtag is only available at the browser and is not sent back to the server.
Your only real option is, depending on the scenario, use js to get the hashtag and store it in an input, for example if you were submitting a form, so you can grab the input value at the server.
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40456639
Ohh... bummer. Yeh, going to have to rethink this.

The plugin author has been very receptive to feedback, I'll ask her to see if she can give me a better solution.

Thank you very much!

Chris
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now