Jo det må i da godt..;-)
CREATE TABLE links (
id mediumint(5) NOT NULL auto_increment,
overskrift varchar(50) NOT NULL,
navn varchar(50) NOT NULL,
beskrivelse varchar(255) NOT NULL,
url varchar(255) NOT NULL,
PRIMARY KEY (id),
KEY id (id)
);
og så har jeg to filer.. en \"addlinks.php\" og en \"showlinks.php\"
\"addlinks.php\"
--------------
<html>
<head>
<!-- Minus AutoDato -->
<TITLE>Indtast Link</TITLE>
<META NAME=\"Generator\" CONTENT=\"Stone\'s WebWriter 3.5\">
<link rel=stylesheet href=\"body.css\" type=\"text/css\">
<base target=\"body\">
</head>
<?php
include \"connect.php\";
if($sender && $beskrivelse)
{
mysql_query(\"insert into links (overskrift, navn, beskrivelse, url) values (\'$link\', \'$sender\', \'$beskrivelse\',\'$webadresse\')\");
echo \"<BODY\";
echo \"<font size=1>\";
echo \"Tak for dit link. Det er blevet registreret.<br>\";
exit;
}
?>
<BODY>
<font size=2>
<form action=\"addlinks.php\" target=\"body\" method=\"post\">
<TABLE ALIGN=\"left\" BORDER=\"0\" CLASS=\"body.css\">
<TR>
<td HEIGHT=\"40\"><b>Skriv dit Link og beskriv det.</b></td>
</tr>
<TR>
<td>Navn:<br><input type=\"text\" name=\"sender\"></td>
</tr>
<tr>
<td>Linkoverskrift:<br><input type=\"text\" name=\"link\" size=\"50\" maxlength=\"255\"></td>
</tr>
<tr>
<td>Beskrivelse:<br><textarea name=\"beskrivelse\" wrap=\"VIRTUAL\" rows=\"10\" cols=\"50\" maxlength=\"250\"></TEXTAREA>
</td>
</tr>
<TR>
<td>URL:<br><input type=\"text\" name=\"webadresse\" VALUE=\"
http://\"></td> </tr>
<TR>
<td><input type=\"submit\" name=\"sub\" value=\"Okay\"></td>
<td><input type=\"reset\" name=\"res\" value=\"IKKE Okay\"></td>
</tr>
</table>
</form>
</body>
</html>
og så \"showlinks.php\"
---------------------
<!-- Minus AutoDato -->
<HTML>
<META>
<link rel=\"stylesheet\" href=\"link.css\" type=\"text/css\">
</META>
<BODY>
<font size=\"1\" FACE=\"\'Verdana\'\">
<?php
include \"connect.php\";
$sql = \"select * from links\";
$res = mysql_query($sql);
?>
<table width=\"390\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<?php while ($row = mysql_fetch_array($res)) {
?>
<tr>
<td valign=\"top\"><hr><b><?php echo $row[overskrift]; ?></b><br><?php echo $row[beskrivelse]; ?></td>
</tr>
<tr>
<td valign=\"top\" height=\"15\"> <b>Link : <a HREF=\"<? echo $row[url]; ?>\" target=\"_blank\"><font color=black><?php echo $row[url]; ?></a></font></b></td>
</tr>
<tr>
<td valign=\"top\" height=\"15\"> <b>Er givet af <font color=black><?php echo $row[navn]; ?> </font></b></td>
</tr>
<tr><td><hr><br><br></td></tr>
<?php } ?>
</table>
</font>
</BODY>
</HTML>
Værsesgo Kylling.. Her er en bolle..