Here is my code which insert a single value of IP Address when user login. If the user tries to login from a different IP then user will get an email to confirm. After the user clicks on the link sent in the email, the IP address is updated. Instead of updating the IP adddress, I want to store all IPs when whenever the user confirms its identity so that if the user can be able to login same IP that we have stored in our array.
Basically I want to store IP address as an array.
<?php
include 'header.php';
include('config.php');
$eemail=$_GET['email'];
if(isset($_POST['scode']))
{
$unncode=$_POST['uncode'];
$sql1="SELECT * FROM nennetwork WHERE code ='$unncode'";
$res=mysql_query($sql1);
$rows = mysql_fetch_array($res);
$ccode = $rows['code'] ;
if($unncode==$ccode)
$eemail=$_GET['email'];
$ips = $_SERVER['REMOTE_ADDR'];
if(mysql_query("update nennetwork set useripp= '".$ips ."' WHERE email ='$eemail'"))
{
$mmmsg= "You can <a href='".'index.php'."' class='ac'>Login</a> if the code matches the code that we have sent you.";
}
else{
$mmmsg="Please submit the numeric code that we sent to your email.";
}}
?>