Ajax windows as site page

Hello everyone.

I ran into a problem while creating ajax windows.

A separate page is created, which gets into the ajax window. You can go to this page at the address that the tap does not need. How can I disable direct access to such pages? I think it is necessary to check if iframe is a window or not, but how to do it?

Thanks in advance.


Answer 1

I sniffed that colorBox a little. In general, something can be thought of. I made an examplevery primitive and just to show how it works. By clicking on the link, we pull out its ID. In the example, I used the ID as a kind of marker, and you can use it to pull out a link from the database, for example. Or initially create an array of links. In general, here is already to your taste.


Answer 2

If the user does not know about GET or POST, then pass some parameter through the link to the Ajax window
Example:

$ajax = $_GET['ajax'];
    if ($ajax){
    //   ,         .
    }
    //      ,   ajax      
    else (!$ajax){
    echo "       ";
    }

But it’s better to send all this via POST, because if the user sees this “ajax”, he will simply substitute it and that’s it, and via POST he will substitute something.

Leave a reply

Please enter your comment!
Please enter your name here