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!"); } ?> Quote Link to comment 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. Quote Link to comment 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>"; Quote Link to comment 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? Quote Link to comment 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** Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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>"; Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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] 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.