I'm having a problem writting an IP to the database.
If I print $ip after $ip=$_SERVER['REMOTE_ADDR'];
, I obtain 54.231.128.128. But if I insert ip to database, it inserts 203223. Here is my code.
<?php include "db.php";
session_start();
$toemail=$_POST["toemail"];
$report=$_POST["report"];
$ip=$_SERVER['REMOTE_ADDR'];
$fromemail=$_SESSION['nahid'];
$date=(time());
$tatus="Active";
if(!$_POST['submit']) {
echo "Please fill out the form";
} else {
// $query_auto = "INSERT INTO form (date, time) VALUE ('DATE: Auto CURDATE()', CURDATE() )";
mysql_query("INSERT INTO report(`id`, `from`, `msg`, `to`, `date`, `ip`, `status`)
VALUES(NULL,'$fromemail','$report','$toemail','$date', '$ip', '$tatus')") or die(mysql_error());
header('Location: report_congratulations.php');
}
?>