Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html><body><?php
- header('Content-Type: text/html; charset=utf-8');
- ini_set('display_errors', 1);
- ini_set('log_errors',1);
- ini_set('display_startup_errors', 1);
- ini_set('error_reporting', E_ALL);
- error_reporting(E_ALL);
- mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
- function start_session() {
- if(version_compare(phpversion(), "5.4.0") != -1){
- if (session_status() == PHP_SESSION_NONE) {
- session_start();
- }
- } else {
- if(session_id() == '') {
- session_start();
- }
- }
- }
- start_session();
- if (!isset($_SESSION['js']) && !isset($_REQUEST['sessionstart']) && !isset($_REQUEST['setjsoff']) && !isset($_SESSION['jsoff'])) {
- echo '<script src="./js/jquery.js"></script><script type="text/javascript">$(document).ready(function(){$.get(document.URL.substring() + "?sessionstart=1");});</script>';
- }
- if (isset($_REQUEST['sessionstart'])) {
- $_SESSION['js'] = 1;
- exit("in sessionstart mode");
- } else {
- if (isset($_REQUEST['setjsoff'])) {
- $_SESSION['jsoff'] = 1;
- if ($_SESSION['jsoff'] == 1) {
- exit("in setjsoff mode (success)");
- } else {
- exit("jsoff unsuccessful");
- }
- } else {
- session_destroy();
- }
- }
- if (!isset($_SESSION['js'])) {
- if (!isset($_SESSION['jsoff'])) {
- if (!isset($_REQUEST['sessionstart'])) {
- $ch = curl_init();
- $username = "***";
- $password = "***";
- curl_setopt($ch, CURLOPT_URL, "***/test.php?setjsoff=1");
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_FORBID_REUSE, true);
- curl_setopt($ch, CURLOPT_HTTPGET, true);
- curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
- $chout = curl_exec($ch);
- curl_close($ch);
- echo "curl init - ".$chout." - ";
- }
- header("Refresh: 1");
- exit("301 Redirect");
- }
- echo "Javascript is not enabled";
- } else {
- echo "Javascript is enabled";
- }
- ?></body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement