Jump to content

[SOLVED] how to get to call actual file name?


sandbudd

Recommended Posts

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!");
}



?> 

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>"; 

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.

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.