by oracle_nic » 05. August 2011 07:41
Sorry dude here is the 1st script
===========================
<HTML>
<BODY text="#FFFFFF" bgcolor="#000000" >
<p align="center">
<font face="Verdana">
Nicholas 3a
</font>
</p>
<hr>
<?php
echo "Connecting to DB..."; echo "<br>";
$db = mysql_connect("localhost", "root", "");
mysql_select_db("alpha", $db) or die(mysql_errno() . ": " . mysql_error() . "<br>");
echo "Connected"; echo "<br>";
echo "<hr>";
echo "<table border = \"1\" width = \"100%\">";
echo "<header>> Contents of table MYTABLE in database ALPHA</header>";
echo "<td align=\"center\">"; echo "ID"; echo "</td>";
echo "<td align=\"center\">"; echo "MAME"; echo "</td>";
echo "<td align=\"center\">"; echo "TYPE"; echo "</td>";
echo "<td align=\"center\">"; echo "SIZE"; echo "</td>";
echo "<td align=\"center\">"; echo "GET FILE"; echo "</td>";
$qry = "select id, name, type, size, data from myfiles";
$result = @mysql_query($qry, $db);
while ($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>"; echo $row{0}; echo "</td>";
echo "<td>"; echo $row[1]; echo "</td>";
echo "<td>"; echo $row[2]; echo "</td>";
echo "<td>"; echo $row[3]; echo "</td>";
echo "<td>";
echo "<a href = \"add_04a.php->\"id\">";
echo "<img src=\"post.jpg\" />";
echo "</td>";
echo "</tr>";
}
echo "</table>";
mysql_free_result($result);
mysql_close($db);
?>
</BODY>
</HTML>
--------------------------------------------------------
and the second one:
================
<?php
$db = mysql_connect("localhost", "root", "");
mysql_select_db("alpha", $db) or die(mysql_errno() . ": " . mysql_error() . "<br>");
$id = $_GET['id'];
$sql = "SELECT id, name, size, type, data FROM myfiles WHERE id = $id";
$result = @mysql_query($sql, $db);
$data = @mysql_result($result, 0, "id");
$name = @mysql_result($result, 0, "name");
$size = @mysql_result($result, 0, "type");
$type = @mysql_result($result, 0, "size");
$data = @mysql_result($result, 0, "data");
//$data_mine = stripslashes($data);
$data_mine =$data;
header('Content-type: $type');
echo $data_mine;
exit;
?>
</BODY>
</HTML>
----------------------------------------------
sorry for the incovinience Nic