Created
December 3, 2018 10:56
-
-
Save ErMandeep/39ff4235125fe2db194734aac306a334 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_POST['submit'])){ | |
$img1 = pathinfo($_FILES["image"]["name"], PATHINFO_EXTENSION); | |
$name1 = rand(1,5000).".".$img1; | |
move_uploaded_file($_FILES["image"]["tmp_name"],"./images/$name1"); | |
$sql = "UPDATE venders SET image1 = '$name1' WHERE id=2"; | |
$query = mysqli_query($connection, $sql); | |
if(!$query){ | |
echo "0"; | |
}else { | |
echo "1"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment