<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[74Web | Webdesign Forum - Uploadformular]]></title>
	<link rel="self" href="http://www.74web.de/Forum/feed/atom/topic/8/"/>
	<updated>2010-07-30T12:06:57Z</updated>
	<generator>PunBB</generator>
	<id>http://www.74web.de/Forum/topic/8/uploadformular/</id>
		<entry>
			<title type="html"><![CDATA[Uploadformular]]></title>
			<link rel="alternate" href="http://www.74web.de/Forum/post/13/#p13"/>
			<content type="html"><![CDATA[<p>&lt;?php<br />include_once(&quot;include/head.php&quot;);</p><p>$name=$_POST[name];</p><p>$conn = mysql_connect($CONF_MYSQLSERVER, $CONF_MYSQLUSER, $CONF_MYSQLPASS) or die (&quot;Verbindung mit MySQL-Server fehlgeschlagen!&quot;);mysql_select_db($CONF_MYSQLDBNAME, $conn) or die (&quot;Verbindung zur Datenbank fehlgeschlagen!&quot;);</p><p>if($_POST[sent])<br />{<br /> if(!is_uploaded_file($_FILES[neuedatei][tmp_name]))<br /> {$fehler=&quot;&lt;br&gt;Es wurde keine datei hochgeladen&quot;;<br /> } <br /> else<br /> {<br /> &nbsp; &nbsp; if($_FILES[neuedatei][size]&gt;1000000)<br />&nbsp; &nbsp; {$fehler=&quot;&lt;br&gt;Die Datei ist zu groß.&quot;;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; if(!($_FILES[neuedatei][type] == &#039;image/pjpeg&#039; OR $_FILES[neuedatei][type] == &#039;image/gif&#039;))<br />&nbsp; &nbsp; {$fehler=&quot;&lt;br&gt; Der Dateityp ist nicht zulässig&lt;br&gt;&quot;;<br />&nbsp; &nbsp; }&nbsp; &nbsp;&nbsp; <br /> }<br /> if(!$fehler)<br /> {<br /> &nbsp; &nbsp; $datei=fopen($_FILES[neuedatei][tmp_name],&#039;rb&#039;);<br /> &nbsp; &nbsp; $data=addslashes(fread($datei, $_FILES[neuedatei][size]));<br />&nbsp; &nbsp; $sql=&quot;INSERT INTO bilder (dateityp, datei, name) values (&#039;&quot;.$_FILES[neuedatei][type].&quot;&#039;,&#039;&quot;.$data.&quot;&#039;,&#039;&quot;.$name.&quot;&#039;)&quot;;<br /> if(!mysql_query($sql, $conn))<br /> &nbsp; &nbsp; {<br />&nbsp; &nbsp; $fehler=&quot;&lt;br&gt; Der Upload ist aufgrund eines Datenbankfehlers gescheitert, bitte versuchen Sie es später ncoh einm,al&lt;br&gt;&quot;;<br />&nbsp; &nbsp; }<br /> }<br /> if($fehler)<br /> {<br /> echo&quot;$fehler&quot;;<br /> }<br /> else<br /> {echo&quot; Der upload war erfolgreich&quot;;}<br />}<br />echo&quot;</p><br /><p>&lt;h2&gt;Eine neue Datei hochladen&lt;/h2&gt;<br />&lt;form action=\&quot;$PHP_SELF\&quot; method=\&quot;post\&quot; enctype=\&quot;multipart/form-data\&quot;&gt;<br />&lt;input type=\&quot;hidden\&quot; name=\&quot;sent\&quot; value=\&quot;1\&quot;&gt;<br />Name des Bildes:&lt;br&gt;&lt;input type=\&quot;text\&quot; name=\&quot;name\&quot;&gt;&lt;br&gt;<br />Quellenangabe:&lt;br&gt;&lt;input type=\&quot;file\&quot; name=\&quot;neuedatei\&quot; size=50&gt;&lt;br&gt;&lt;br&gt;<br />&lt;input type=\&quot;submit\&quot;&gt;&lt;input type=\&quot;Reset\&quot; value=\&quot;Zurücksetzen\&quot;&gt;<br />&lt;/form&gt;<br />&quot;;<br />include_once(&quot;include/foot.php&quot;);</p><p>//CREATE TABLE `bilder` (</p><p>//`ID` INT( 14 ) UNSIGNED NOT NULL AUTO_INCREMENT ,<br />//`dateityp` VARCHAR( 50 ) ,<br />//`datei` LONGBLOB,<br />//`name` VARCHAR( 50 ) DEFAULT &#039;leer&#039; NOT NULL ,<br />// PRIMARY KEY ( `ID` )<br />//) TYPE = MYISAM <br />?&gt;</p>]]></content>
			<author>
				<name><![CDATA[delvin]]></name>
				<uri>http://www.74web.de/Forum/user/2/</uri>
			</author>
			<updated>2010-07-30T12:06:57Z</updated>
			<id>http://www.74web.de/Forum/post/13/#p13</id>
		</entry>
</feed>

