Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to upload pdf file using 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!!";
}
?>
Comment

how to include pdf in php page

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

PREVIOUS NEXT
Code Example
Php :: nano seed generator 
Php :: php kurzschreibweise if 
Php :: run multiple php scripts parallel 
Php :: Target class [HomeController] does not exist. 
Php :: Unsupported type passed 
Php :: How do I output top readers from MySql table 
Php :: como leer archivos .env php 
Php :: fat-free captcha plugin 
Php :: laravel Relations transform 
Php :: how check word is in sentence php 
Php :: remove public url laravel 
Php :: dd function not laravel 
Php :: Store authentication status in a cookies 
Php :: use varable on all site pages laravel 
Php :: wp plugin handles deregister 
Php :: how to write double values in phpmyadmin 
Php :: php getgmail name 
Php :: WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403 
Php :: publish laravel scout 
Php :: laravel components 
Php :: hide .php 
Php :: laravel query 
Php :: php catch mysqli_connect(): (HY000/1045): Access denied 
Php :: learn php basic 
Php :: php wordpress 
Php :: convert string to int php 7 
Java :: java enum get nex 
Java :: java save file dialog 
Java :: phone call using intent in Android 
Java :: copy array in java 2d 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =