Created
November 30, 2021 06:08
-
-
Save RobyCigar/04d7e91cd43656b0d63f32d3cda278ab to your computer and use it in GitHub Desktop.
insert
This file contains hidden or 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
$extension = findexts($gambar); | |
$NamaGambar = getNamaGambar($gambar, 'artikel'); | |
if (($extension == "bmp") || ($extension == "gif") || ($extension == "jpg") || ($extension == "jpeg") || ($extension == "png") || ($extension == "pdf") || ($extension == "pNamaGambar")) { | |
if (move_uploaded_file($_FILES['gambar']['tmp_name'], "../../upload/artikel/" . $NamaGambar)) { | |
createThumb($gambar, 'artikel', $NamaGambar); | |
$query = "INSERT INTO artikel(id_artikel, judul, isi, gambar) VALUES ('$id_artikel', '$judul', '$isi', '$NamaGambar')"; | |
$sql = mysqli_query($conn,$query) or die("cek : " . mysqli_error($conn)); | |
if ($sql) { | |
url("artikel&con=0"); | |
} else { | |
url("artikel&con=1"); | |
} | |
} else { | |
echo $query; | |
url("penginapan&con=9"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment