0
我在做一個調查我是脫機服務器,所以我保存用戶的cookie信息, 我有用戶這樣將我的cookie數據保存到MySQL數據庫?
FNAME信息:阿里,LNAME:Kheiri,職稱:主任,組織:Magiclamp,電子郵件:alikheiri @ gmail.com FNAME:阿里,LNAME:Kheiri,職稱:主任,ORG:Magiclamp,電子郵件:[email protected]
它保存在cookie中,但現在我在網上,所以我要救這個cookie數據在php中的mysql數據庫中,javascript爲此我編寫了這段代碼但是不起作用
mysql_connect("localhost","root","");//database connection05
mysql_select_db("o2measure");
if($_POST['submit']){
$date = date('Y,m,d');
$time = date("i:h:s",time() + $time_a);
echo $session_id;
$ip=$_SERVER['REMOTE_ADDR'];
foreach($_COOKIE as $name => $cookie){
// you can check any conditions based on cookie name $name
$sql="INSERT INTO user_data (first_name, last_name, job_title, organisation, email, phone_number, ip_address, date, time)
VALUES(" . mysql_escape_string($cookie) . ")";
$result=mysql_query($sql);
}