Commit 41ee2669 authored by rama chandra's avatar rama chandra

Delete signup.php

parent 0b6c963e
Pipeline #20573 failed with stages
in 14 seconds
<?php
include "init.php";
$obj = new base_class;
if(isset($_POST['signup'])){
$full_name = $obj->security($_POST['fullname']);
$email= $obj->security($_POST['email']);
$password = $obj->security($_POST['password']);
$img_name = $_FILES['img']['name'];
$img_tmp = $_FILES['img']['tmp_name'];
$img_path = "./assets/img";
$extensions = ['jpg','jpeg','png'];
$img_ext = explode(".",$img_name);
$img_extensions = end($img_ext);
$name_status = $email_status = $password_status = $photo_status = 1;
if(empty($full_name)){
$name_error = "Full Name is Required..!";
$name_status = "";
}
if(empty($email)){
$email_error = "Email is Required..!";
$email_status = "";
} else{
if(!filter_var($email,FILTER_VALIDATE_EMAIL)){
$email_error="Invalid Email Format";
$email_status = "";
} else{
if($obj->Normal_Query("SELECT email FROM users WHERE email = ?",array($email))){
if($obj->Count_Rows()==0){
}else{
$email_error="Emaild Already Exists";
$email_status = "";
}
}
}
}
if(empty($password)){
$password_error = "Password is Required";
$password_status = "";
}elseif(strlen($password)<5){
$password_error = "Password is Too Short";
$password_status = "";
}
if(empty($img_name)){
$image_error = "Image is Required";
$image_status = "";
}else if(!in_array($img_extensions,$extensions)){
$image_error = "Invalid Image";
$image_status = "";
}
if(!empty($name_status) && !empty($email_status) && !empty($password_status) && !empty($photo_status)){
move_uploaded_file($img_tmp, "$img_path/$img_name");
$status = 0;
$clear_status = 0;
if($obj->Normal_Query("INSERT INTO users (name,email,password,image,status,clear_status) VALUES (?,?,?,?,?,?)",[$full_name,$email,password_hash($password, PASSWORD_DEFAULT),$img_name,$status,$clear_status])){
$obj->Create_session("account_success","Your Account is created Successfully");
header("location:login.php");
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Crate An Account Today..!</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php include './components/css.php'; ?>
</head>
<body>
<div class = "signup-container">
<div class="account-left">
<div class="account-text">
<h2> Let's chat </h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
</div>
</div> <!-- Close of Account left -->
<div class="account-right">
<?php include './components/signup_form.php'; ?>
</div> <!-- Close of Account Right -->
</div> <!-- Close of SignUp - Container -->
<script src="./assets/js/file-label.js"></script>
<?php include './components/js.php'; ?>
</body>
</html>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment