PHP Code:
echo "<div class='impressum'><form name='Registration' action='os-settings.php'
method='post' accept-charset='ISO-8859-1'>
<input type='text' name='street' maxlength='50'>
<span style='font-weight:bold'>STREET</span>";
echo "<br>\n";
echo "<input type='text' name='zip' maxlength='50'>
<span style='font-weight:bold'>ZIPCODE</span>";
echo "<br>\n";
echo "<input type='text' name='city' maxlength='50'>
<span style='font-weight:bold'>CITY</span>";
echo "<br>\n";
echo "<input type='text' name='country' maxlength='50'>
<span style='font-weight:bold'>COUNTRY</span>";
echo "<br /><br /><br />\n";
echo "<input type='text' name='web' maxlength='100'>
<span style='font-weight:bold'>WEBSITE</span>";
echo "<br>\n";
echo "<input type='text' name='facebook' maxlength='100'>
<span style='font-weight:bold'>FACEBOOK</span>";
echo "<br>\n";
echo "<input type='text' name='youtube' maxlength='100'>
<span style='font-weight:bold'>YOUTUBE</span>";
echo "<br>\n";
echo "<input type='text' name='soundcloud' maxlength='100'>
<span style='font-weight:bold'>SOUNDCLOUD</span>";
echo "<br>\n<br>\n<br>\n";
echo "<input type='text' name='icq' maxlength='100'>
<span style='font-weight:bold'>ICQ</span>";
echo "<br>\n";
echo "<input type='text' name='msn' maxlength='100'>
<span style='font-weight:bold'>MSN</span>";
echo "<br>\n";
echo "<input type='text' name='skype' maxlength='100'>
<span style='font-weight:bold'>SKYPE</span>";
echo "<br /><br /><br />";
echo "<input type='text' name='image' maxlength='200'>
<span style='font-weight:bold'>IMAGE URL</span>";
echo "<br>\n";
echo "<input type='text' name='genres' maxlength='100'>
<span style='font-weight:bold'>FAV GENRES</span>";
echo "<br>\n<br>\n<br>\n";
echo "<span style='font-weight:bold'>ABOUT YOU</span>
<br />
<textarea name='about' cols='50' rows='10'></textarea>";
echo "<br>\n
<input type='submit' name='SAVE' value='SAVE' />
</form></div>";
PHP Code:
if (isset($_POST['submit'])){
mysql_connect($db_server, $db_user, $db_password) or die(mysql_error());
mysql_select_db($db_databank) or die(mysql_error());
mysql_query("INSERT INTO ??? (
STREET, ZIP, CITY, COUNTRY, WEB, FACEBOOK, YOUTUBE, SOUNDCLOUD, ICQ, MSN, Skype, GENRES, IMAGE, ABOUT)
VALUES (
'".mysql_real_escape_string(trim($_POST['street']))."',
'".mysql_real_escape_string(trim($_POST['zip']))."',
'".mysql_real_escape_string(trim($_POST['city']))."',
'".mysql_real_escape_string(trim($_POST['country']))."',
'".mysql_real_escape_string(trim($_POST['web']))."',
'".mysql_real_escape_string(trim($_POST['facebook']))."',
'".mysql_real_escape_string(trim($_POST['youtube']))."',
'".mysql_real_escape_string(trim($_POST['soundcloud']))."',
'".mysql_real_escape_string(trim($_POST['icq']))."',
'".mysql_real_escape_string(trim($_POST['msn']))."',
'".mysql_real_escape_string(trim($_POST['skype']))."',
'".mysql_real_escape_string(trim($_POST['genres']))."',
'".mysql_real_escape_string(trim($_POST['image']))."',
'".mysql_real_escape_string(trim($_POST['about']))."')")
or die(mysql_error());}
Bitte genauere BEschreibung + Debugging (ERROR_REPORTING + mysql_error() ggf. auswerten lassen). Warum insert into ???
Leave a comment: