-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
35 lines (31 loc) · 929 Bytes
/
signup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
error_reporting(0);
require_once("db_connect.php");
$conn=$GLOBALS["conn"];
//Body of POST req start
$mob_no=$_POST["mobile_no"];
$password=$_POST["password"];
$user_name=$_POST["user_name"];
$hash=md5($password);
$file_name = $_FILES['file']['name'];
$file_tmp =$_FILES['file']['tmp_name'];
//body of post req ends
//response init start
$response=array();
$response["success"]=false;
$response["img_success"]=false;
$pro_pic_url="pro_pics/".$mob_no.$file_name;
//$response["trial"]=$file_name = $_FILES['file']['name'];
//response init end
$result = mysqli_query($conn,"INSERT INTO USERS (mobile_no ,password, user_name,pro_pic_url)
VALUES ('$mob_no','$hash','$user_name','$pro_pic_url')");
if($result)
{
$response["success"]=true;
if(move_uploaded_file($file_tmp,$pro_pic_url))
{
$response["img_success"]=true;
}
}
echo(json_encode($response));
?>