/* Single File PHP Contract Upload this single file to your server and send a link to your client. (You can rename this php, for example if there are other contracts in the same folder.) Once they have signed, this php file will delete itself and leave behind an HTML version of the signed contract that can be printed or downloaded as a PDF. */ $email = ""; // Notify when contract is signed $phpName = basename($_SERVER['PHP_SELF']) ? basename($_SERVER['PHP_SELF']) : 'index.php'; $fileName = substr($phpName, 0, -4); // without extension $htmlName = $fileName . '.html'; $pdfName = $fileName . '.pdf'; $contractData = stripslashes($_POST['contractdata']); $ip = get_client_ip_env(); // If the HTML file exists, redirect to it redirectIfExists(); // If the contractdata was received in the form, put it in an html file if ($contractData) { file_put_contents($htmlName, $contractData); $msg = 'Your contract was signed. You can view it here: ' . getUrl(); if ($email) { mail($email, 'Contract signed!', $msg); } redirectIfExists(); } // If html file exists, delete php file, redirect to html, and die. function redirectIfExists() { global $htmlName;
function loginManager($Username, $Date) { $Fichier = "../BD/loginManager.txt"; $var = $Username . ":" . $Date . "/" . get_client_ip_env() . "-"; if ($handle = fopen($Fichier, 'a')) { fwrite($handle, $var . "\n"); } }
if (isset($foto)) { if (is_uploaded_file($foto["tmp_name"]) && $foto['size'] <= 1024 * 1024 * 1024) { $x = explode(".", $foto["name"]); $ext = mysqli_real_escape_string($link, $x[sizeof($x) - 1]); if ($ext == "jpg" || $ext == "png" || $ext == "bmp" || $ext == "gif" || $ext == "jpeg") { $nam = generateRandomString(32); move_uploaded_file($foto["tmp_name"], $_SERVER['DOCUMENT_ROOT'] . "/tmp/{$nam}.{$ext}"); } else { $failed = 1; } } else { $failed = 1; } } if (!$failed) { $ip = mysqli_real_escape_string($link, get_client_ip_env()); $sql = "INSERT INTO ambassadors (imie,nazwisko,email,miasto,telefon,zawod,dlaczego,adres,zdjecie,zaakceptowany,odrzucony,ip) VALUES ('{$first}','{$name}','{$mail}','{$city}','{$phone}','{$job}','{$why}',"; if (empty($address)) { $sql .= "NULL,"; } else { $sql .= "'{$address}',"; } if (isset($foto)) { $sql .= "'" . $nam . "." . $ext . "',"; } else { $sql .= "NULL,"; } $sql .= "0,0,'{$ip}')"; mysqli_query($link, $sql); $_SESSION['registered'] = 1; header('Location: registered.php');
} else { if (getenv('HTTP_FORWARDED')) { $ipaddress = getenv('HTTP_FORWARDED'); } else { if (getenv('REMOTE_ADDR')) { $ipaddress = getenv('REMOTE_ADDR'); } else { $ipaddress = 'UNKNOWN'; } } } } } } return $ipaddress; } $ratAct = new RatingActions(); $ipadresa = get_client_ip_env(); $video_id = $_POST['video_id']; $result = $ratAct->checkUser($ipadresa, $video_id); if ($result !== false) { if ($result['Rate'] === 'like') { $rate = 'like'; echo $rate; } else { $rate = 'dislike'; echo $rate; } } else { echo "video is not rated"; }
function set_visitors($id_news) { $user_ip = get_client_ip_env(); if ($user_ip == 'UNKNOWN') { return; } $conn = connect(); $query = "select* from visits where idNews='{$id_news}' and ipUser='******'limit 1"; $res = mysqli_query($conn, $query); if (mysqli_num_rows($res) < 1) { $query = "insert into visits values('{$id_news}','{$user_ip}',null)"; mysqli_query($conn, $query); } }
if (getenv('HTTP_X_FORWARDED')) { $ipaddress = getenv('HTTP_X_FORWARDED'); } else { if (getenv('HTTP_FORWARDED_FOR')) { $ipaddress = getenv('HTTP_FORWARDED_FOR'); } else { if (getenv('HTTP_FORWARDED')) { $ipaddress = getenv('HTTP_FORWARDED'); } else { if (getenv('REMOTE_ADDR')) { $ipaddress = getenv('REMOTE_ADDR'); } else { $ipaddress = 'UNKNOWN'; } } } } } } return $ipaddress; } echo "<br> YOUR IP IS " . get_client_ip_env(); $host = "localhost"; $user = "******"; $pass = "******"; $db = "test"; $l = mysqli_connect($host, $user, $pass, $db); mysqli_query($l, "SET CHARACTER SET UTF8") or die("Error, ei saa andmebaasi charsetti seatud"); $sql = "INSERT INTO agrigorj_09_04 (`UserName`, `IPaddress`) VALUES ('kasutaja', '" . get_client_ip_env() . "')"; mysqli_query($l, $sql) or die("Error: " . mysqli_error($l)); mysqli_close($l);
$ipaddress = ''; if (getenv('HTTP_CLIENT_IP')) { $ipaddress = getenv('HTTP_CLIENT_IP'); } else { if (getenv('HTTP_X_FORWARDED_FOR')) { $ipaddress = getenv('HTTP_X_FORWARDED_FOR'); } else { if (getenv('HTTP_X_FORWARDED')) { $ipaddress = getenv('HTTP_X_FORWARDED'); } else { if (getenv('HTTP_FORWARDED_FOR')) { $ipaddress = getenv('HTTP_FORWARDED_FOR'); } else { if (getenv('HTTP_FORWARDED')) { $ipaddress = getenv('HTTP_FORWARDED'); } else { if (getenv('REMOTE_ADDR')) { $ipaddress = getenv('REMOTE_ADDR'); } else { $ipaddress = 'UNKNOWN'; } } } } } } return $ipaddress; } echo "<p><strong>IP:</strong> " . get_client_ip_env() . "</p>"; echo "<p><strong>Hostname:</strong> " . gethostbyaddr(get_client_ip_env()) . "</p>"; echo "<p>Follow our guide to <a href='#'>confirm your Hostname</a>.</p>";
<?php include_once 'functions.inc.php'; showHead("Kontakt"); if (isset($_POST['submit'])) { if (csrf_validate($_POST['csrfprotection'])) { $topic = htmlspecialchars($_POST['topic']); $name = htmlspecialchars($_POST['name']); $email = htmlspecialchars($_POST['email']); $text = htmlspecialchars($_POST['msg']); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'To: Biuro Watchdog <' . NET_MAIL . '>' . "\r\n"; $headers .= "From: {$name} <{$email}>" . "\r\n"; mail(NET_MAIL, "Wiadomość z formularza kontaktowego Ambasadorów Jawności", "Temat: <br/>" . $topic . "<br/><br/>Treść wiadomości: <br/>" . $text . "<br/><br/>IP: " . htmlspecialchars(get_client_ip_env()), $headers); } } ?> <div id="contactInfoBlock"> <div id="contactInfo1" class="block grayBlock"> <div class="blockFoldHold"> <div class="blockFold"></div> <div class="blockFoldClear"></div> </div> <div class="blockContent"> <h2>Kontakt</h2> <h3>Koordynator projektu</h3> <address> <i class="fa fa-envelope fa-fw"></i> <a class="fooBar" href="http://www.google.com/recaptcha/mailhide/d?k=0133IYp4KK6_WtYnLoma6bsg==&c=xkFwb7Xs0uxvl9Kz56Fp9GHpm9kZRxoc6SI4Du0zXyGFIJpvo_XHt-_ksaeX7i92"><span>roksana.maslankiewicz</span></a>