raaaaaar!
By: raaaaaar! | Date: Jun 10 2010 12:20 | Format: PHP | Expires: never | Size: 15.02 KB | Hits: 3897
- //=============================================================================================
- // myPHPscripts Guestbook is Copyright ©2007, Scott J. LeCompte
- // Web Site: http://www.myphpscripts.net/scripts.php
- //
- // myPHPscripts Guestbook V1.3
- // By PhpScripts.net
- //
- // May be used free of charge. There is no copyright. Feel free to edit.
- // Need help with installation or customization? Visit:
- // http://www.myphpscripts.net
- //=============================================================================================
- //====================================== User Variables =======================================
- //=============================================================================================
- // Admin login
- $admin = 'admin';
- // Admin password
- $password = 'Karen123!';
- // Path to your guestbook installation
- $script_path = '/HTML/guestbook/';
- // URL to your homepage
- $home = ' http://www.rijopleidingdassen.nl/';
- // Number of guestbook entries to display per page
- $limit = 10;
- // Page background color
- $bg = '#CECECE';
- // Page text color
- $text = '#000000';
- // Link color
- $link = '#000000';
- // Link hover color
- $hover = '#F00000';
- // Table header background color
- $th_bg = '#000000';
- // Table header text color
- $th_txt = '#FFFFFF';
- // Top cell background color
- $bg1 = '#DBDBDB';
- // Alternating cell background color #1
- $bg2 = '#FFFFFF';
- // Alternating cell background color #2
- $bg3 = '#C0C0C0';
- //=============================================================================================
- //====================================== Do Not Edit =========================================
- //=============================================================================================
- ?>
- <style type="text/css">
- body {
- background-color: <? echo $bg; ?>;;
- color: <? echo $text; ?>;
- background-image: url(/Pictures/backgroundblue.jpg);
- }
- a {
- font-family: arial;
- font-size: 12px;
- font-weight: normal;
- text-decoration: underline;
- color: <? echo $link; ?>;
- }
- a:hover {
- font-family: arial;
- font-size: 12px;
- font-weight: none;
- text-decoration: underline;
- color: <? echo $hover; ?>;
- }
- .tekst {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- }
- .tekst {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- }
- </style>
- <?
- $file = '/var/www/g31529/rijopleidingdassen.nl/guestbook/entries/entries.txt';
- $_SESSION['show_admin'] = true;
- echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['HTTP_REFERER'] . '">';
- }
- }
- echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['HTTP_REFERER'] . '">';
- }
- }
- if ($_REQUEST['name'] == $admin && $_REQUEST['pass'] == $password) {
- $_SESSION['guestbook_admin'] = $admin;
- echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['HTTP_REFERER'] . '">';
- }
- else {
- echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['HTTP_REFERER'] . '">';
- }
- }
- }
- $key = $_REQUEST['entry'];
- foreach($fc as $line) {
- }
- }
- echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['HTTP_REFERER'] . '">';
- }
- $_SESSION['referrer'] = $_SERVER['HTTP_REFERER'];
- ?>
- <script language="javascript" type="text/javascript">
- function rand(n) {
- return (Math.floor(Math.random()*n+1));
- }
- function newcode() {
- var sec;
- sec = document.getElementById("img");
- if (sec)
- sec.setAttribute("src",sec.src+rand(9));
- }
- // -->
- </script>
- <title>Rijopleiding Dassen: Gastenboek</title><div>
- <center>
- <table style="border:1px solid #000000; border-collapse:collapse; background-color:<? echo $bg1; ?>;font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; font-size:12px;">
- <tr>
- <th style="background-color:<? echo $th_bg; ?>;color:<? echo $th_txt; ?>;">New Message</th>
- </tr>
- <tr>
- <td style="text-align:left;padding:0px 10px 0px 10px;">
- <form action="<? echo $_PHP['SELF']; ?>" method="post">
- <p>
- <? $userip = $_SERVER['REMOTE_ADDR']; echo '<input type="hidden" name="ip" value="' . $userip . '">'; ?>
- <br>
- <span class="tekst">Name:</span><br>
- <input type="text" name="name" size="40"><br>
- Message:<br>
- <textarea name="comment" rows="10" cols="40"></textarea>
- <br>
- Security Code:<br>
- <img src="txt2png.php?" name="img" id="img" alt="Security Code" title="Security Code"></p>
- <p><br>
- Type the Code:<br>
- <input id="security_code" name="security_code" type="text">
- <input type="submit" name="add_msg" value="Send">
- <input type="reset" value="Clear">
- </p>
- </form>
- </td>
- </tr>
- <tr>
- <td align="center">
- <br><a href="" onclick="newcode(); return false;">Click Here</a> for a new code.<br><br>
- </td>
- </tr>
- </table>
- </center>
- </div>
- <?
- echo '</body>';
- echo '</html>';
- }
- else if (isset($_REQUEST['add_msg']) && ($_REQUEST['add_msg'] == 'Send' || $_REQUEST['add_msg'] == 'new')) {
- $comment = stripslashes(str_replace(array("<",">","n"), array("<",">","<br>"), $_REQUEST['comment']));
- if ($_REQUEST['add_msg'] == 'new') {
- $error = '';
- }
- $error = '<b><font color="#F000000">Error: </font></b>Wrong security code!';
- }
- $error = '<b><font color="#F000000">Error: </font>M</b>Name not entered.';
- }
- $error = '<b><font color="#F000000">Error: </font></b>Date not set.';
- }
- $error = '<b><font color="#F000000">Error: </font></b>IP not set.';
- }
- $error = '<b><font color="#F000000">Error: </font></b>No Comment entered.';
- }
- else {
- $error = '<b><font color="#0000000">Success: </font></b>Your message has been posted.';
- $new_line = "$id|$date|$name|$ip|$commentn";
- echo '<meta http-equiv="refresh" content="2;url=' . $_SESSION['referrer'] . '">';
- }
- }
- ?>
- <div>
- <center>
- <table style="width:600px;padding:0px;border-collapse:collapse;font-size:12px;font-family:arial;">
- <tr>
- <td style="padding:0px 0px 10px 10px;text-align:left;width:200px;">
- <?
- if ($_GET['pg'] >= 1 && $pages != 0) {
- if ($_GET['pg'] == 1) {
- echo '[ ';
- }
- else {
- echo '[ <a href="' . $_PHP['SELF'] . '?pg=' . ($_GET['pg'] - 1) . '">...</a> | ';
- }
- }
- $p = 1;
- while ($p <= $pages) {
- if ($_GET['pg'] == $p ) {
- if ($p == $pages) {
- echo '<b>' . $p . '</b>';
- }
- else {
- echo '<b>' . $p . '</b> | ';
- }
- }
- else if ($_GET['pg'] <= 2) {
- if ($p <= 5) {
- if ($p < 5) {
- if ($pages <= 5 && $_GET['pg'] >= 1) {
- if ($p == $pages) {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a>';
- }
- else {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a> | ';
- }
- }
- else if ($pages > 5 && $_GET['pg'] >= 1) {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a> | ';
- }
- }
- else {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a>';
- }
- }
- }
- else if ($_GET['pg'] == $pages) {
- if ($p >= $_GET['pg'] - 4) {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a> | ';
- }
- }
- else if ($_GET['pg'] + 1 == $pages) {
- if ($p == $_GET['pg'] + 1) {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a>';
- }
- else if ($p >= $_GET['pg'] - 3 && $p <= $_GET['pg'] + 3) {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a> | ';
- }
- }
- else if (($p <= $_GET['pg'] + 2) && ($p >= $_GET['pg'] - 2)) {
- if ($p == $pages) {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a>';
- }
- else if ($p == $_GET['pg'] + 2) {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a>';
- }
- else {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a> | ';
- }
- }
- }
- else {
- if ($p <= 5) {
- if ($p == 1 && $pages > 1) {
- echo '[ <b>' . $p . '</b> | ';
- }
- else if ($p == 1 && $pages == 1) {
- echo '[ <b>' . $p . '</b>';
- }
- else if ($p < 5 && $pages > 1) {
- if ($p == $pages) {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a>';
- }
- else {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a> | ';
- }
- }
- else {
- echo '<a href="' . $_PHP['SELF'] . '?pg=' . $p . '">' . $p . '</a>';
- }
- }
- }
- $p++;
- }
- if ($pages < 2) {
- echo ' ]';
- }
- echo ' | <a href="' . $_PHP['SELF'] . '?pg=2">...</a> ]';
- }
- else if ($_GET['pg'] == $pages) {
- echo ' ]';
- }
- else {
- echo ' | <a href="' . $_PHP['SELF'] . '?pg=' . ($_GET['pg'] + 1) . '">...</a> ]';
- }
- }
- ?>
- </td>
- <td style="padding:0px 0px 10px 0px;text-align:center;width:250px;"><? echo $error; ?></td>
- <td style="padding:0px 10px 10px 10px;text-align:right;width:300px;">[ <a href="<? echo $home; ?>">Back to Homepage</a> ] [ <a href="<? echo $_PHP['SELF']; ?>?add_msg">Add a message</a> ]</td>
- </tr>
- </table>
- </center>
- </div>
- <div>
- <center>
- <table style="border:1px solid black;width:600px;padding:0px;border-collapse:collapse;font-size:12px;font-family:arial;">
- <tr>
- <th width="171" style="background:#000000; color:#FFFFFF; height:20px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;">Poster</th>
- <th width="417" style="background-color:<? echo $th_bg; ?>;color:<? echo $th_txt; ?>; height:20px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;">Message</th>
- </tr>
- <?
- $start = $limit * ($_GET['pg'] - 1);
- }
- else {
- $start = 0;
- }
- if ($entries) {
- $i = 0;
- $j = 0;
- if ($bg == $bg1) { $bg = $bg2; }
- else { $bg = $bg1; }
- if ($i < $num_lines && $i >= $start && $j < $limit) {
- ?>
- <tr style="background-color:<? echo $bg; ?>;">
- <td style="background-color:<? echo $bg3; ?>;height:20px;border-top:1px solid #000000;border-bottom:1px solid #000000;padding:0px 10px 0px 10px;text-align:left;vertical-align:middle">
- <? echo '<b>Posted on</b> ' . $array[1]; ?>
- </td>
- <td style="background-color:<? echo $bg3; ?>;height:20px;border-top:1px solid #000000;border-bottom:1px solid #000000;padding:0px 10px 0px 10px;text-align:right;vertical-align:middle">
- <? if (isset($_SESSION['guestbook_admin'])) { echo '<a href="' . $_PHP['SELF'] . '?action=delete&entry=' . $array[0] . '" onclick="return confirm('Are you sure you want to delete this message?')">Delete</a>'; } ?>
- </td>
- </tr>
- <tr style="background-color:<? echo $bg; ?>;">
- <td style="border-right:1px solid #000000;width:150px;padding:10px;text-align:left;vertical-align:top">
- <? echo '<b>Name:</b> ' . $array[2] . '<br>'; ?></td>
- <td style="padding:10px;text-align:left;vertical-align:top">
- <? echo $array[6] . '<br>'; ?>
- </td>
- </tr>
- <?
- $j++;
- }
- $i++;
- }
- }
- ?>
- </table>
- <table style="width:600px;padding:0px;border-collapse:collapse;font-size:12px;font-family:arial;text-align:right;">
- <tr>
- <td style="text-align:right;padding:10px 10px 0px 0px;">
- <?
- ?>
- [ <a href="<? echo $_PHP['SELF'] . '?show_admin' ?>">Admin</a> ]
- <?
- }
- ?>
- <table style="width:100%;">
- <tr>
- <td style="font-family:arial;font-size:12px;height:12px;text-align:right">
- <form action="<? echo $_PHP['SELF']; ?>" method="post">
- Name:
- <input type="text" name="name" size="15"><br>
- <span class="tekst">Pass</span>:
- <input type="password" name="pass" size="15"><br>
- <input type="submit" name="admin_login" value="Login">
- </form>
- </td>
- </tr>
- </table>
- <?
- }
- else {
- ?>
- <table style="width:100%;">
- <tr>
- <td style="font-family:arial;font-size:12px;height:12px;text-align:right">
- Logged in as <? echo $_SESSION['guestbook_admin'] . ' - [ <a href="' . $_PHP['SELF'] . '?logout">Logout</a> ]'; ?>
- </td>
- </tr>
- </table>
- <? } ?>
- </td>
- </tr>
- <tr>
- <td style="text-align:center;font-family:arial;font-size:12px;color:<?php echo $text; ?>"> </td>
- </tr>
- </table>
- </center>
- </div>
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago