Say goodbye to leeching...

Source: Internet
Author: User
Say goodbye to leeching... randomly generate a number (0-15) on the first page-save dechex () in the session

Then use this tag to calculate the URL. you can perform the operation as needed, but you must be able to reverse the operation ~

On the second page, check whether this mark exists. If yes, perform inverse operations and then retrieve the variables.

Advantages: (valid only when the website URL is accessed ~)

Disadvantages: (all links saved to the local page are invalid, and leeching fails)

---------------------------------------------

Ob_start ();
Session_start ();
If (isset ($ _ SESSION [key]) {// has a key

$ Key = $ _ SESSION [key]; // Obtain the key
$ Str = $ _ SERVER [QUERY_STRING]; // obtain encrypted data
$ Decryptstr = decrypt ($ str, $ key); // use the key to unlock the data (note: Here is your inverse algorithm)
................................ // (Decompose data into variables)
} Else {// keyless
$ Key = dechex (rand (); // generate the key
// If your last page does not allow leeching links
// Echo "your link is not from this site! Please visit this page after visiting the site ...";
// Exit ();
}
?>
HTML content ...... (here there are many links ...)

$ Htmlcontent = ob_get_contents (); // Obtain all HTML content
............................... // Replace all connection parameters href = url? Replaced data (a group of regular expressions)
Ob_end_flush (); // output HTML content (href = encrypted data)
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.