so, den oben gennaten fehler habe ich. Ich schon im Forum gesucht, und weis auch was der bedeutet, aber ich weiss nicht wo der Fehler im Sctipt liegt. Könntet iht mir bitte helfen.
Script:
Formular:
SQL:
Script:
PHP-Code:
<?
if (isset($_POST['Send']))
{
//if sended -> upload
// call to database
include("daten/conf.php");
include("daten/connect.php");
//read information
foreach($_POST as $key=>$wert)
{
${$key} = $wert;
}
$SQL = "INSERT INTO seller ";
$SQL .= "(U_name, Passwort, Vorname, Nachname, Homepage, Email, Str, Wohnort, PLZ, Tel)";
$SQL .= "VALUES ('$U_name', '$Passwort', '$Vorname', '$Nachname' '$Homepage' '$Email' '$Str' '$Wohnort' '$PLZ' '$Tel')";
mysql_query($SQL, $DB);
$seller_id = mysql_insert_id();
if (mysql_affected_rows($DB) == 1)
{
//if insert was successful, show it =)
echo "Die Datei wurde erfolgreicht eingefügt!";
}
else
{
echo mysql_error($DB);
}
// check for pictures
$PID = mysql_insert_id($DB);
if (count($_FILES) > 0)
{
foreach($_FILES as $key=>$wert)
{
if ($wert['error']==0)
{
$Datei= $wert['tmp_name'];
$Name = $wert['name'];
$Type = $wert['type'];
$Size = $wert['size'];
/*$Mass = getimagesize($wert['tmp_name']);
$Height = $Mass[1];
$Width = $Mass[0];
*/
$File = addslashes(fread(fopen($Datei, "rb"), filesize($Datei)));
$SQL = "INSERT INTO links_bilder (ID, Name, Auto, File, Typ)
VALUES (NULL, '$Name', '$PID', '$File', '$Type')";
mysql_query($SQL, $DB);
if (mysql_affected_rows($DB) == 1) echo "<br>Bilder erfolgreich eingefügt!<br><br>";
else echo mysql_error($DB);
}
}
}
}
else
{
?>
PHP-Code:
<form name="form1" method="post" enctype="multipart/form-data" action="rcwn.php?seite=pvanmeldung">
<table width="477" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="137" height="22" valign="middle"> <div align="left"><strong><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Händler:</font></strong></div></td>
<td width="37"> </td>
<td width="303" valign="top"> <input name="U_name" type="text" id="U_name">
</td>
</tr>
<tr>
<td height="19"><font size="2" face="Geneva, Arial, Helvetica, sans-serif"><strong>Passwort:</strong></font></td>
<td> </td>
<td><input name="Passwort" type="password" id="Passwort"></td>
</tr>
<tr>
<td height="22" valign="top"> <div align="left"><strong><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Vorname:</font></strong></div></td>
<td> </td>
<td> <input name="Vorname" type="text" id="Vorname"> </td>
</tr>
<tr>
<td height="22" valign="top"> <div align="left"><strong><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Nachname:</font></strong></div></td>
<td> </td>
<td valign="top"> <input name="Nachname" type="text" id="Nachname">
</td>
</tr>
<tr>
<td height="19"><font size="2" face="Geneva, Arial, Helvetica, sans-serif"><strong>Telefon:</strong></font></td>
<td> </td>
<td><input name="Tel" type="text" id="Tel"></td>
</tr>
<tr>
<td height="22" valign="top"><div align="left"><strong><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Homepage:</font></strong></div></td>
<td> </td>
<td> <input name="Homepage" type="text" id="Homepage" value="http://" size="30">
</td>
</tr>
<tr>
<td height="22" valign="top"><div align="left"><strong><font size="2" face="Geneva, Arial, Helvetica, sans-serif">e-mail:</font></strong></div></td>
<td> </td>
<td> <input name="Email" type="text" id="Email" size="30"> </td>
</tr>
<tr>
<td height="22" valign="top"><div align="left"><strong><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Straße:</font></strong></div></td>
<td> </td>
<td> <input name="Str" type="text" id="Str" size="30">
</td>
</tr>
<tr>
<td height="22" valign="top"><div align="left"><strong><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Wohnort:</font></strong></div></td>
<td> </td>
<td> <input name="Wohnort" type="text" id="Wohnort" size="15"></td>
</tr>
<tr>
<td height="22" valign="top"><div align="left"><strong><font size="2" face="Geneva, Arial, Helvetica, sans-serif">PLZ:</font></strong></div></td>
<td> </td>
<td> <input name="PLZ" type="text" id="PLZ" size="5"></td>
</tr>
<tr>
<td height="22" valign="top"><!--DWLayoutEmptyCell--> </td>
<td> </td>
<td> <div align="left">
<input name="Send" type="submit" class="feld" value="Abschicken">
<input name="Submit2" type="reset" class="feld" value="Zurücksetzen">
</div></td>
</tr>
</table>
<p> </p>
</form>
PHP-Code:
$SQL2 = 'CREATE TABLE `seller` ('
. ' `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY, '
. ' `U_name` VARCHAR(100) NOT NULL, '
. ' `Passwort` VARCHAR(100) NOT NULL, '
. ' `Vorname` VARCHAR(100) NOT NULL, '
. ' `Nachname` VARCHAR(100) NOT NULL, '
. ' `Homepage` VARCHAR(100) NOT NULL, '
. ' `PLZ` INT( 11 ) NOT NULL DEFAULT '0', '
. ' `Wohnort` VARCHAR(100) NOT NULL, '
. ' `Homepage` VARCHAR(100) NOT NULL, '
. ' `Email` VARCHAR(100) NOT NULL'
. ' `Str` VARCHAR(100) NOT NULL'
. ' `Tel` VARCHAR(100) NOT NULL'
. ' )'
. ' ENGINE = myisam;';
Kommentar