Parseerror: syntaxerror, unexpected 'include' (T_INCLUDE) inD: \ myweb \ add. php solution

Source: Internet
Author: User
Tags import database
Parseerror: syntaxerror, unexpected 'include '(T_INCLUDE) inD: \ myweb \ add. phpadd. php source code: & lt ;? Php // data processing file after user registration. check the data validity first, and then write the data into the database // obtain the data submitted by the registered user $ Us Parse error: syntax error, unexpected 'include '(T_INCLUDE) in D: \ myweb \ add. php
Source code of add. php:
// Data processing file registered by the user. check the validity of the data before writing it to the database.
// Obtain the data submitted by the registered user
$ UserName1 = $ _ POST ["UserName"]; // User name
$ Password1 = $ _ POST ["Password"]; // Password
$ ConfirmPassword1 =d1 _ POST ["ConfirmPassword"]; // confirm the password
$ Email = $ _ POST ["Email"]; // Email
// Define the variable for saving the activation code
$ Actnum = ""
// Import database files
Include 'config. php ';
// Define the function for generating the activation code
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 <= 20; $ I ++) // generates a 20-character activation code
{
$ Actnum = $ chars_for_actnum [mt_rand (0, count ($ chars_for_actnum)-1)];
}
Return $ actnum;
}
// User name judgment function
Function Check_UserName ($ UserName) // The parameter is the user name registered by the user.
{
// User name check
// Check whether the string is null
$ Max_Strlen_UserName = 16; // maximum length of the user name
$ Min_Strlen_UserName = 4; // minimum username length
$ UserNameChars = "^ [A-Za-z0-9 _-]"; // regular expression for string detection
$ UserNameGood = "username check is correct"; // defines the returned string variable
If ($ UserName = "")
{
$ UserName = "the user name cannot be blank ";
Return $ UserNameGood;
}
If (! Reg ("$ UserNameChars", $ UserName) // regular expression matching check
{
$ UserNameGood = "incorrect username string detection ";
Return $ UserNameGood;
}
If (strlen (UserName) <$ Min_Strlen_UserName | strlen (UserName)> $ Max_Strlen_UserName)
{
$ UserNameGood = "invalid username length check ";
Return $ UserNameGood;
}
Return $ UserNameGood;
}
// Determine whether the password is a valid function
Function Check_Password ($ Password)
{
// Check whether the string is null
$ Max_Strlen_Password = 16; // maximum password length
$ Min_Strlen_Password = 6; // minimum password length
$ PasswordChars = "^ [A-Za-z0-9 _-]"; // regular expression for password string detection
$ PasswordGood = "correct password check"; // defines the returned string variable
If ($ Password = "")
{
$ PasswordGood = "The password cannot be blank ";
Return $ PasswordGood;
}
If (! Ereg ("$ PasswordChars", $ Password ))
{
$ PasswordGood = "incorrect password string detection ";
Return $ PasswordGood;
}
If (strlen ($ Password) <$ Min_Strlen_Password) | strlen ($ Password)> $ Max_Strlen_Password)
{
$ PasswordGood = "incorrect password length check ";
Return $ PasswordGood;
}
Return $ PasswordGood;
}
// Function used to determine whether the email address is valid
Function Check_Email ($ Email)
{
$ EmailChars = "^ [_ a-z0-9-] + (. [_ a-z0-9-] +) * @ [a-z0-9-] + (. [a-z0-9-] +) * $ "; // regular expression to determine whether the email address is valid
$ EmailGood = "email detection is correct ";
If ($ Email = "")
{
$ EmailGood = "email cannot be blank ";
Return $ EmailGood;
}
Return $ EmailGood;
}
// Determine whether the two passwords are consistent
Function Check_ConfirmPassword ($ Password, $ ConfirmPassword)
{
$ ConfirmPasswordGood = "The two passwords are the same ";
If ($ Password <> $ ConfirmPassword)
{
$ ConfirmPasswordGood = "The two passwords are inconsistent ";
Return $ ConfirmPasswordGood;
}
Else
Return $ ConfirmPasswordGood;
}
// Call a function to check user input data
$ UserNameGood = Check_UserName ($ UserName1 );
$ PasswordGood = Check_Password ($ Password1 );
$ EmailGood = Check_Email ($ Email );
$ ConfirmPasswordGood = Check_ConfirmPassword ($ Password1, $ ConfirmPassword1 );
$ Error = false; // define a variable to determine whether an error occurs in the registration data.
If ($ UserNameGood! = "Username check is correct ")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.