Entry 855
A script to manage his own favourite web sites
Submitted by anonymous
on June 14, 2008 at 7:08 p.m.
Language: PHP. Code size: 1.9 KB.
<?php error_reporting(E_ALL); ini_set("display_errors",0); if(isset($_POST['gesendet'])) { $datei = fopen("./favoriten.txt","a"); $zeilen_umbruch = chr(13) . chr(10); if(!$datei) { echo "Datei konnte nicht zum Schreiben geffnet werden"; exit; } fputs ($datei, $_POST["beschreibung"] . $zeilen_umbruch . $_POST["url"] . $zeilen_umbruch); fclose($datei); } ?> <html> <head> <title>Meine Favoriten</title> <style type="text/css"> body { margin:0; padding:0; } tr:hover { background-color:skyblue; } table { border-color:orange; border-style:solid; } th,td,tr { border:0; } a:link { color:black; text-decoration:none; } a:visited { color:black; text-decoration:none; } a:focus { color:white; text-decoration:none; } a:hover { color:black; text-decoration:none; } a:active { color:white; background-color:white; text-decoration:none; } </style> </head> <body> <table width="100%" height="100%" border="30" rules="none"> <tr> <th align="center" width="50%">Beschreibung der Seite</th> <th align="center" width="50%">URL</th> </tr> <?php $favoriten = file("favoriten.txt"); for($zeile=0; $zeile<sizeof($favoriten); $zeile=$zeile+2) { echo "<tr>\n"; echo "<td>" . $favoriten[$zeile] . "</td>\n"; echo "<td>"; echo "<a href=\"" . $favoriten[$zeile+1] . "\" title=\"" . $favoriten[$zeile] . "\" width=\"100%\">"; echo $favoriten[$zeile+1]; echo "</a></td>\n"; echo "</tr>\n"; } ?> <tr class="letztezeile"> <form action="favoriten.php" method="POST" name="formular"> <td align="center"> <input name="beschreibung" size="50%"> </td> <td align="center"> <input name="url" size="50%"> <input type="submit" "value="Favorit hinzufügen" "name="gesendet""> </td> </form> </tr> </table> </body> </html>
This snippet took 0.00 seconds to highlight.
Back to the Entry List or Home.