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 :: a facade root has not been set phpunit 
Php :: laravel where like 
Php :: request get query string laravel 
Php :: save post data to file php 
Php :: how do decode base64 php 
Php :: eloquent get distinct 
Php :: how to redirect to another page from laravel blade 
Php :: php get all php files in a directory 
Php :: laravel if syntax 
Php :: convert float to integer laravel 
Php :: cookie are not set in php 
Php :: laravel route resources 
Php :: laravel get subdomain 
Php :: api anaf 
Php :: php header pdf 
Php :: how to save file in storage folder in laravel 
Php :: pdo connect 
Php :: How to create a controller in laravel 
Php :: mysqli loop 
Php :: laravel blade upper case 
Php :: php line break in echo 
Php :: column of csv to array php 
Php :: multidimensional array item remove php 
Php :: blade condition if else laravel 
Php :: startsWith() and endsWith() functions in PHP 
Php :: 404 page in laravel 
Php :: woo set_stock_quantity 
Php :: item count in cart quantitiy woocommerce 
Php :: install php 5.6 on ubuntu 18.04 
Php :: LARAVEL CREAT NEW TEST 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =