Home > Database > Mysql Tutorial > javascript-PHP写入mysql时的问题

javascript-PHP写入mysql时的问题

WBOY
Release: 2016-06-06 09:41:17
Original
1179 people have browsed it

mysqljavascriptphp

<code> <?php $conn=mysql_connect("localhost","root","") or die("数据库服务器连接错误".mysql_error());           mysql_select_db("hanoi",$conn) or die("数据库访问错误".mysql_error());           mysql_query("set character set gb2312");           mysql_query("set names gb2312");$n = "<script>document.write(name);";$s = "<script>document.write(s);</script>";echo "$name  $score";mysql_query("insert into rank (name,socre) values ('$n','$s')",$conn);?></code>
Copy after login

现在需要从JavaScript提取两个变量 存在mysql里面
但是 存储之后的结果是这样的:
怎么正确导入我需要的数据呢
图片说明

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template