1) Make an ip variable.
$ip=$_SERVER[‘REMOTE_ADDR’];
echo “IP Address= $ip“;
2) Check to see the variable upon clicking submit
if (isset($_POST[‘submit’]){
echo $_POST[‘ip’];
}
3) Make a hidden post variable to post the ip
<input type=”hidden” name=”ip” value=”<? echo $ip;?>/>
4) Insert the $_POST[‘ip’] into the database when the form is submitted.
“INSERT INTO tablename id, ip VALUES (NULL, ‘$_POST[‘ip’])”;
© 2018 ALL Rights Reserved | Sitemap
Vancouver | North Vancouver | Burnaby | Richmond | Coquitlam | Port Coquitlam | Surrey | Langley | Maple Ridge | Mission | Abbotsford | Kamloops | Kelowna | Victoria | Squamish | Whistler | Pemberton