create a link to an external undefined file on a php DB

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

create a link to an external undefined file on a php DB

Postby jonnyfortis » Mon Jun 18, 2012 5:38 am

I have a file uploader that will send pdf files to the php DB. the pdf's will be auto naming so i cant just make a standard link

the db field name is "inventory" then the pdf is stored in a folder on the server called hostadmin/docs.

i have made the following link

<a href="../hostadmin/docs/<?php echo $row_Recordset1['inventory']; ?>"><img src="../images/smalldownload.png" width="35" height="35" alt="download" /></a>


when i select the link it just sends me to http://www.student.com/beta/hostadmin/docs/

but i will need to show the pdf that has been uploaded e.g inventory1340013581.pdf


can anyone help?

thanks in advance
jonnyfortis
Forum Contributor
 
Posts: 359
Joined: Tue Jan 10, 2012 7:05 am

Re: create a link to an external undefined file on a php DB

Postby Celauran » Mon Jun 18, 2012 6:59 am

Syntax: [ Download ] [ Hide ]
<?php echo $row_Recordset1['inventory']; ?>

Does that code by itself produce the expected output?
PHP 5.6 released! August 28, 2014
PSA: PHP 5.3 end of life August 14, 2014.
User avatar
Celauran
Moderator
 
Posts: 3658
Joined: Tue Nov 09, 2010 3:39 pm
Location: Montreal, Canada

Re: create a link to an external undefined file on a php DB

Postby jonnyfortis » Mon Jun 18, 2012 8:16 am

Celauran wrote:
Syntax: [ Download ] [ Hide ]
<?php echo $row_Recordset1['inventory']; ?>

Does that code by itself produce the expected output?


how do i test that?
jonnyfortis
Forum Contributor
 
Posts: 359
Joined: Tue Jan 10, 2012 7:05 am

Re: create a link to an external undefined file on a php DB

Postby jonnyfortis » Mon Jun 18, 2012 8:42 am

Celauran wrote:
Syntax: [ Download ] [ Hide ]
<?php echo $row_Recordset1['inventory']; ?>

Does that code by itself produce the expected output?


ok its working now,

<?php echo $row_Recordset1['Inventory']; ?>

seems to be linking to the pdfs correctly

thanks
jonnyfortis
Forum Contributor
 
Posts: 359
Joined: Tue Jan 10, 2012 7:05 am


Return to PHP - Code

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 19 guests