“cara memasukkan pdf di halaman php” Kode Jawaban

cara mengunggah file pdf menggunakan php

//Form 
<form method="post" action="db_connect.php" role="form" enctype="multipart/form-data"> 
	<input type="file" name="pdf_file" id="pdf_file" accept="application/pdf" />
	<button id="send" type="submit" name="submit" class="btn btn-success">Submit</button>
</form>
//create a file db_connect.php
/// create connection to your database using your localhost server, username, password
 // the name of your database

<?php

$allowedExts = array("pdf");
$temp = explode(".", $_FILES["pdf_file"]["name"]);
$extension = end($temp);
$upload_pdf=$_FILES["pdf_file"]["name"];
move_uploaded_file($_FILES["pdf_file"]["tmp_name"],"uploads/pdf/" . $_FILES["pdf_file"]["name"]);
$sql=mysqli_query($con,"INSERT INTO `Table Name`(`pdf_file`)VALUES($upload_pdf')");
if($sql){
	echo "Data Submit Successful";
}
else{
	echo "Data Submit Error!!";
}
?>
Farmer N21

cara memasukkan pdf di halaman php

<p>Insert message here, if the PDF cannot be displayed.</p>
</object>
</body>
</html>
JILT- CONSULT

Jawaban yang mirip dengan “cara memasukkan pdf di halaman php”

Pertanyaan yang mirip dengan “cara memasukkan pdf di halaman php”

Lebih banyak jawaban terkait untuk “cara memasukkan pdf di halaman php” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya