| 1 | <?PHP |
| 2 | session_start(); |
| 3 | // this will overlay our current system |
| 4 | function presign(){ |
| 5 | global $petition; |
| 6 | $id = session_id(); |
| 7 | $page = $petition->real_escape_string($_SERVER['REQUEST_URI']); |
| 8 | $email = $petition->real_escape_string($_COOKIE['email']); |
| 9 | $name = $petition->real_escape_string($_COOKIE['pNAME']); |
| 10 | $phone = $petition->real_escape_string($_COOKIE['pPHONE']); |
| 11 | if (!empty($_SERVER['HTTP_CLIENT_IP'])) { |
| 12 | $ip = $_SERVER['HTTP_CLIENT_IP']; |
| 13 | } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
| 14 | $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
| 15 | } else { |
| 16 | $ip = $_SERVER['REMOTE_ADDR']; |
| 17 | } |
| 18 | $petition_name = $petition->real_escape_string($_COOKIE['pID']); |
| 19 | $invite = $petition->real_escape_string($_COOKIE['invite']); |
| 20 | $invite_error = $petition->real_escape_string($_COOKIE['invite_error']); |
| 21 | $ip = $petition->real_escape_string($ip); |
| 22 | $browser_string = $petition->real_escape_string($_SERVER['HTTP_USER_AGENT']); |
| 23 | $now = $petition->real_escape_string(date('r')); |
| 24 | $only_date = $petition->real_escape_string(date('Y-m-d')); |
| 25 | $petition->query("insert into presign (only_date,invite_error,invite,petition,php_session_id,php_page,name,email_for_follow_up,phone_for_validation,ip_address,browser_string,action_on) |
| 26 | values ('$only_date','$invite_error','$invite','$petition_name','$id','$page','$name','$email','$phone','$ip','$browser_string','$now') "); |
| 27 | } |
| 28 | ?> |