search
HomeBackend DevelopmentPHP TutorialParse error: syntax error, unexpected 'include' (T_INCLUDE) in D:mywebadd.php解决方案

Parse error: syntax error, unexpected 'include' (T_INCLUDE) in D:\myweb\add.php
add.php的源代码:
//用户注册以后的数据处理文件.需要先检查数据合法性,然后写入数据库
//获取注册用户提交的数据
$UserName1=$_POST["UserName"];//用户名
$Password1=$_POST["Password"];//密码
$ConfirmPassword1=$_POST["ConfirmPassword"];//确认密码
$Email=$_POST["Email"];//邮箱
//定义保存激活码变量
$actnum=""
//导入数据库文件
include 'config.php';
//定义产生激活码函数
function Check_actnum()
{
$chars_for_actnum=array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0");
for($i=1;$i {
$actnum=$chars_for_actnum[mt_rand(0,count($chars_for_actnum)-1)];
}
return $actnum;
}
//判断用户名函数
function Check_UserName($UserName)//参数为用户注册的用户名
{
//用户名三个方面检查
//是否为空 字符串检测 长度检测
$Max_Strlen_UserName=16;//用户名最大长度
$Min_Strlen_UserName=4;//用户名最短长度
$UserNameChars="^[A-Za-z0-9_-]";//字符串检测的正则表达式
$UserNameGood="用户名检测正确";//定义返回的字符串变量
if($UserName=="")
{
$UserName="用户名不能为空";
return $UserNameGood;
}
if(!reg("$UserNameChars",$UserName))//正则表达式匹配检查
{
$UserNameGood="用户名字符串检测不正确";
return $UserNameGood;
}
if(strlen(UserName)$Max_Strlen_UserName)
{
$UserNameGood="用户名字长度检测不正确";
return $UserNameGood;
}
return $UserNameGood;
}
//判断密码是否合法函数
function Check_Password($Password)
{
//是否为空 字符串检测 长度检测
$Max_Strlen_Password=16;//密码最大长度
$Min_Strlen_Password=6;//密码最短长度
$PasswordChars="^[A-Za-z0-9_-]";//密码字符串检测正则表达式
$PasswordGood="密码检测正确";//定义返回的字符串变量
if($Password=="")
{
$PasswordGood="密码不能为空";
return $PasswordGood;
}
if(!ereg("$PasswordChars",$Password))
{
$PasswordGood="密码字符串检测不正确";
return $PasswordGood;
}
if(strlen($Password)$Max_Strlen_Password)
{
$PasswordGood="密码长度检测不正确";
return $PasswordGood;
}
return $PasswordGood;
}
//判断邮箱是否合法函数
function Check_Email($Email)
{
$EmailChars="^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*$";//正则表达式判断是否是合法邮箱地址
$EmailGood="邮箱检测正确";
if($Email=="")
{
$EmailGood="邮箱不能为空";
return $EmailGood;
}
return $EmailGood;
}
//判断两次密码输入是否一致
function Check_ConfirmPassword($Password,$ConfirmPassword)
{
$ConfirmPasswordGood="两次密码输入一致";
if($Password$ConfirmPassword)
{
$ConfirmPasswordGood="两次密码输入不一致";
return $ConfirmPasswordGood;
}
else
return $ConfirmPasswordGood;
}
//调用函数,检测用户输入数据
$UserNameGood=Check_UserName($UserName1);
$PasswordGood=Check_Password($Password1);
$EmailGood=Check_Email($Email);
$ConfirmPasswordGood=Check_ConfirmPassword($Password1,$ConfirmPassword1);
$error=false;//定义变量判断注册数据是否出现错误
if($UserNameGood!="用户名检测正确")

Statement
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
C语言return的用法详解C语言return的用法详解Oct 07, 2023 am 10:58 AM

C语言return的用法有:1、对于返回值类型为void的函数,可以使用return语句来提前结束函数的执行;2、对于返回值类型不为void的函数,return语句的作用是将函数的执行结果返回给调用者;3、提前结束函数的执行,在函数内部,我们可以使用return语句来提前结束函数的执行,即使函数并没有返回值。

Java中return和finally语句的执行顺序是怎样的?Java中return和finally语句的执行顺序是怎样的?Apr 25, 2023 pm 07:55 PM

源码:publicclassReturnFinallyDemo{publicstaticvoidmain(String[]args){System.out.println(case1());}publicstaticintcase1(){intx;try{x=1;returnx;}finally{x=3;}}}#输出上述代码的输出可以简单地得出结论:return在finally之前执行,我们来看下字节码层面上发生了什么事情。下面截取case1方法的部分字节码,并且对照源码,将每个指令的含义注释在

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code<form name="myform"

Vue3怎么使用setup语法糖拒绝写returnVue3怎么使用setup语法糖拒绝写returnMay 12, 2023 pm 06:34 PM

Vue3.2setup语法糖是在单文件组件(SFC)中使用组合式API的编译时语法糖解决Vue3.0中setup需要繁琐将声明的变量、函数以及import引入的内容通过return向外暴露,才能在使用的问题1.在使用中无需return声明的变量、函数以及import引入的内容,即可在使用语法糖//import引入的内容import{getToday}from&#39;./utils&#39;//变量constmsg=&#39;Hello!&#39;//函数func

详解JavaScript函数返回值和return语句详解JavaScript函数返回值和return语句Aug 04, 2022 am 09:46 AM

JavaScript 函数提供两个接口实现与外界的交互,其中参数作为入口,接收外界信息;返回值作为出口,把运算结果反馈给外界。下面本篇文章带大家了解一下JavaScript函数返回值,浅析下return语句的用法,希望对大家有所帮助!

使用JavaScript中return关键字使用JavaScript中return关键字Feb 18, 2024 pm 12:45 PM

JavaScript中return的用法,需要具体代码示例在JavaScript中,return语句用于指定从函数中返回的值。它不仅可以用于结束函数的执行,还可以将一个值返回给调用函数的地方。return语句有以下几个常见的用法:返回一个值return语句可以用来返回一个值给调用函数的地方。下面是一个简单的示例:functionadd(a,b){

Python返回值return怎么用Python返回值return怎么用Oct 07, 2023 am 11:10 AM

Python返回值return用法是当函数执行到return语句时,将立即停止执行,并将指定的值返回给调用函数的地方。详细用法:1、返回单个值;2、返回多个值;3、返回空值;4、提前结束函数的执行。

JavaScript中如何使用return语句JavaScript中如何使用return语句Feb 26, 2024 am 09:21 AM

JavaScript中return的使用方法,需要具体代码示例在JavaScript中,return是一个非常重要的关键字,它通常用于函数中返回值或结束函数的执行。return语句用于将值返回给函数的调用者,并终止函数的执行。return语句可以在函数的任何位置使用,并且可以返回任何JavaScript数据类型,包括数字、字符串、布尔值、

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),