PHP-Code:
<html>
<head>
<?php
if ($gesendet)
{
$title = $_POST['title'];
$url = $_POST['url'];
$keywords = $_POST['keywords'];
$description = $_POST['description'];
$mail = $_POST['mail'];
$db = mysql_connect(localhost, root);
mysql_select_db ('insitor2', $db);
$ins = "insert into search_data(title, url, keywords, description, mail) values ('$title', '$url', $keywords, $description, '$mail')";
mysql_query ($ins);
$num = mysql_affected_rows();
if ($num>0)
echo "Es wurde 1 Datensatz hinzugefügt<p>";
else
{
echo "Es ist ein Fehler aufgetreten, ";
echo "es wurde kein Datensatz hinzugefügt<p>";
}
mysql_close($db);
}
?>
<style type="text/css">
<!--
.Stil1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.Stil7 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
<title>EgoSearch 1.0 - Finden was wichtig ist!</title></head>
<body> <?php include 'header.php'; ?>
<form action = "eingabe.php" method = "post" class="Stil1">
<div align="center" class="Stil1">
</div>
<table width="98%" border="0" align="center">
<tr>
<td colspan="2"><div align="center">
<p>Eingabe-Formular</p>
<p> </p>
</div></td>
</tr>
<tr>
<td width="50%" align="right"><input name="title"></td>
<td width="50%">Titel</td>
</tr>
<tr>
<td align="right"><input name="url"></td>
<td>Url </td>
</tr>
<tr>
<td align="right"><input name="keywords"></td>
<td>Suchbegriffe</td>
</tr>
<tr>
<td align="right"><input name="description"></td>
<td>Beschreibung</td>
</tr>
<tr>
<td align="right"><input name="mail"></td>
<td>E-Mail Adresse</td>
</tr>
</table>
<p align="center" class="Stil1">
<p align="center">
<input name="gesendet" type="submit" value="Senden">
<input type="reset" value="Reset">
</form>
<?php include'footer.php'; ?>
</body>
</html>
Kommentar