sandbudd Posted June 30, 2008 Share Posted June 30, 2008 how do I get this to actually display the file upload name thats in the database? <?php // Connects to your Database $db_host = ''; $db_user = ''; $db_pwd = ''; $database = ''; $table = ''; ini_set('error_reporting',E_ALL); if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database"); if (!mysql_select_db($database)) die("Can't select database"); //Retrieves data from MySQL $data = mysql_query("SELECT * FROM ae_gallery") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { echo "<table align=\"center\" border=1 bordercolordark=\"#777777\" width=\"60% \" bordercolorlight=\"#dddddd\" bgcolor=\"BBBBBB\">"; //Outputs the image and other data Echo "<tr><td width=\"50%\"><font size=\"3\" color=red>Name:</font> ".$info['name'] . "</td> "; Echo "<td><font size=\"3\" color=red>Company:</font> ".$info['company'] . " </td></tr>"; Echo "<tr><td><font size=\"3\" color=red>Address:</font> ".$info['address'] . " </td>"; Echo "<td><font size=\"3\" color=red>City:</font> ".$info['city'] . " </td></tr>"; Echo "<tr><td><font size=\"3\" color=red>State:</font> ".$info['state'] . " </td>"; Echo "<td><font size=\"3\" color=red>Zip:</font> ".$info['zip'] . " </td></tr>"; Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Email:</font> ".$info['email'] . " </td></tr>"; Echo "<tr><td><font size=\"3\" color=red>Phone:</font> ".$info['phone'] . " </td>"; Echo "<td><font size=\"3\" color=red>Fax:</font> ".$info['fax'] . " </td></tr>"; echo "<tr><td colspan=\"2\"><font size=\"2\" color=blue>Process Requested</font></tr></td>"; Echo "<tr><td><font size=\"3\" color=red>Type II:</font> ".$info['type2'] . " </td>"; Echo "<td><font size=\"3\" color=red>Type III:</font> ".$info['type3'] . " </td></tr>"; Echo "<tr><td><font size=\"3\" color=red>Burnish:</font> ".$info['burnish'] . " </td>"; Echo "<td><font size=\"3\" color=red>Chromate:</font> ".$info['chromate'] . " </td></tr>"; Echo "<tr><td><font size=\"3\" color=red>Chromate Hex Free:</font> ".$info['hex'] . " </td>"; Echo "<td><font size=\"3\" color=red>Impregnation:</font> ".$info['impregnation'] . " </td></tr>"; Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Strip:</font> ".$info['strip'] . " </td></tr>"; Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Part Number:</font> ".$info['part'] . " </td>"; Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Part Description:</font> ".$info['description'] . " </td></tr>"; Echo "<tr><td><font size=\"3\" color=red>Alloy:</font> ".$info['alloy'] . " </td>"; Echo "<td><font size=\"3\" color=red>Quantity:</font> ".$info['quantity'] . " </td></tr>"; Echo "<tr><td><font size=\"3\" color=red>Specifications:</font> ".$info['spec'] . " </td>"; Echo "<td><font size=\"3\" color=red>Color:</font> ".$info['color'] . " </td></tr>"; echo "<tr><td colspan=\"2\"><font size=\"2\" color=blue>How Did You Hear About Us?</font></td></tr>"; Echo "<tr><td><font size=\"3\" color=red>Repeat Customer:</font> ".$info['repeat_customer'] . " </td>"; Echo "<td><font size=\"3\" color=red>Internet Search:</font> ".$info['isearch'] . " </td></tr>"; Echo "<tr><td><font size=\"3\" color=red>Internet Directory:</font> ".$info['idir'] . " </td>"; Echo "<td><font size=\"3\" color=red>Referral:</font> ".$info['referral'] . " </td></tr>"; Echo "<tr><td><font size=\"3\" color=red>Yellow Pages:</font> ".$info['yellow'] . " </td>"; Echo "<td><font size=\"3\" color=red>Trade Show:</font> ".$info['trade'] . " </td></tr>"; Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Other:</font> ".$info['other'] . " </td></tr>"; Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Notes:</font> ".$info['notes'] . " </td></tr>"; Echo "<tr><td colspan=\"2\"><a href=http://www.sandbudd.com/try/images/".$info['photo'] ."> file </a></td></tr>"; Echo "<tr><td colspan=\"2\"></td></tr>"; Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red></font><a href='retrieve.php?id=".$info['id']."'><input type='submit' value='delete'></a></td></tr><br><br>"; } if(isset($_GET['id'])) { $query = "DELETE FROM ae_gallery WHERE id=".$_GET['id']." LIMIT 1"; mysql_query($query) or die("Could not delete the entry!"); } ?> Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/ Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 use file_get_contents(); if I understand what your asking correctly. Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578104 Share on other sites More sharing options...
sandbudd Posted June 30, 2008 Author Share Posted June 30, 2008 This is the line I am using now? Echo "<tr><td colspan=\"2\"><a href=http://www.sandbudd.com/try/images/".$info['photo'] ."> file </a></td></tr>"; Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578106 Share on other sites More sharing options...
sandbudd Posted June 30, 2008 Author Share Posted June 30, 2008 dang just found another problem...works is firefox but delete does not in IE? Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578112 Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 internet explorer is a pain in the a** Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578115 Share on other sites More sharing options...
sandbudd Posted June 30, 2008 Author Share Posted June 30, 2008 displays fine in IE delete button doesnt work Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578117 Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 you have <input type='submit' value='delete'> but no <form action="" method="post"> </form> to go around it. Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578119 Share on other sites More sharing options...
sandbudd Posted June 30, 2008 Author Share Posted June 30, 2008 Master I tried to put it in several places with no avail? Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578130 Share on other sites More sharing options...
sandbudd Posted June 30, 2008 Author Share Posted June 30, 2008 This is what I did to no avail echo " <form name=\"form1\" method=\"post\" action=\"retrieve.php\">"; Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red></font><a href='retrieve.php?id=".$info['id']."'><input type='submit' value='delete'></a></td></tr><br><br>"; echo "</form>"; Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578132 Share on other sites More sharing options...
sandbudd Posted June 30, 2008 Author Share Posted June 30, 2008 Have tried several codes does anyone know where to put the form tag at that Master suggested and on the original post with the file name? Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578147 Share on other sites More sharing options...
MasterACE14 Posted June 30, 2008 Share Posted June 30, 2008 from that code... echo " <form name=\"form1\" method=\"post\" action=\"retrieve.php\">"; Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red></font><a href='retrieve.php?id=".$info['id']."'><input type='submit' value='delete'></a></td></tr><br><br>"; echo "</form>"; you want people to press the button, however the HTML is confused as to whether the button is used as a button to submit a form, or is used as a hyperlink, you can only use either a hyperlink or a form/button, you cant use both. Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578157 Share on other sites More sharing options...
sandbudd Posted June 30, 2008 Author Share Posted June 30, 2008 Im an idiot...Master your right it worked..any ideas on the other issue? Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red></font><a href='delete.php?id=".$info['id']."'>delete</a></td></tr><br><br>"; [code] [/code] Link to comment https://forums.phpfreaks.com/topic/112569-solved-how-to-get-to-call-actual-file-name/#findComment-578165 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.