Witam prosze o pomoc.
Jak napisac skrypt by podczas logowania zapisywał adres ip i datę do odpowiednich komórek.
<?php require_once('Connections/ko.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $query_Recordset1 = "SELECT ip_add FROM users"; ?> <?php // *** Validate request to login to this site. } $loginFormAction = $_SERVER['PHP_SELF']; $_SESSION['PrevUrl'] = $_GET['accesscheck']; } $loginUsername=$_POST['myusername']; $password=$_POST['mypassword']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "lista.php"; $MM_redirectLoginFailed = "login_failed.php"; $MM_redirecttoReferrer = true; $LoginRS__query=sprintf("SELECT user_login, user_password FROM users WHERE user_login=%s AND user_password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } } else { } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Login </strong></td> </tr> <tr> <td width="78">Username</td> <td width="6"> </td> <td width="294"><input name="myusername" type="text" id="myusername" /></td> </tr> <tr> <td>Password</td> <td> </td> <td><input name="mypassword" type="password" id="mypassword" /></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td><p> <input type="submit" name="Submit" value="Login" /td> </p> <p> </p></td> </tr> </table> </form> </body> </html> <?php ?>