here are the lins in the code!Notice: Undefined index: do_what in D:\webb\crookz\guestbook\sign.php on line 8
Notice: Undefined index: action in D:\webb\crookz\guestbook\sign.php on line 33
Code: Select all
<?php
global $nickname;
global $homepage;
include ("header.php");
include ("guest.config.php");
line 8-->
if ($_POSTї'do_what']=="Submit") {
if ($_POSTї'message']!="") {
$nickname = addslashes($_POSTї'nickname']);
$real_name = addslashes($_POSTї'name']);
$email = addslashes($_POSTї'email']);
$homepage = addslashes($_POSTї'homepage']);
$message = addslashes($_POSTї'message']);
$sql = "insert into $guest_tblname (nickname, real_name, email, homepage, message, date_added) values ('$nickname', '$real_name', '$email', '$homepage', '$message', NOW())";
if ($add_message = mysql_query($sql)) {
echo "<h3>Sign Guestbook - Success</h3>";
echo "<p>Your e-card message has been succesfully added. Please <a href="index.php">click here</a> to view the card messages with your new entry.</p>";
} else {
echo "<h3>Sign Tommy's E-Card - ERROR</h3>";
echo "<p>An error has occurred - mySQL said:</p>";
echo mysql_error();
}
} else {
echo "<p><b>ERROR: Your entry was not submitted - you did not enter a message. </b> Please go back and enter a message.";
}
} else {
line 33-->
if ($_POSTї'action']=="preview") {
?>
<link rel="stylesheet" href="../css/tabel.css" type="text/css">
<link rel="stylesheet" href="../css/body.css" type="text/css">
<link rel="stylesheet" href="../css/link.css" type="text/css">
<body bgcolor="#CCCCCC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<?php
echo "\n\n<table cellspacing="1" cellpadding="3" border="0" width="100%" class="bkgrnd"><tr>\n<td class="postbkgrnd"><p class="heading"><b>From: </b>";
if (($_POSTї'nickname']=="") && ($_POSTї'name']=="")) {
$nickname = "Anonymous";
} else {
$nickname = $_POSTї'nickname'];
}
if ($_POSTї'email']!="") {
echo " <a href="mailto:".$_POSTї'email']."">".$_POSTї'nickname']."</a>";
} else {
echo $nickname;
}
if ($_POSTї'name']!="") {
echo " (".$_POSTї'name'].")";
}
if ($_POSTї'homepage']!="") {
$good_url = strpos($_POSTї'homepage'], "http://");
if ($good_url === false) {
$homepage = "http://".$_POSTї'homepage'];
} else {
$homepage = $_POSTї'homepage'];
}
echo "<br><b>Homepage:</b> <a href="".$homepage."" target="_new">$homepage</a>";
}
$msg_message = stripslashes(nl2br(htmlspecialchars($_POSTї'message'])));
if ($use_auto_smilies=="1") {
$msg_message = eregi_replace(":\)", "<IMG SRC="smilies/smile1.gif" WIDTH=15 HEIGHT=15 ALT=":)">", $msg_message);
$msg_message = eregi_replace(":-\)", "<IMG SRC="smilies/smile1.gif" WIDTH=15 HEIGHT=15 ALT=":-)">", $msg_message);
$msg_message = eregi_replace(":D", "<IMG SRC="smilies/smile2.gif" WIDTH=15 HEIGHT=15 ALT=":D">", $msg_message);
$msg_message = eregi_replace(":-D", "<IMG SRC="smilies/smile2.gif" WIDTH=15 HEIGHT=15 ALT=":-D">", $msg_message);
$msg_message = eregi_replace(":o", "<IMG SRC="smilies/smile3.gif" WIDTH=15 HEIGHT=15 ALT=":o">", $msg_message);
$msg_message = eregi_replace(":-o", "<IMG SRC="smilies/smile3.gif" WIDTH=15 HEIGHT=15 ALT=":-o">", $msg_message);
$msg_message = eregi_replace(":\(", "<IMG SRC="smilies/smile4.gif" WIDTH=15 HEIGHT=15 ALT=":(">", $msg_message);
$msg_message = eregi_replace(":-\(", "<IMG SRC="smilies/smile4.gif" WIDTH=15 HEIGHT=15 ALT=":-(">", $msg_message);
$msg_message = eregi_replace(";)", "<IMG SRC="smilies/smile5.gif" WIDTH=15 HEIGHT=15 ALT=";)">", $msg_message);
$msg_message = eregi_replace(";-)", "<IMG SRC="smilies/smile5.gif" WIDTH=15 HEIGHT=15 ALT=";)">", $msg_message);
$msg_message = eregi_replace(":p", "<IMG SRC="smilies/smile6.gif" WIDTH=15 HEIGHT=15 ALT=":p">", $msg_message);
$msg_message = eregi_replace(":-p", "<IMG SRC="smilies/smile6.gif" WIDTH=15 HEIGHT=15 ALT=":p">", $msg_message);
$msg_message = eregi_replace("8)", "<IMG SRC="smilies/smile7.gif" WIDTH=15 HEIGHT=15 ALT="8)">", $msg_message);
$msg_message = eregi_replace("8-)", "<IMG SRC="smilies/smile7.gif" WIDTH=15 HEIGHT=15 ALT="8)">", $msg_message);
$msg_message = eregi_replace(":\?", "<IMG SRC="smilies/smile8.gif" WIDTH=15 HEIGHT=22 ALT=":?">", $msg_message);
$msg_message = eregi_replace(":-\?", "<IMG SRC="smilies/smile8.gif" WIDTH=15 HEIGHT=22 ALT=":?">", $msg_message);
$msg_message = eregi_replace(":\^\)", "<IMG SRC="smilies/smile9.gif" WIDTH=15 HEIGHT=15 ALT=":\^\)">", $msg_message);
}
echo "</p></td></tr><tr><td class="postheader"><p>".$msg_message."</p></td></tr></table>\n\n\n\n<br>";
} else {
?>
<h3>give crOOkz a word..</h3>
<table width="100%" border="0">
<tr>
<td>
<p>Fill in the form below to add your message to the <b><a href="index.php">guestbook</a></b>.
Be SURE to read the stuff below first though!</p>
</td>
</tr>
</table>
<table width="100%" class="postbkgrnd">
<tr>
<td><p><b>HTML is not allowed </b>- it will be printed out in your message, which looks REALLY dumb. Don't say I didn't warn you, and don't ask me to edit your message later if you didn't listen the first time. </p>
</td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td>
<p>Also remember that <b>all fields (except the message itself) are optional</b>.
If you enter an e-mail address, it will be visible to anyone visiting
the board. If there are any fields you do not wish to fill out (or that
do not apply, such as homepage), simply leave them blank.</p>
<p>Now then... that said, get to it!</p>
</td>
</tr>
</table>
<p> </p>
<?php
}
?>
<form method=post action="sign.php">
<table width="100">
<tr>
<td><b>Nickname:</b></td>
<td><input type="text" name="nickname" value="<?= stripslashes(htmlspecialchars($nickname)) ?>" maxlength="100"></td>
</tr>
<tr>
<td><b>Real Name:</b></td>
<td><input type="text" name="name" value="<?= stripslashes(htmlspecialchars($_POSTї'name'])) ?>" maxlength="100"></td>
</tr>
<tr>
<td><b>E-Mail:</b></td>
<td><input type="text" name="email" value="<?= stripslashes(htmlspecialchars($_POSTї'email'])) ?>" maxlength="60"></td>
</tr>
<tr>
<td><b>Homepage:</b></td>
<td><input type="text" name="homepage" value="<?= stripslashes(htmlspecialchars($homepage)) ?>" maxlength="250"></td>
</tr>
<tr>
<td><b>*Message:</b></td>
<td><textarea name="message" rows="10" cols="20"><?= stripslashes(htmlspecialchars($_POSTї'message'])) ?></textarea>
<br>
<?php
if ($_POSTї'action']!="preview") {
echo "<input type="hidden" name="action" value="preview">";
echo "<input type="submit" name="do_what" value="Preview">";
} elseif (($_POSTї'action']=="preview") || ($_POSTї'do_what']=="Preview Again") || ($_POSTї'do_what']=="Preview+Again")){
//if (($do_what=="Preview Again") || ($do_what=="Preview+Again")) {
echo "<input type="hidden" name="action" value="preview">";
echo "<input type="submit" name="do_what"value="Preview Again"> ";
echo "<input type="submit" name="do_what"value="Submit">";
//}
}
?>
</td>
</tr>
</table>
</form>
<?php
}
include ("footer.php");
?>