错误记录PHP preg_match(): Compilation failed: range out of order in character class at offset 7 01_login.php</b> on line <b>13</b><br />
<?php
//响应头格式为json,编码为uft-8,注意有-
header("Content-Type:application/json;charset=utf-8");
// require_once("00_init.php");
//创建数据库的连接mysqli_connect如果写成mysql_connect()会出现access denied拒绝访问;
$conn=mysqli_connect("127.0.0.1","root","","xz",3306);
//设置编码为utf8,注意这里没有-因为MySQL对这个起名叫utf8,因为在做这个数据库时写错了,因此编码写成utf8
mysqli_query($conn,"SET NAMES UTF8");
//获取用户参数aname和apwd,@可以防止报错
@$aname=$_REQUEST["aname"];
@$apwd=$_REQUEST["apwd"];
$n_reg='/^[a-zo-9A-Z]{3,8}$/';
$n=preg_match($n_reg,$aname);
$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
<b>C:\xampp\htdocs\h5\admin\data\01_login.php</b> on line <b>13</b><br />
2 <br />
//报错原因是在13行的preg_match()函数中出现编译错误,错误内容是在第7个字符中出现了范围溢出,即正则表达式出错了,12行中的正则表达式中的0-9写成o-9;为啥不会是$aname错误而是正则呢?
//因为字符串的内容是随意的,它只是过来给正则进行匹配,符合返回true,不符合返回false。
错误记录PHP preg_match(): Compilation failed: range out of order in character class at offset 7 01_login.php</b> on line <b>13</b><br />的更多相关文章
- 开发错误记录3:问题 Error:failed to find Build Tools revision 23.0.2
今天导入swiperefreshlayoutdemo 问题 Error:failed to find Build Tools revision 23.0.2 修改build.gradle 里面设置,其 ...
- preg_match(): Compilation failed: character value in \x{} or \o{} is too large at offset 8
如果用正则筛选中文的时候,需要在规则后面添加字符u,表示使用utf8编码去解析 $reg = '/[\x{4e00}-\x{9fa5}]/u'; 例如: $reg = '/[\x{4e00}-\x{9 ...
- Error:java:Compilation failed: internal java compiler error
在IDEA中编译时出现这个错误:Error:java:Compilation failed: internal java compiler error! Information:Using javac ...
- Compilation failed: internal java compiler error
在Idea中编译时出现这个错误:Error:java: Compilation failed: internal java compiler error. Information:Using java ...
- PHP Warning: preg_match(): JIT compilation failed: no more memory in
PHP7.3出现如下错误:PHP Warning: preg_match(): JIT compilation failed: no more memory in ... 解决方案: 修改 /usr/ ...
- IntelliJ IDEA 运行错误:java: Compilation failed: internal java compiler error
错误:java: Compilation failed: internal java compiler error 解决的方法: 文件 --> 设置 : 若没有模块,点击右边的把自己项目的模块添 ...
- Compilation failed (return status=1): g++.exe: error: CreateProcess: No such file or directory错误
windows10上 theano安装之后出现的问题 >>> import theano You can find the C code in this temporary file ...
- Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 10 in
Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 10 ...
- android常犯错误记录
错误:Error:Error: Found item Attr/border_width more than one time 这个容易,属性相同了,按照提示查询一下找出来删了就行了,注意大小写很容易 ...
随机推荐
- RSA 登陆加密与解密
最近公司项目验收后,客户请来的信息安全技术人员对我们的网站进行了各种安全测试与排查问题,其中就有一个登陆时的加密问题.本来如果只是单纯的加密,可以直接在前台用MD5加密,将加密的值添加到数据库即可.但 ...
- 8. 多态——编译时类型&运行时类型
一.引用变量的两种类型 1. 编译时类型:由声明该变量时使用的类型决定 2. 运行时类型:由实际赋给该变量的对象决定 如果编译时类型和运行时类型不一致,就可能出现多态. class BaseClass ...
- 系统设计与分析:Alpha版本2成绩汇总
作业要求 1.作业内容 作业具体要求以及评分标准 2.评分细则 •给出开头和团队成员列表(10’) •给出发布地址以及安装手册(20’) •给出测试报告(40’) •给出项目情况总结(30’) * ...
- layUI学习第一日:myeclipse中使用layUI
第一步:下载layUI,网址:https://www.layui.com/ 第二步:查看layUI解压后的内容,和官网解释各个文件夹的内容 第三部:在myeclipse中新建一个web project ...
- 201871010110-李华《面向对象程序设计(java)》第十七周学习总结
博文正文开头格式:(2分) 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.co ...
- (day49)Django框架简介
目录 一.Web框架 (一)本质 (1)动静态网页 (2)wsgiref模块 (3)jinja2模块 (4)手动实现思路 (二)python主流框架 (1)Django (2)flask (3)tor ...
- PointNet++作者的视频讲解文字版
转载请注明本文链接: https://www.cnblogs.com/Libo-Master/p/9759130.html PointNet: Deep Learning on Point Sets ...
- Python ord & chr
ord & chr ord: 返回单个 Unicode 字符编码的整数 chr: 给一个 Unicode 编码,返回一个字符 (0 ~ 1,114,111) (ASCII 与 Unicode ...
- FFT_应用和例题
卷积 现有两个定义在 N 上的函数 \(f(n),g(n)\),定义 \(f\) 和 \(g\) 的卷积(convolution)为 \(f \otimes g\) \[ (f \otimes g)( ...
- P1验证性内容
#include<stdio.h> int main() { printf("201983270555"); return 0; } #include<stdio ...