|
|
|
Serveral Examples added together here.. Thanks to all with excellent examples.
<?
if($submitted) {
require("config.inc");
$data = addslashes(fread(fopen($src, "r"), filesize($src)));
$strDescription = addslashes(nl2br($des));
$sql = "INSERT INTO images
(alttext, src, des, filename, filesize, filetype)
VALUES
(\"$alttext\", \"$data\", \"$strDescription\", \"$src_name\", \"$src_size\", \"$src_type\")
";
$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");
$msg = "Thank You $u, the following infromation has been added to the database <br>";
$sql = "SELECT id, alttext FROM images WHERE filename=\"$src_name\"";
$result = @mysql_query($sql,$connection) or die("Couldn't execute query. Load");
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$alttext = $row['alttext'];
}
$link = "The html src to this image is <br> img border=\"0\" src=\"image.php?id=$id\" alt=\"$alttext\" <br> <img border=\"0\" src=\"image.php?id=$id\" alt=\"$alttext\">";
echo $msg;
echo $link;
exit;
}
?>
<FORM METHOD="post" ACTION="<? echo $PHP_SELF?>" ENCTYPE="multipart/form-data">
<INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" VALUE="1000000">
<TABLE BORDER="0" cellspacing="0" cellpadding="0">
<TR>
<TD>ALT text: </TD>
<TD><TEXTAREA NAME="alttext" ROWS="1" COLS="50"></TEXTAREA></TD>
</TR>
<TR>
<TD>Description: </TD>
<TD><TEXTAREA NAME="des" ROWS="1" COLS="50"></TEXTAREA></TD>
</TR>
<TR>
<TD>File: </TD>
<TD><INPUT TYPE="file" NAME="src"></TD>
</TR>
<TR>
<TD COLSPAN="2"><INPUT TYPE="submit" VALUE="Submit"></TD>
</TR>
</TABLE>
<input type=hidden name=submitted value=1>
</FORM> |
|
| Functions for loading images into a MySQL database and displaying them. Categories : Graphics, HTML and PHP, MySQL, PHP, Databases | | | Creating thumbnails from MySQL Blobs online Categories : PHP, MySQL, Graphics, HTML and PHP, Databases | | | The simple counter with use MySql and gd. Categories : MySQL, HTTP, Graphics, PHP, Databases | | | This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases, MySQL, Complete Programs, PHP, Databases | | | bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager Categories : MySQL, PHP, MySQL, Complete Programs, Databases | | | Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | Cut your MySQL Connections to 1 line of code Categories : PHP, Beginner Guides, Databases, MySQL | | | phpAds, a complete banner and ad management system with detailled tracking and stats. Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases | | | Point and Click Interface ala MS Access for creating SQL statements. Categories : MySQL, Complete Programs, General SQL, PHP, Databases | | | Message of the Day - Random Message (Needs MySQL!) Categories : Databases, HTML and PHP, PHP, MySQL | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | Tropicalm Genetree Family (MySQL based family tree) Categories : PHP, Interfaces, Databases, MySQL, Complete Programs | | | mysql_escape_string Categories : PHP, MySQL, Databases, Strings | | | Automatically printing the contents of an sql table in MySQL. Categories : MySQL, PHP, HTML and PHP, Databases | | | Email a user with out exposing email address Categories : PHP, Databases, MySQL, Email | |
|
|
|