0
我不明白爲什麼每列都有很好的結果,但屏幕列內有代碼,而不是實際的SCREEN SIZE(代碼結果)。PHP - Javascript結果在MySQL內
<?php
@$data = $_SERVER['HTTP_USER_AGENT']."|";
@$data.= $_SERVER['HTTP_CF_CONNECTING_IP']."|";
$width = " <script>document.write(screen.width); </script>";
$height = " <script>document.write(screen.height); </script>";
$data.=$width;
$data.=$height;
$finz = explode("|",$data);
$ag = $finz[0];
$ip = $finz[1];
$sc = $finz[2];
$query1 = $db->prepare("INSERT INTO `checks` (user,type,ip,screen,agent) values (:user,:type,:ip,:screen,:agent)");
$query1->execute(array(
'user' => $USER['username'],
'type' => 'Red Flower',
'ip' => $ip,
'screen' => $sc,
'agent' => $ag
));
$row2 = $query->fetch();
?>
有人可以告訴我如何讓代碼插入JavaScript輸出的值,而不使用POST AJAX/JQuery等?
非常感謝您,如果您可以請告訴我,我該怎麼做?我很樂意收到代碼。 – pythy