witham Posted December 4, 2008 Share Posted December 4, 2008 hi i am hoping someone can help me, I need to upload the path to a pdf file stored on the same machine. I have tried "file upload" but I can't seem to make it work. I will continue to try but I just need to establish if this is the correct piece of code to be using? Quote Link to comment Share on other sites More sharing options...
MadTechie Posted December 4, 2008 Share Posted December 4, 2008 upload the path to a pdf ? i think i need more detail.. what are you trying to do ? Quote Link to comment Share on other sites More sharing options...
witham Posted December 5, 2008 Author Share Posted December 5, 2008 Thanks for you reply I have a database that contains various information input via a form this includes name, address and suchlike. Below is the array I want to display but I need the "compfile" to display as a hyperlink to the file. { // $row["fieldname" returns the content for the field in the current row echo "<tr><td>" .$row["MANNAME"]. "</td>"; echo "<td>" .$row["prodtype"]. "</td>"; echo "<td>" .$row["proddesc"]. "</td>"; echo "<td>" .$row["prodnar"]. "</td>"; echo "<td>" .$row["prodequiv"]."</td>"; echo "<td><a href=>" .$row["compfile"]."</td></tr>"; } // close html table tag echo "</table>\n"; Quote Link to comment Share on other sites More sharing options...
liams7 Posted December 5, 2008 Share Posted December 5, 2008 echo "<td><a href=>" .$row["compfile"]."</td></tr>"; This wont point to anything as the hyperlink isnt there dont you need something more like echo "<td><a href=" .$row["compfile"].">Then something in here</td></tr>"; Quote Link to comment Share on other sites More sharing options...
witham Posted December 5, 2008 Author Share Posted December 5, 2008 Thanks very much its working now I had tried about every combination I could think of except that one. Quote Link to comment Share on other sites More sharing options...
witham Posted December 5, 2008 Author Share Posted December 5, 2008 Just one more thing if I could ask how would I use an image as the link?? Quote Link to comment Share on other sites More sharing options...
MadTechie Posted December 6, 2008 Share Posted December 6, 2008 Just a note but don't forget to close the anchor tag or excape quote for the link echo "<td><a href=\"".$row["compfile"]."\">Text Here</a></td></tr>"; for an image just replace the text with an image tag ie echo "<td><a href=\"".$row["compfile"]."\"><img src=\"myimage.jpg\"></a></td></tr>"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.