<?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 />的更多相关文章

  1. 开发错误记录3:问题 Error:failed to find Build Tools revision 23.0.2

    今天导入swiperefreshlayoutdemo 问题 Error:failed to find Build Tools revision 23.0.2 修改build.gradle 里面设置,其 ...

  2. 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 ...

  3. Error:java:Compilation failed: internal java compiler error

    在IDEA中编译时出现这个错误:Error:java:Compilation failed: internal java compiler error! Information:Using javac ...

  4. Compilation failed: internal java compiler error

    在Idea中编译时出现这个错误:Error:java: Compilation failed: internal java compiler error. Information:Using java ...

  5. 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/ ...

  6. IntelliJ IDEA 运行错误:java: Compilation failed: internal java compiler error

    错误:java: Compilation failed: internal java compiler error 解决的方法: 文件 --> 设置 : 若没有模块,点击右边的把自己项目的模块添 ...

  7. 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 ...

  8. 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 ...

  9. android常犯错误记录

    错误:Error:Error: Found item Attr/border_width more than one time 这个容易,属性相同了,按照提示查询一下找出来删了就行了,注意大小写很容易 ...

随机推荐

  1. [Go] gocron源码阅读-go语言中的切片和类型综合

    在gocron.go文件的main函数中,有下面这一句,从这句代码中可以学习到切片和类型的综合运用 cliApp.Flags = append(cliApp.Flags, []cli.Flag{}.. ...

  2. [视频教程] 使用composer安装使用thinkphp6.0框架

    安装composer -vvv的参数是表示展示安装进度,测试时使用其他参数安装失败,一直卡着不动curl -vvv https://getcomposer.org/installer | phpmv ...

  3. Linux 查看端口机服务

    Linux如何查看端口 1.lsof -i:端口号 用于查看某一端口的占用情况,比如查看8000端口使用情况,lsof -i:8000 2.2.netstat -tunlp |grep 端口号,用于查 ...

  4. linux下查看程序占用多少内存

    执行 ps auxVSZ(或VSS)列 表示,程序占用了多少虚拟内存:RSS列 表示, 程序占用了多少物理内存:虚拟内存可以不用考虑,它并不占用实际物理内存. 或执行top 命令 VIRT(或VSS) ...

  5. JS的节流、防抖及使用场景

    前言 据说阿里有一道面试题就是谈谈函数节流和函数防抖. 糟了,这可触碰到我的知识盲区了,好像听也没听过这2个东西,痛定思痛,赶紧学习学习.here we go! 概念和例子 函数防抖(debounce ...

  6. Jenkins之插件Publish HTML reports的使用

    前提: 下载插件HTML Publisher plugin 一.安装 安装好HTML Publisher plugin之后,会在新建或者编辑项目时,在[增加构建后操作步骤]出现[Publish HTM ...

  7. html学习之二(常用标签练习)

    <!DOCTYPE html><head> <meta charset="utf-8"> <title>锚点链接</title ...

  8. 42 在Raspberry Pi上安装dlib表情识别

    https://www.jianshu.com/p/848014d8dea9 https://www.pyimagesearch.com/2017/05/01/install-dlib-raspber ...

  9. Linux学习笔记-第17天 有点赶

    第十章开始进度感觉有些快,该加把劲儿了

  10. java - mybatis:java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for

    当遇见java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for 错误的时候 ...