- Messages
- 228
- Reaction score
- 13
- Points
- 38
Bakit po ganun wala po pumapasok na file sa directory ko pero nakukuha po nya yung name ng image na innupload ko
eto po code ko sa insert.php
gusto ko lang naman po ma view at pumasok yung name ng img sa db pero nakukuha naman na po yung name ng img ayaw lang po talaga pumasok sa directory yung image file
eto naman po nagiging out put ko, and nag didislpay lang po yung name ng img Koala.jpg
View attachment 321531
Sana po may makatulong Samalat
eto po code ko sa insert.php
Code:
<?php
include("connection.php");
if ($conn->connect_error) {
die("Connection Failed" . $conn->connect_error);
}
$namelist = $_POST['username'];
$section = $_POST['section'];
$image = $_FILES['image']['name'];
$sql = "INSERT INTO employee (name_list, section, image)
VALUES ('$namelist', '$section', '$image')";
$msg = "";
// if upload btn is pressed
if (isset($_GET['submit'])) {
//the path to store the uploaded image
$target = "images/".basename($_FILES['image']['name']);
//now lets move the uploaded image into the folder images
if (move_uploaded_file($_FILES['image']['tmp_name'], $target)) {
$msg = "Image uploaded successfully";
} else {
$msg = "There was a problem uploading image";
}
}
if ($conn->query($sql) === TRUE) {
header("Location:index.php");
}
else
{
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
gusto ko lang naman po ma view at pumasok yung name ng img sa db pero nakukuha naman na po yung name ng img ayaw lang po talaga pumasok sa directory yung image file
eto naman po nagiging out put ko, and nag didislpay lang po yung name ng img Koala.jpg
View attachment 321531
Sana po may makatulong Samalat
Attachments
Last edited: