<html>
<head>
<title>Store binary data into SQL Database</title>
</head>
<body>
<?php
error_reporting(E_ALL);
if(isset($_POST['submit'])) {
$form_description = $_POST['form_description'];
$form_data = $_FILES['form_data_groß']["tmp_name"];
$form_data = $_FILES['form_data_klein']["tmp_name"];
// connect to the database
// (you may have to adjust the hostname,username or password)
MYSQL_CONNECT("localhost","loginname","passwort");
mysql_select_db("datenbankname");
$data_groß = addslashes(fread(fopen($form_data_groß, "r"), filesize($form_data_groß)));
$data_klein = addslashes(fread(fopen($form_data_klein, "r"), filesize($form_data_klein)));
$result=MYSQL_QUERY("INSERT INTO bilder (description,bilder_groß,bilder_klein) ".
"VALUES ('$form_description','$data_groß','$data_klein')");
$id= mysql_insert_id();
print "<p>This file has the following Database ID: <b>$id</b><br><br>Noch eine Datei hochladen: <a href=\"sqlbildhochladen.php\">hier</a>.";
MYSQL_CLOSE();
} else {
// else show the form to submit new data:
?>
<form method="post" action="" enctype="multipart/form-data">
Beschriebung zum Bild (max. 100 Zeichen):<br>
<input type="text" name="form_description" maxlength="100" size="50">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"><br>
<br>
Bild groß:<br>
<input accept="image/*" type="file" name="form_data_groß" size="50"><br>
<br>
Bild klein:<br>
<input accept="image/*" type="file" name="form_data_klein" size="50">
<p><input type="submit" name="submit" value="submit">
</form>
<?php
}
?>ImageJPEG($neuesBild,"$PicPathOut"."TN"."$bild"); ImageJPEG($neuesBild,"$PicPathOut"."TN"."$bild", 95);
Bilder aus dem Internet speichern
flor 10.01.2007 - 266 Hits - 5 Antworten
bilder speichern
WIRBELWIND 14.02.2007 - 81 Hits - 2 Antworten
Ich kann keine Bilder mehr speichern.
Bjoern1992 20.12.2007 - 84 Hits -
Wie kann ich die Bilder hier speichern?
Castaspella 16.06.2008 - 56 Hits - 31 Antworten