stop direct access to page php and Jquery -


People need to stop me, that the user can call the webpage directly from the address bar like: www. Site com / page.php , it should not be allowed.

I have tried many ways, but I block all the Ajax menus too, basically when I log in directly on the page, I can go back to the entry page. Also, during the session, when working in the menu while calling the jQuery page from the page.

How can I decide?

This is a link from your menu - the name of the page in the page attribute you are linking to Are:

  & lt; One page = "page1.php" & gt; Page 1 & lt; / A & gt;   

Your Client Script:

  $ ('a'). Click (function () {var page = $ (this) .attr ('page'); SetCookie ('page', page); // & lt; == You need to write a cookie settings function for this location ; Href = page;}   

Then for the target page in your php, read the cookie and compare it with the page name. If this is correct, then do not redirect to your login page. .

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -