pls i want how to upload and retrive only pdf files in php and mysql code or any links..

$targetPath = $_SERVER['DOCUMENT_ROOT'].'/upload/';

if (isset($_POST['submit'])){

$filename = basename( $_FILES['file']['name'], ".pdf");

if($_FILES['file']['type']=='application/pdf') {
        $filename = preg_replace("/[^A-Za-z0-9_-]/", "", $filename).".pdf";
        $thumb = basename($filename, ".pdf");
        do {
            $targetFile =  str_replace('//','/',$targetPath) ."Copy".$cpy. $filename;
            $filename="Copy".$cpy. $_FILES['file']['name'];

            if(move_uploaded_file($_FILES['file']['tmp_name'], $targetPath.$filename)) {             
                    $pdfWithPath = $targetPath.$filename;
                    echo "File Uploaded Successfully";
else {
    echo "Please Upload pdf File";  


<form method="post" action="" enctype="multipart/form-data">
    <input type="file" name="file" />
    <input type="submit" name="submit" value="Upload" />

Check your $targetPath path is correct and give 777 permission for folder upload

thanq soo much darling :)