SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
please help my
<!DOCTYPE html>
<html dir="rtl">
<head>
<title>sign up projectx</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="images/icons/favicon.ico"/>
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<!--===============================================================================================-->
</head>
<?php require('includes/config.php');
//if logged in redirect to members page
if( $user->is_logged_in() ){ header('Location: memberpage.php'); exit(); }
//if form has been submitted process it
if(isset($_POST['regg'])){
if (!isset($_POST['usernamee'])) $error[] = "Please fill out all fields";
if (!isset($_POST['emaill'])) $error[] = "Please fill out all fields";
if (!isset($_POST['passs'])) $error[] = "Please fill out all fields";
if (!isset($_POST['passConf'])) $error[] = "Please fill out all fields";
if (!isset($_POST['namee'])) $error[] = "Please fill out all fields";
if (!isset($_POST['phonee'])) $error[] = "Please fill out all fields";
$username = $_POST['usernamee'];
$namee = $_POST['namee'];
$phonee = $_POST['phonee'];
//very basic validation
if(!$user->isValidUsername($username)){
$error[] = 'لابد ان يحتوي اسم المستخدم على الاقل 3 حروف';
} else {
$stmt = $db->prepare('SELECT username FROM members WHERE username = :username');
$stmt->execute(array(':username' => $username));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if(!empty($row['username'])){
$error[] = 'اسم المستخدم موجود مسبقاً';
}
}
if(strlen($_POST['passs']) < 3){
$error[] = 'كلمة السر قصير جدا';
}
if(strlen($_POST['passConf']) < 3){
$error[] = 'تاكيد كلمة السر قصير جدا.';
}
if($_POST['passs'] != $_POST['passConf']){
$error[] = 'كلمة السر غير متطابقة ';
}
//email validation
$email = htmlspecialchars_decode($_POST['emaill'], ENT_QUOTES);
if(!filter_var($email, FILTER_VALIDATE_EMAIL)){
$error[] = 'يجب إدخال بريد الكتروني صحيح';
} else {
$stmt = $db->prepare('SELECT email FROM members WHERE email = :email');
$stmt->execute(array(':email' => $email));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if(!empty($row['email'])){
$error[] = 'البريد الالكتروني مستخدم مسبقاً';
}
}
//if no errors have been created carry on
if(!isset($error)){
//hash the password
$hashedpassword = $user->password_hash($_POST['passs'], PASSWORD_BCRYPT);
//create the activasion code
$activasion = md5(uniqid(rand(),true));
try {
//insert into database with a prepared statement
$stmt = $db->prepare('INSERT INTO members (username,password,email,active,m_name,m_phone) VALUES (:username, :password, :email, :active,:namee ,:phonee)');
$stmt->execute(array(
':username' => $username,
':password' => $hashedpassword,
':email' => $email,
':active' => $activasion,
));
$id = $db->lastInsertId('memberID');
//send email
$to = $_POST['emaill'];
$subject = "تأكيد إنشاء حساب في موقع بروجكت اكس ";
$body = "<p>Tشكرا لك لانشاء حسابك في بروجكت اكس/p>
<p>To act منفضلك قم بالظغط على الرابط الموجود بالاسفل : click on this link: <a href='".DIR."activate.php?x=$id&y=$activasion'>".DIR."activate.php?x=$id&y=$activasion</a></p>
<p>Dev Mohd/p>";
$mail = new Mail();
$mail->setFrom(SITEEMAIL);
$mail->addAddress($to);
$mail->subject($subject);
$mail->body($body);
$mail->send();
//redirect to index page
header('Location:signi_up.php?action=joined');
exit;
//else catch the exception and show the error.
} catch(PDOException $e) {
$error[] = $e->getMessage();
}
}
}
?>
<body>
<div class="limiter">
<div class="container-login100" style="background-image: url('images/bg-01.jpg');">
<div class="wrap-login100 p-l-110 p-r-110 p-t-62 p-b-33">
<form class="login100-form validate-form flex-sb flex-w" role="form" method="post" action="" autocomplete="off">
<span class="login100-form-title p-b-53">
إنشاء حساب جديد
</span>
<?php
//check for any errors
if(isset($error)){
foreach($error as $error){
echo '<p class="bg-danger">'.$error.'</p>';
}
}
//if action is joined show sucess
if(isset($_GET['action']) && $_GET['action'] == 'joined'){
echo "<h2 class='bg-success'>Registration successful, please check your email to activate your account.</h2>";
}
?>
<div class="p-t-31 p-b-9">
<span class="txt1">
الأسم
</span>
</div>
<div class="wrap-input100 validate-input" data-validate = "الأسم مطلوب">
<input class="input100" type="text" name="namee" tabindex="1">
<span class="focus-input100"></span>
</div>
<div class="p-t-31 p-b-9">
<span class="txt1">
أسم المستخدم
</span>
</div>
<div class="wrap-input100 validate-input" data-validate = "أسم المستخدم مطلوب">
<input class="input100" type="text" name="usernamee"tabindex="2" value="<?php if(isset($error)){ echo htmlspecialchars($_POST['usernamee'], ENT_QUOTES); } ?>">
<span class="focus-input100"></span>
</div>
<div class="p-t-31 p-b-9">
<span class="txt1">
البريد الألكتروني
</span>
</div>
<div class="wrap-input100 validate-input" data-validate = "البريد الالكتروني مطلوب">
<input class="input100" type="email" name="emaill" tabindex="3" value="<?php if(isset($error)){ echo htmlspecialchars($_POST['emaill'], ENT_QUOTES); } ?>">
<span class="focus-input100"></span>
</div><div class="p-t-31 p-b-9">
<span class="txt1">
رقم الجوال
</span>
</div>
<div class="wrap-input100 validate-input" data-validate = "رقم الجوال مطلوب">
<input class="input100" type="tel" name="phonee" maxlength="10" tabindex="4">
<span class="focus-input100"></span>
</div>
<div class="p-t-13 p-b-9">
<span class="txt1">
كلمة المرور
</span>
</div>
<div class="wrap-input100 validate-input" data-validate = "كلمة المرور مطلوبة ">
<input class="input100" type="password" name="passs" tabindex="5">
<span class="focus-input100"></span>
</div>
<div class="p-t-13 p-b-9">
<span class="txt1">
تاكيد كلمة المرور
</span>
</div>
<div class="wrap-input100 validate-input" data-validate = "كلمة المرور مطلوبة ">
<input class="input100" type="password" name="passConf" tabindex="6">
<span class="focus-input100"></span>
</div>
<div class="container-login100-form-btn m-t-17">
<button class="login100-form-btn" name="regg" tabindex="7">
إنشاء حساب
</button>
</div>
<div class="w-full text-center p-t-55">
<span class="txt2">
أنا عضواً بموقعكم !!
</span>
<a href="signi_in.php" class="txt2 bo1">
أدخل الان
</a>
</div>
</form>
</div>
</div>
</div>
<div id="dropDownSelect1"></div>
<!--===============================================================================================-->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/animsition/js/animsition.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/daterangepicker/moment.min.js"></script>
<script src="vendor/daterangepicker/daterangepicker.js"></script>
<!--===============================================================================================-->
<script src="vendor/countdowntime/countdowntime.js"></script>
<!--===============================================================================================-->
<script src="js/main.js"></script>
</body>
</html>
CREATE TABLE `members` (
`memberID` int(11) NOT NULL,
`username` varchar(255) COLLATE utf8mb4_bin NOT NULL,
`password` varchar(255) COLLATE utf8mb4_bin NOT NULL,
`email` varchar(255) COLLATE utf8mb4_bin NOT NULL,
`active` varchar(255) COLLATE utf8mb4_bin NOT NULL,
`resetToken` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`resetComplete` varchar(3) COLLATE utf8mb4_bin DEFAULT 'No',
`m_name` varchar(64) COLLATE utf8mb4_bin NOT NULL,
`m_phone` int(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;