Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Fatal error: Uncaught Error: Call to a member function bindParam() on string
- in C:xampphtdocssignregister.php:20 Stack trace: #0 {main} thrown in
- C:xampphtdocssignregister.php on line 20
- <?php
- include('connection.php');
- $form = $_POST;
- $username = $form['username'];
- $password = $form['password'];
- $repass = $form['repass'];
- $email = $form['email'];
- $date = $form['date'];
- $month = $form['month'];
- $year = $form['year'];
- if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
- echo "Invalid email please type a valid one";
- }
- else{
- if($username !='' && $password !='' && $repass!='' && $email !='' &&
- $date!='' && $month !='' && $year !='')
- {
- if($password == $repass)
- {
- $query = "SELECT * FROM users where email = :email AND username =
- :username";
- $query->bindParam(':username',$username);
- $query->bindParam(':email',$email);
- $count1 = $query->rowCount();
- if($count> 0)
- {
- echo "soryy the email you are trying to register is already
- registered!";
- }
- else{
- $insert = $connection->prepare("INSERT INTO users
- (username,password,email,date,month,year) values (:username, :password,
- :email, :date, :month, :year)");
- $insert->bindParam(':username',$username);
- $insert->bindParam(':password',$password);
- $insert->bindParam(':email',$email);
- $insert->bindParam(':date',$date);
- $insert->bindParam(':month',$month);
- $insert->bindParam(':year',$year);
- $out = $insert->execute();
- if(isset($out)){
- echo "thankyou you have sucessfully registered";
- }
- else{
- echo " sorry some error occured please try again!";
- }
- }
- }
- else{
- echo " passwords do not match";
- die();
- }
- }
- else{
- echo " you have not filled the registration form completely so please it";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement