salah Skrevet 24. september 2004 Del Skrevet 24. september 2004 (endret) Heisann. Jeg fant en kode for gjestebok og jeg brukte koden på hjemmesiden min. Men det eneste jeg får, er et feilmelding på toppen av hjemmesiden: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/x2px038/public_html/nlf/sw/gjestebok/index.php:9) in /home/x2px038/public_html/nlf/sw/gjestebok/index.php on line 195 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/x2px038/public_html/nlf/sw/gjestebok/index.php:9) in /home/x2px038/public_html/nlf/sw/gjestebok/index.php on line 195 Koden til gjestebok/index.php er: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Petter Online - Gjestebok</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="DESCRIPTION" CONTENT="Petters personlige hjemmeside"> <META NAME="KEYWORDS" CONTENT="Petter sin hjemmeside"> <META NAME="AUTHOR" CONTENT="Petter"> <LINK HREF="http://12px.net/nlf/sw/style.css" TYPE="text/css" REL="stylesheet"> <STYLE TYPE="TEXT/CSS"> BODY { SCROLLBAR-FACE-COLOR: #7C98A6; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; SCROLLBAR-SHADOW-COLOR: #cccccc; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #f8f8f8; SCROLLBAR-TRACK-COLOR: #f8f8f8; SCROLLBAR-DARKSHADOW-COLOR: #000000 } </STYLE> </HEAD> <BODY> <TABLE WIDTH="900" BORDER="0" CELLSPACING="1" CELLPADDING="0" BGCOLOR="#000000" ALIGN="center"> <TR> <TH COLSPAN="2"> <TABLE WIDTH="100%"BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR> <TD CLASS="bg" HEIGHT="31" ALIGN="left"><img src="http://12px.net/nlf/sw/banner.jpg" alt="Ja du vet vel hva det er??"></TD> </TR> </TABLE><!-- </TH> </TR> <TR> <TD WIDTH="150" BGCOLOR="#393d40" HEIGHT="16"> <DIV CLASS="zoeken"></DIV> </TD> <TD CLASS="menubar" ALIGN="left" HEIGHT="16"> <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="400" BORDER="0"> <TBODY> <TR> <TD> <A CLASS="menub" HREF="#">Item #1</A> </TD> <TD> <A CLASS="menub" HREF="#">Item #2</A> </TD> <TD> <A CLASS="menub" HREF="#">Item #3</A> </TD> <TD> <A CLASS="menub" HREF="#">Item #4</A> </TD> <TD> <A CLASS="menub" HREF="#">Item #5</A> </TD> <TD> <A CLASS="menub" HREF="#">Item #6</A> </TD> </TR> </TBODY> </TABLE> </TD> </TR><!--> <TR> <TD WIDTH="150" HEIGHT="20" CLASS="zoeken2" ALIGN="left" VALIGN="middle"> </TD> <TD CLASS="conarea" HEIGHT="20"> <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%" BORDER="0"> <TBODY> <TR> <TD CLASS="nav1" ALIGN="left">Gjesteboka</TD> </TR> </TBODY> </TABLE> </TD> </TR> <TR> <TD VALIGN="top" WIDTH="150" BGCOLOR="#ffffff"><BR> <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%" BORDER="0"> <TBODY> <TR> <TD CLASS="mltop">Navigasjon</TD> </TR> <TR> <TD CLASS="ml"> » <A CLASS="menubar" HREF="http://12px.net/nlf/sw/index.html">Forsiden</A><BR> » <A CLASS="menubar" HREF="http://12px.net/nlf/sw/linker.html">Linker</A><BR> » <A CLASS="menubar" HREF="http://12px.net/nlf/sw/gjestebok/">Gjestebok</A><BR> » <A CLASS="menubar" HREF="http://12px.net/nlf/sw/venner.html">Venner</A><BR> » <A CLASS="menubar" HREF="http://12px.net/nlf/sw/ommeg.html">Om Meg</A><BR> » <A CLASS="menubar" HREF="http://12px.net/nlf/sw/kontakt.php">Kontakt Meg</A><BR> </TD> </TR> </TBODY> </TABLE> <TD CLASS="content" VALIGN="top" WIDTH="760" align="left"> <!-- Begin of Content --> <pre style="font-family: Georgia; font-size: 10pt; margin-left: 30pt"> <?php //script is written by daniel venzin, [email protected] //change the variables below only if you know something about php //dont forget the chmod your textfile //change the labels for main page $label_titel = "Velkommen til gjesteboka!"; $label_page = "Side"; $label_add_entry = "Skriv inn:"; $label_name = "Navn"; $label_homepage = "Hjemmeside"; $label_email = "Email"; $label_comment = "Kommentar"; $label_send = "Send"; $label_smilies = "Smilies"; $label_entries = "Antall signerte:"; $label_date = "Dato"; $label_time = "Time"; $label_wrote = "Skrev"; $label_comment_by_admin = "Kommentar fra administrator (Kamilla)"; $label_to_page = "Gå til side:"; $label_admin = "Administrator"; //alt information of pics $pic_browser = "no browser information"; $pic_ip_logged = "IPadressen er logget"; $pic_ip_not_logged = "IPadressen er ikke logget"; $pic_homepage = "Ingen hjemmeside"; $pic_email = "Ingen email"; //smilies $smiley_smile = "smile"; $smiley_wink = "wink"; $smiley_grin = "grin"; $smiley_rolleyes = "rolleyes"; $smiley_tongue = "tongue"; $smiley_undecided = "undecided"; $smiley_shocked = "shocked"; $smiley_sad = "sad"; //bad wordlist (add more if you want) $bad = array("fuck", "fucker", "bitch", "sucker"); //maximal string length in comment $strlength = "30"; //change the labels for adding an entry $label_ok = "ok"; $label_error_name = "Du glemte å skrive inn navnet ditt"; $label_error_homepage = "Hjemmesiden din må begynne med http://"; $label_error_email = "Emailadressen er feil!"; $label_error_comment = "Glemte å signere"; $label_strlength_comment = "Noen av orda er for lange :)"; $label_status = "Status"; $label_status_ok = "Takk for at du signerte =)"; $label_status_notok = "Det skjedde en feil, prøv igjen :)"; //how many entries per page $show_results = 10; //file to store data $file = "data.txt"; //format of date and time (in seconds. for example +3 hours: time()+10800) $date = date("d.m.y", time()+0); $time = date("H:i:s", time()+0); //change the labels for admin functions $label_passwort = "Passord"; $label_login = "Logg Inn"; $label_login_status_not_ok = "Feil passord"; $label_edit = "Rediger"; $label_delete = "Slett"; $label_change_entry = "Endre kommentar"; $label_ip = "IPAdresse:"; $label_admin_comment = "Svar:"; $label_admin_date = "Dato"; $label_admin_ip = "IPadresse"; $label_admin_browser = "browser"; $label_change = "change"; $label_status_deleted = "succesfully deleted. go to index"; $label_logout = "logout"; //passwort for admin $password = "eyx623"; //email notification (1 for yes, 0 for no) $notification = 1; $mail_to = "[email protected]"; $mail_subject = "En som har signert i gjesteboka di :)"; $mail_text = "Det er en som har signert i gjesteboka di:"; //don't change below if you don't know much about php session_start(); if ($action == "login"){ if ($password == $pass){ header("Location: " . $PHP_SELF); session_register('loginok'); } else header("Location: " . $PHP_SELF . "?action=loginfailed"); } if ($action == "logout"){ session_destroy(); header("Location: " . $PHP_SELF); } ?> <style type="text/css"> <!-- body,td,th { font-size:12px; color:#000000; font-family:Arial; } input { font-size:12px; color:#000000; font-family:Arial; width:150; background-color:#FFFFFF; border-color:#000000; border-width:thin } textarea { font-size:12px; color:#000000; font-family:Arial; width:150; height:80; border-color:#000000; border-width:thin } a:link { color: #000000; text-decoration: none; } a:visited { text-decoration: none; color: #000000; } a:hover { text-decoration: none; color: #000000; } a:active { text-decoration: none; color: #000000; } .small { font-size:9px; font-family:Arial; } --> </style><table width="400" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="300"><strong><?php echo $label_titel; ?></strong></td> <td width="100" align="right"> <?php if (!isset($show)) $show = 1; echo $label_page . " " . $show; if ($show == 1) $show = 0; else $show = ($show - 1)*$show_results; ?> </td> </tr> <tr> <td colspan="2"><hr width="400" color="#000000"></td> </tr> <tr> <td colspan="2"> <?php if ($action == "senddata"){ ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_name; ?>:*</strong></td> <td width="10"> </td> <td width="300"> <?php if ($name == ""){ echo $label_error_name; $error = "1"; } else echo $label_ok; ?> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_homepage; ?>:</strong></td> <td width="10"> </td> <td width="300"> <?php if ($homepage != ""){ if (!eregi("^(http://)([a-z0-9-]+\.)+([a-z0-9-]{2,4})$", $homepage)){ echo $label_error_homepage; $error = "1"; } else echo $label_ok; } else echo $label_ok; ?> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_email; ?>:</strong></td> <td width="10"> </td> <td width="300"> <?php if ($email != ""){ if (!eregi("^[_a-z0-9]+(\.[_a-z0-9-]+)*@([a-z0-9-]+\.)+([a-z0-9]{2,4})$",$email)){ echo $label_error_email; $error = "1"; } else echo $label_ok; } else echo $label_ok; ?> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_comment; ?>:*</strong></td> <td width="10"> </td> <td width="300"> <?php $words = explode(" ", $comment); for ($i=0;$i<count($words);$i++){ if (strlen($words[$i]) > $strlength) $error_strlength = "1"; } if ($comment == ""){ echo $label_error_comment; $error = "1"; } elseif ($error_strlength == "1"){ $error = "1"; echo $label_strlength_comment; } else echo $label_ok; ?> </td> </tr> </table> <?php if ($error != "1"){ $comment = str_replace("\r\n", " ", $comment); $comment = str_replace("|", " ", $comment); $fp = fopen($file, "r"); $content = fread($fp, filesize($file)); fclose($fp); $fp = fopen($file, "w+"); fwrite($fp, $time . " " . $date . "|" . stripslashes($name) . "|" . $homepage . "|" . $email . "|" . stripslashes($comment) . "||" . $HTTP_USER_AGENT . "|" . $REMOTE_ADDR . "\r\n" . $content); fclose($fp); if ($notification == 1){ if ($email == "") $email = "no@email"; if ($homepage == "") $homepage = "no homepage"; mail($mail_to, $mail_subject, $mail_text . "\n\nname: " . $name . "\n" . "homepage: " . $homepage . "\n" . "email: " . $email . "\n" . "comment: " . $comment, "From: $name <$email>"); } } } elseif ($action == "sendchangedata" && session_is_registered('loginok')){ ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_name; ?>:*</strong></td> <td width="10"> </td> <td width="300"> <?php if ($name == ""){ echo $label_error_name; $error = "1"; } else echo $label_ok; ?> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_homepage; ?>:</strong></td> <td width="10"> </td> <td width="300"> <?php if ($homepage != ""){ if (!eregi("^(http://)([a-z0-9-]+\.)+([a-z0-9-]{2,4})$", $homepage)){ echo $label_error_homepage; $error = "1"; } else echo $label_ok; } else echo $label_ok; ?> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_email; ?>:</strong></td> <td width="10"> </td> <td width="300"> <?php if ($email != ""){ if (!eregi("^[_a-z0-9]+(\.[_a-z0-9-]+)*@([a-z0-9-]+\.)+([a-z0-9]{2,4})$",$email)){ echo $label_error_email; $error = "1"; } else echo $label_ok; } else echo $label_ok; ?> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_comment; ?>:*</strong></td> <td width="10"> </td> <td width="300"> <?php $words = explode(" ", $comment); for ($i=0;$i<count($words);$i++){ if (strlen($words[$i]) > $strlength) $error_strlength = "1"; } if ($comment == ""){ echo $label_error_comment; $error = "1"; } elseif ($error_strlength == "1"){ $error = "1"; echo $label_strlength_comment; } else echo $label_ok; ?> </td> </tr> </table> <?php if ($error != "1"){ $open = file($file); $comment = str_replace("\r\n", " ", $comment); $admincomment = str_replace("\r\n", " ", $admincomment); $open[$id] = $old_date . "|" . stripslashes($name) . "|" . $homepage . "|" . $email . "|" . stripslashes($comment) . "|" . $admincomment . "|" . $browser . "|" . $ip . "\r\n"; $fp = fopen($file, "w+"); for ($i=0;$i<count($open);$i++) $new .= $open[$i]; fwrite($fp, $new); fclose($fp); } } elseif ($action == "changedata" && session_is_registered('loginok')){ $open = file($file); $elements = explode("|", $open[$id]); ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <form action="<?php echo $PHP_SELF; ?>?action=sendchangedata&id=<?php echo $id; ?>" method="post"> <tr> <td width="90" bgcolor="#CCCCCC"> </td> <td width="10"> </td> <td width="150"><strong><?php echo $label_change_entry; ?>:</strong></td> <td width="150" rowspan="19" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0"> <tr align="center"> <td colspan="3"><strong><?php echo $label_smilies; ?>:</strong></td> </tr> <tr> <td width="70" align="right"> </td> <td width="10" align="left"> </td> <td width="70" align="left"> </td> </tr> <tr> <td width="70" align="right"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_smile; ?>: ';"><img src="smile.gif" alt="<?php echo $smiley_smile; ?>" width="15" height="15" border="0"></a></td> <td width="10" align="left"> </td> <td width="70" align="left"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_wink; ?>: ';"><img src="wink.gif" alt="<?php echo $smiley_wink; ?>" width="15" height="15" border="0"></a></td> </tr> <tr> <td width="70" align="right"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_grin; ?>: ';"><img src="grin.gif" alt="<?php echo $smiley_grin; ?>" width="15" height="15" border="0"></a></td> <td width="10" align="left"> </td> <td width="70" align="left"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_rolleyes; ?>: ';"><img src="rolleyes.gif" alt="<?php echo $smiley_rolleyes; ?>" width="15" height="15" border="0"></a></td> </tr> <tr> <td width="70" align="right"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_tongue; ?>: ';"><img src="tongue.gif" alt="<?php echo $smiley_tongue; ?>" width="15" height="15" border="0"></a></td> <td width="10" align="left"> </td> <td width="70" align="left"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_undecided; ?>: ';"><img src="undecided.gif" alt="<?php echo $smiley_undecided; ?>" width="15" height="15" border="0"></a></td> </tr> <tr> <td width="70" align="right"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_shocked; ?>: ';"><img src="shocked.gif" alt="<?php echo $smiley_shocked; ?>" width="15" height="15" border="0"></a></td> <td width="10" align="left"> </td> <td width="70" align="left"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_sad; ?>: ';"><img src="sad.gif" alt="<?php echo $smiley_sad; ?>" width="15" height="15" border="0"></a></td> </tr> </table> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_name; ?>:*</strong></td> <td width="10"> </td> <td width="150"><input name="name" type="text" id="name" value="<?php echo $elements[1]; ?>"></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_homepage; ?>:</strong></td> <td width="10"> </td> <td width="150"><input name="homepage" type="text" id="homepage" value="<?php echo $elements[2]; ?>"></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_email; ?>:</strong></td> <td width="10"> </td> <td width="150"><input name="email" type="text" id="email" value="<?php echo $elements[3]; ?>"></td> </tr> <tr> <td width="90" valign="top" bgcolor="#CCCCCC"> <strong><?php echo $label_comment; ?>:*</strong></td> <td width="10" valign="top"> </td> <td width="150"><textarea name="comment" id="comment"><?php echo $elements[4]; ?></textarea></td> </tr> <tr> <td width="90" valign="top" bgcolor="#CCCCCC"> <strong><?php echo $label_admin_comment; ?>:</strong></td> <td width="10"> </td> <td width="150"><textarea name="admincomment" id="admincomment"><?php echo $elements[5]; ?></textarea></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> </td> <td width="10"> </td> <td width="150"> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_admin_date; ?>:</strong></td> <td width="10"> </td> <td width="150"><input name="old_date" type="text" id="old_date" value="<?php echo $elements[0]; ?>"></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_admin_ip; ?>:</strong></td> <td width="10"> </td> <td width="150"><input name="ip" type="text" id="ip" value="<?php echo $elements[7]; ?>"></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_admin_browser; ?>:</strong></td> <td width="10"> </td> <td width="150"><input name="browser" type="text" id="browser" value="<?php echo $elements[6]; ?>"></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> </td> <td width="10"> </td> <td width="150"> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> </td> <td width="10"> </td> <td width="150"><input type="submit" name="Submit3" value="<?php echo $label_change; ?>"></td> </tr> </form> </table> <?php } else{ ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <form action="<?php echo $PHP_SELF; ?>?action=senddata" method="post"> <tr> <td width="90" bgcolor="#CCCCCC"> </td> <td width="10"> </td> <td width="150"><strong><?php echo $label_add_entry; ?>:</strong></td> <td width="150" rowspan="6" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0"> <tr align="center"> <td colspan="3"><strong><?php echo $label_smilies; ?>:</strong></td> </tr> <tr> <td width="70" align="right"> </td> <td width="10" align="left"> </td> <td width="70" align="left"> </td> </tr> <tr> <td width="70" align="right"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_smile; ?>: ';"><img src="smile.gif" alt="<?php echo $smiley_smile; ?>" width="15" height="15" border="0"></a></td> <td width="10" align="left"> </td> <td width="70" align="left"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_wink; ?>: ';"><img src="wink.gif" alt="<?php echo $smiley_wink; ?>" width="15" height="15" border="0"></a></td> </tr> <tr> <td width="70" align="right"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_grin; ?>: ';"><img src="grin.gif" alt="<?php echo $smiley_grin; ?>" width="15" height="15" border="0"></a></td> <td width="10" align="left"> </td> <td width="70" align="left"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_rolleyes; ?>: ';"><img src="rolleyes.gif" alt="<?php echo $smiley_rolleyes; ?>" width="15" height="15" border="0"></a></td> </tr> <tr> <td width="70" align="right"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_tongue; ?>: ';"><img src="tongue.gif" alt="<?php echo $smiley_tongue; ?>" width="15" height="15" border="0"></a></td> <td width="10" align="left"> </td> <td width="70" align="left"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_undecided; ?>: ';"><img src="undecided.gif" alt="<?php echo $smiley_undecided; ?>" width="15" height="15" border="0"></a></td> </tr> <tr> <td width="70" align="right"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_shocked; ?>: ';"><img src="shocked.gif" alt="<?php echo $smiley_shocked; ?>" width="15" height="15" border="0"></a></td> <td width="10" align="left"> </td> <td width="70" align="left"><a href='#' onClick="document.forms[0].comment.value += ':<?php echo $smiley_sad; ?>: ';"><img src="sad.gif" alt="<?php echo $smiley_sad; ?>" width="15" height="15" border="0"></a></td> </tr> </table> </td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_name; ?>:*</strong></td> <td width="10"> </td> <td width="150"><input name="name" type="text" id="name"></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_homepage; ?>:</strong></td> <td width="10"> </td> <td width="150"><input name="homepage" type="text" id="homepage"></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_email; ?>:</strong></td> <td width="10"> </td> <td width="150"><input name="email" type="text" id="email"></td> </tr> <tr> <td width="90" valign="top" bgcolor="#CCCCCC"> <strong><?php echo $label_comment; ?>:*</strong></td> <td width="10" valign="top"> </td> <td width="150"><textarea name="comment" id="comment"></textarea></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> </td> <td width="10"> </td> <td width="150"><input type="submit" name="Submit" value="<?php echo $label_send; ?>"></td> </tr> </form> </table> <?php } ?> </td> </tr> <tr> <td colspan="2"><hr width="400" color="#000000"></td> </tr> <?php $open = file($file); $count = count($open); if ($action != "senddata" && $action != "admin" && $action != "loginfailed" && $action != "sendchangedata" && $action != "deletedata"){ ?> <tr> <td height="40" colspan="2"><strong><?php echo $label_entries . ": " .$count; ?></strong></td> </tr> <tr> <?php } ?> <td colspan="2"> <?php if ($action == "senddata"){ ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_status; ?>:</strong></td> <td width="10"> </td> <td width="300"><?php if ($error != "1") echo "<a href=\"" . $PHP_SELF . "\">" . $label_status_ok . "</a>" ; else echo $label_status_notok; ?></td> </tr> </table> <?php } elseif ($action == "deletedata" && session_is_registered('loginok')){ $open = file($file); for ($i=0;$i<count($open);$i++){ if ($i != $id) $new .= $open[$i]; } $fp = fopen($file, "w+"); fwrite($fp, $new); fclose($fp); ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_status; ?>:</strong></td> <td width="10"> </td> <td width="300"><?php echo "<a href=\"" . $PHP_SELF . "\">" . $label_status_deleted . "</a>"; ?></td> </tr> </table> <?php } elseif ($action == "sendchangedata" && session_is_registered('loginok')){ ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_status; ?>:</strong></td> <td width="10"> </td> <td width="300"><?php if ($error != "1") echo "<a href=\"" . $PHP_SELF . "\">" . $label_status_ok . "</a>"; else echo $label_status_notok; ?></td> </tr> </table> <?php } elseif ($action == "admin"){ ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <form action="<?php echo $PHP_SELF; ?>?action=login" method="post"> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_passwort; ?>:</strong></td> <td width="10"> </td> <td width="300"><input name="pass" type="password" id="pass"></td> </tr> <tr> <td width="90" bgcolor="#CCCCCC"> </td> <td width="10"> </td> <td width="300"><input type="submit" name="Submit2" value="<?php echo $label_login; ?>"></td> </tr> </form> </table> <?php } elseif ($action == "loginfailed"){ ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" bgcolor="#CCCCCC"> <strong><?php echo $label_status; ?>:</strong></td> <td width="10"> </td> <td width="300"><?php echo $label_login_status_not_ok; ?></td> </tr> </table> <?php } else{ for ($i=$show;$i<$show+$show_results;$i++){ $elements = explode("|", $open[$i]); if ($open[$i] != ""){ ?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" height="35" valign="top" bgcolor="#CCCCCC"> <strong><?php echo $label_date; ?>:</strong> <?php echo substr($elements[0],9,8); ?><br> <strong><?php echo $label_time; ?>:</strong> <?php echo substr($elements[0],0,8); ?></td> <td width="10" valign="top"> </td> <td width="310" rowspan="2" valign="top"><strong><?php echo htmlspecialchars($elements[1]) . " " . $label_wrote; ?>:</strong> <?php if (session_is_registered('loginok')) echo "<a href=\"" . $PHP_SELF . " ?action=changedata&id=" . $i . "\"><strong>[" . $label_edit . "]</strong></a> <a href=\"" . $PHP_SELF . "?action=deletedata&id=" . $i . "\"><strong>[" . $label_delete . "]</strong></a>"; ?><br> <?php $elements[4] = htmlspecialchars($elements[4]); $elements[4] = str_replace(":" . $smiley_smile . ":", "<img src=\"smile.gif\">", $elements[4]); $elements[4] = str_replace(":" . $smiley_wink . ":", "<img src=\"wink.gif\">", $elements[4]); $elements[4] = str_replace(":" . $smiley_grin . ":", "<img src=\"grin.gif\">", $elements[4]); $elements[4] = str_replace(":" . $smiley_rolleyes . ":", "<img src=\"rolleyes.gif\">", $elements[4]); $elements[4] = str_replace(":" . $smiley_tongue . ":", "<img src=\"tongue.gif\">", $elements[4]); $elements[4] = str_replace(":" . $smiley_undecided . ":", "<img src=\"undecided.gif\">", $elements[4]); $elements[4] = str_replace(":" . $smiley_shocked . ":", "<img src=\"shocked.gif\">", $elements[4]); $elements[4] = str_replace(":" . $smiley_sad . ":", "<img src=\"sad.gif\">", $elements[4]); for ($b=0;$b<count($bad);$b++){ $length = strlen($bad[$b]); for ($a=0;$a<$length;$a++) $replace .= "*"; $elements[4] = eregi_replace($bad[$b], $replace, $elements[4]); $replace = ""; } echo $elements[4]; if ($elements[5] != "") echo "<br><br><i>" . $label_comment_by_admin . ":<br>" .$elements[5] . "</i>"; ?></td> </tr> <tr> <td width="90" align="center" valign="bottom" bgcolor="#CCCCCC"><img src="ip.gif" alt="<?php if ($elements[6] == "") echo $pic_ip_not_logged; else echo $pic_ip_logged; ?>"> <img src="br.gif" width="16" height="16" alt="<?php if ($elements[6] == "") echo $pic_browser; else echo $elements[6]; ?>"> <?php if ($elements[2] != "") echo"<a href=\"" . $elements[2] . "\" target=\"_blank\">";?><img src="hm.gif" alt="<?php if ($elements[2] == "") echo $pic_homepage; else echo $elements[2]; ?>" width="16" height="16" border="0"><?php if ($elements[2] != "") echo"</a>"; ?> <?php if ($elements[3] != "") echo"<a href=\"mailto:" . $elements[3] . "\">";?><img src="em.gif" width="16" height="16" alt="<?php if ($elements[3] == "") echo $pic_email; else echo $elements[3]; ?>" border="0"><?php if ($elements[2] != "") echo"</a>"; ?></td> <td width="10"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> <?php } } } ?> </td> </tr> <tr> <td colspan="2"><hr width="400" color="#000000"></td> </tr> <tr align="right"> <td colspan="2"> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50"><?php if (!session_is_registered('loginok')) echo "<a href=\"" . $PHP_SELF . "?action=admin\">" . $label_admin . "</a>"; else echo "<a href=\"" . $PHP_SELF . "?action=logout\">" . $label_logout . "</a>"; ?></td> <td width="350" align="right"> <?php $pages = ceil($count/$show_results); echo $label_to_page . " "; if ($pages == "0") $pages = "1"; for ($i=1;$i<=$pages;$i++){ echo "<a href=\"" . $PHP_SELF . "?show=" . $i . "\">" . $i . "</a> "; } ?> </td> </tr> </table> </td> </tr> </table> </body> </html> </pre> <!-- End of Content --> </TD> </TR> </TBODY> </TABLE> <TABLE WIDTH="900" BORDER="0" CELLSPACING="1" CELLPADDING="0" ALIGN="center"> <TR> <TD ALIGN="center" class="copyright">© 2004 <A CLASS="copyright" HREF="#" TARGET="_top">Petter :p</A> </TD> </TR> </TABLE> </BODY> </HTML> Endret 24. september 2004 av pavlion Lenke til kommentar
Loomy Skrevet 24. september 2004 Del Skrevet 24. september 2004 Nå begynner jeg snart å grine Det må ha vært minst 50 tråder den siste måneden om headers already sent-erroren. SØK! Lenke til kommentar
Lokaltog Skrevet 24. september 2004 Del Skrevet 24. september 2004 (endret) http://forum.hardware.no/index.php?showtop...dpost&p=2844642 Edit: tror du forresten at noen i hele verden GIDDER å feilsøke de ca. 1000 linjene med kode for deg uten å få betalt en krone? Hvor naiv er det mulig å bli... Endret 24. september 2004 av lokaltog Lenke til kommentar
Anbefalte innlegg
Opprett en konto eller logg inn for å kommentere
Du må være et medlem for å kunne skrive en kommentar
Opprett konto
Det er enkelt å melde seg inn for å starte en ny konto!
Start en kontoLogg inn
Har du allerede en konto? Logg inn her.
Logg inn nå