Jump to content

How to Link File


june_c21

Recommended Posts

I am doing a menu where user can input the title and upload the file but once they upload the file how to make the link to the title so that user can just click on the title to view the file.

 

<?php
$host = 'localhost';
$user = 'root';
$password = '';
$dbase = 'drawing';

$dblink = mysql_connect($host,$user,$password);
mysql_select_db($dbase,$dblink);

$file    = $_POST['file'];
$gf    = $_POST['gf'];
$drawing_no = $_POST['drawing_no'];
$manufac_no = $_POST['manufac_no'];
$title = $_POST['title'];

$query= "INSERT INTO drawings( gf,drawing_no,manufac_no,title) VALUES ('$gf', '$drawing_no','$manufac_no','$title') ";
$result = mysql_query($query,$dblink);

$idir = "c:/PI/";   // Path To Images Directory 

$_FILES['file']['name'];   // Set $url To Equal The Filename For Later Use 

   
        $copy = copy($_FILES['file']['tmp_name'], "$idir" . $_FILES['file']['name']);   // Move Image From Temporary Location To Permanent Location 
            if ($copy)  // If The Script Was Able To Copy The Image To It's Permanent Location 
       		print 'Drawing uploaded successfully.<br />';   // Was Able To Successfully Upload Image 

?>

Link to comment
https://forums.phpfreaks.com/topic/96135-how-to-link-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.