This question already has an answer here:
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\aa\index.php on line 18
<?php
session_start();
include 'db.php';
$_SESSION ['message']='';
if($_SERVER['REQUEST_METHOD']=='POST'){
if($_POST['pass']==$_POST['repass']){
$username=$_POST['username'];
$addres=$_POST['addres'];
$phone=$_POST['phone'];
$email=$_POST['email'];
$pass=md5($_POST['username']);
$avatar_path='image/'.$_FILES['avatar']['name'];
$username=mysqli_real_escape_string($conn,$username);
$addres=mysqli_real_escape_string($conn,$addres); `
$phone=mysqli_real_escape_string($conn,$phone);
$email=mysqli_real_escape_string($conn,$email);
$avatar_path=mysqli_real_escape_string($conn,$avatar_path);
if(preg_match("!image!",$_FILES['avatar']['type'])){
if(copy($_FILES['avatar']['tmp_name'],$avatar_path)){
$_SESSION['username']=$username;
$_SESSION['avatar']=$avatar_path;
$sql="INSERT INTO register_user(username,addres,phone,email,pass,image_path)VALUSE
('$username','$addres','$phone','$email','$pass','$avatar_path')";
if(mysql_query($conn,$sql)){
$_SESSION['message']="You Add IN DATABASE !!!";
header(location:profile.php);
}
else {
$_SESSION['message']="User Could Not Be added IN DATABASE!!!";
}
}else {
$_SESSION['message']="File UPload Faiiled";
}
}
else {
$_SESSION['message']="!Please Upload Only JPG,PNG OR Gif image!";
}
}
else {
$_SESSION['message']="Password did Not Match";
}
}
?>
this is my error via php and mysql
Aucun commentaire:
Enregistrer un commentaire