Jump to content

Parse error: syntax error, unexpected '^' in C:\xampp\htdocs\includes\signup.inc.php on line 12


atb1986

Recommended Posts

Hi im coding a php form using a tutorial im completely new at php need help what am i doing wrong
else if((!filter_var($email,FILTER_VALIDATE_EMAIL)&& (!preg_match("/^[a-zA-Z0-9]*$/"",$username)){
header("Location:..//signup.php?error=invalidmail&uid=");
exit();

Link to comment
Share on other sites

<?php
if (isset($_POST['signup-submit'])){
require'dbh.inc.php';
$username=$_POST['uid'];
$email=$_POST['mail'];
$password=$_POST['pwd'];
$passwordRepeat=$_POST['pwd-repeat'];
if(empty($username)||empty($email)||empty($password)||empty($passwordRepeat))
header("Location:..//signup.php?error=emptyfields&uid=".$username."$mail=.$email);
exit();
}
else if((!filter_var($email,FILTER_VALIDATE_EMAIL)&& (!preg_match("/^[a-zA-Z0-9]*$/"",$username)){
header("Location:..//signup.php?error=invalidmail&uid=");
exit();
}
else if(!filter_var($email,FILTER_VALIDATE_EMAIL)){
header("Location:..//signup.php?error=invalidmail&uid=".$username);
exit();
}
else if(!preg_match("/^[a-zA-Z0-9]*$/",$username)){
header("Location:..//signup.php?error=invalid&mail=".$email);
exit();
}
else if($password !== $passwordRepeat){
header("Location:..//signup.php?error=passwordcheckuid=".$username.$mail=".$email);
exit();
}
else{
$sql="SELECT uidUsers FROM users WHERE uidUsers=?";
$stmt=mysqli_stmt_init($conn);

if(!mysqli_stmt_prepare($stmt,$sql)){
header("Location:..//signup.php?error=sqlerror");
exit();
}
else{
myqli_stmt_bind_param($stmt, "s",$username);
mysqli_stmt_execute($stmt);
mysqli_stmt_store_result($stmt)
$resultCheck=mysqli_stmt_num_rows($stmt);
If($resultcheck>0){
header("Location:..//signup.php?error=usertaken&mail=.$email");
}
else{
$sql="INSERT INTO users (uidUsers,emailUsers,pwdUsers) VALUES(?,?,?)";
$stmt=mysqli_stmt_init($conn);
if(!mysqli_stmt_prepare($stmt,$sql)){
header("Location../signup.php?
}
e;se{
$hashedPwd=password_hash($password, PASSWORD_DEFAULT);
myqli_stmt_bind_param($stmt, "sss",$username,$email,$hashedPwd);
mysqli_stmt_execute($stmt);
header("Location:..//signup.php?signup=success");
exit();
}
}
}
}
mysqli_stmt_close($stmt);
mysqli_close($conn);
}
else{
header("Location:..//signup.php");
exit();
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.