错误记录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 这个容易,属性相同了,按照提示查询一下找出来删了就行了,注意大小写很容易 ...
随机推荐
- vue-router Uncaught (in promise) NavigationDuplicated 错误
使用 vue-router 编程式实现页面跳转 this.$router.replace({ path: '/pub' }); 出现错误如下图 原因:vue-router 在 3.1 版本之后把 th ...
- Docker Harbor
简介: Harbor是一个用于存储Docker镜像的企业级Registry服务:本章将介绍如何搭建Harbor Registry! Github官方安装文档: https://github.com/g ...
- IDEA运行单个Java文件
对于某些Java示例可能是只有单个文件,并不是完整的Java工程,那么要如何运行单个Java文件呢,以IDEA为例. 我的环境: IDEA 2017.3.2 jdk 1.8.0.73 操作步骤: 1. ...
- easyui权限
实现权限目的: 是为了让不同的用户可以操作系统中不同资源 直接点说就是不同的用户可以看到不同的菜单 我们先来看下3张接下来用到的数据表 1.菜单表(t_easyui_menu) 2.用户菜单中间表(t ...
- 05webpack-webpack-dev-server时时跟新-第2种方式
<!--14 第一种方式 自动打开浏览器 端口号 指定托管的跟目录 启动热刷新 这种是在webpack.json中去配置的 直接在package中 写 将“script”:{ "dev ...
- 爬虫 crawlSpider 分布式 增量式 提高效率
crawlSpider 作用:为了方便提取页面整个链接url,不必使用创参寻找url,通过拉链提取器,将start_urls的全部符合规则的URL地址全部取出 使用:创建文件scrapy startp ...
- c# 第36节 接口的声明
本节内容: 1:字面理解接口 2:计算机的接口是什么呢 3:接口的声明 4:接口的注意点 1:字面理解接口 大家现在手机上,可能有很多app软件,比如天气预报的软件,有很多种,什么墨迹天气啊之类的等等 ...
- CodeForces 984C Finite or not?
http://codeforces.com/problemset/problem/984/C Time limit 1000 msMemory limit 262144 kB 题目 You ...
- Unity 插件宝典 (张忠喜 廖一庭 著)
第1章 模型类插件 第2章 特效类插件 第3章 动画插件 第4章 编辑器插件 第5章 脚本类插件 第6章 GUI插件 第7章 Shaders插件 第8章 优化类插件 第9章 综合应用----卡通版赛车 ...
- 消息队列的使用<二>:ActiveMQ的基本使用(Java)
目录 ActiveMQ 介绍 下载.安装和初次运行 Java上初次使用activeMQ 设置请求属性: 可靠性机制 事务 消息消费方式 receive 监听器: 消息类型 发布/订阅模式 非持久订阅 ...