07. september 2000 - 07:23
#4
ok her er den første side, denne er til redigering af den næste:
<html>
<Title>Telefonbog Alpha... indtast tlf</Title>
<body bgcolor=\"#666666\" \" text=\"#FFFFFF\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FFFFFF\">
<table width=\"100%\" border=\"0\" height=\"100%\" align=\"center\">
<tr align=\"center\" valign=\"middle\">
<td width=\"100%\" height=\"100%\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">2.X.
Klasseliste BETA...</font></div>
</td>
</tr>
<tr align=\"center\" valign=\"middle\">
<td width=\"100%\" height=\"100%\">
<form action=\"liste.php\" method=\"POST\">
<div align=\"center\">
<table width=\"300\" border=\"1\" align=\"center\" bordercolor=\"#000000\">
<tr>
<td> </td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Tilføj
ny:</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Navn:</font></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=text name=navn>
</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Hjemme-Nummer:
</font></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=text name=hjemme>
</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Mobil-Nummer:
</font></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=text name=mobil>
</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">E-Mail
adresse:</font></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=text name=email>
</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
</font></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=submit value=Indtast name=\"submit\">
</font></div>
</td>
</tr>
</table>
</div>
<p align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
</font></p>
</form>
<form action=\"liste.php\" method=\"POST\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
</font>
<table width=\"300\" border=\"1\" align=\"center\" bordercolor=\"#000000\">
<tr>
<td width=\"123\"> </td>
<td width=\"167\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Slet
person:</font></div>
</td>
</tr>
<tr>
<td width=\"123\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Navn:</font></div>
</td>
<td width=\"167\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<select>
<?php
$connection = mysql_connect(\"localhost\", \"root\");
$db = \"test_db\";
$result = mysql_db_query($db, \"SELECT * FROM tlflisten\", $connection);
while($row = mysql_fetch_array($result)){
$navn = $row[\"navn\"];
echo(\"<Option>$navn</option>\"); }
?>
</select>
</font></div>
</td>
</tr>
<tr>
<td width=\"123\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
</font></div>
</td>
<td width=\"167\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=submit value=\"son\" name=sol>
</font></div>
</td>
</tr>
</table>
</div>
</form>
<form action=\"liste.php\" method=\"POST\">
<div align=\"center\">
<table width=\"300\" border=\"1\" align=\"center\" bordercolor=\"#000000\">
<tr>
<td> </td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Updater
Person:</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Person:
</font></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<select>
<?php
$connection = mysql_connect(\"localhost\", \"root\");
$db = \"test_db\";
$result = mysql_db_query($db, \"SELECT * FROM tlflisten\", $connection);
while($row = mysql_fetch_array($result)){
$navn = $row[\"navn\"];
echo(\"<Option>$navn</option>\");}
?>
</select>
</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Nyt
hjemmenummer: </font></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=text name=uhjemme>
</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Nyt
mobilnummer: </font></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=text name=umobil>
</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Ny
email-adresse: </font></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=text name=uemail>
</font></div>
</td>
</tr>
<tr>
<td>
<div align=\"center\"></div>
</td>
<td>
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
<input type=submit value=Updater name=\"submit3\">
</font></div>
</td>
</tr>
</table>
</div>
</form>
</td>
</tr>
<tr align=\"center\" valign=\"middle\">
<td width=\"100%\" height=\"100%\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">Copyright
(C) Onique/Safl 2000</font></div>
</td>
</tr>
</table>
</body>
</html>
Og dette er så output siden:
<html>
<Title>MySQL Telefonliste Alpha...</title>
<body bgcolor=\"#666666\" \" text=\"#FFFFFF\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FFFFFF\">
<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font size=\"1\">
<table border=\"1\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\" bgcolor=\"#666666\" font size=\"1\">
<?php
$connection = mysql_connect(\"localhost\", \"root\");
$db = \"test_db\";
$result = mysql_db_query($db, \"DELETE FROM tlflisten WHERE navn=\'$person\'\", $connection);
$result = mysql_db_query($db, \"INSERT INTO tlflisten (navn, hjemme, mobil, email) VALUES (\'$navn\',\'$hjemme\',\'$mobil\',\'$email\')\", $connection);
mysql_db_query($db, \"UPDATE tlflisten SET hjemme=\'$uhjemme\' WHERE navn=\'$gnavn\'\");
mysql_db_query($db, \"UPDATE tlflisten SET mobil=\'$umobil\' WHERE navn=\'$gnavn\'\");
mysql_db_query($db, \"UPDATE tlflisten SET email=\'$uemail\' WHERE navn=\'$gnavn\'\");
$result = mysql_db_query($db, \"SELECT * FROM tlflisten\", $connection);
echo(\" <tr>
<td>Navn:</td>
<td>Hjemme:</td>
<td>Mobil: </td>
<td>Email: </td>
</tr>\");
while($row = mysql_fetch_array($result)) {
$navn = $row[\"navn\"];
$hjemme = $row[\"hjemme\"];
$mobil = $row[\"mobil\"];
$email = $row[\"email\"];
echo(\"<tr><td>$navn </td>
<td>$hjemme</td>
<td>$mobil </td>
<td><a href=$email>$email</a></td> </tr>\");
}
mysql_free_result($result);
echo $person; echo\"s\";
?>
</table>
<a href=\"ny.php\">Rediger</a>
</font>
</font>
</body>
</html>