在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1 <?php 2 //响应头格式为json,编码为uft-8,注意有- 3 header("Content-Type:application/json;charset=utf-8"); 4 // require_once("00_init.php"); 5 //创建数据库的连接mysqli_connect如果写成mysql_connect()会出现access denied拒绝访问; 6 $conn=mysqli_connect("127.0.0.1","root","","xz",3306); 7 //设置编码为utf8,注意这里没有-因为MySQL对这个起名叫utf8,因为在做这个数据库时写错了,因此编码写成utf8 8 mysqli_query($conn,"SET NAMES UTF8"); 9 //获取用户参数aname和apwd,@可以防止报错 10 @$aname=$_REQUEST["aname"]; 11 @$apwd=$_REQUEST["apwd"]; 12 $n_reg='/^[a-zo-9A-Z]{3,8}$/'; 13 $n=preg_match($n_reg,$aname); 14 $p=preg_match($n_reg,$apwd); 报错信息 1 <b>Warning</b>: preg_match(): Compilation failed: range out of order in character class at offset 7 in
|
2022-08-17
2022-11-06
2022-08-17
2022-07-29
2022-07-18
请发表评论