cvs: phpweb /manual add-note.php

From: Date: Mon, 26 Feb 2001 22:55:47 +0000
Subject: cvs: phpweb /manual add-note.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-4048@lists.php.net to get a copy of this message
jimw Mon Feb 26 14:55:47 2001 EDT Modified files: /phpweb/manual add-note.php Log: just cleaning up whitespace Index: phpweb/manual/add-note.php diff -u phpweb/manual/add-note.php:1.12 phpweb/manual/add-note.php:1.13 --- phpweb/manual/add-note.php:1.12 Sun Sep 10 23:51:52 2000 +++ phpweb/manual/add-note.php Mon Feb 26 14:55:47 2001 @@ -17,9 +17,9 @@ */ - require("shared.inc"); - $DISABLE_KICKOUTS=1; - commonHeader("Manual Notes"); +require("shared.inc"); +$DISABLE_KICKOUTS=1; +commonHeader("Manual Notes"); /* clean off leading and trailing whitespace */ $user = trim($user); @@ -29,52 +29,50 @@ on notes */ if ($user == "") { $user = "php-general@lists.php.net"; - } +} if ($note == "") { unset ($note); - } +} # turn the POST data into GET data so we can do the redirect if(!strstr($MYSITE,"www.php.net")) { Header("Location: http://www.php.net/manual/add-note.php?sect=".urlencode($sect)."&lang=".urlencode($lang)."&redirect=".urlencode($redirect)); } - mysql_pconnect("localhost","nobody", ""); - mysql_select_db("php3"); +mysql_pconnect("localhost","nobody", ""); +mysql_select_db("php3"); - if (isset($note)): - $now = date("Y-m-d H:i:s"); - $query = "INSERT INTO note (user, note, sect, ts, lang) VALUES "; - # protect all HTML-like stuff (may be "Joe Blow <joe@blow.com>") - $query .= "('" . htmlspecialchars($user) . "',"; - # only protect PHP-code start tags. - $query .= "'" . ereg_replace("<\\?", "&lt;?", $note) . "',"; - # or we could protect all HTML - #$query .= "'" . htmlspecialchars(nl2br($note)) . "',"; - $query .= "'" . $sect . "',"; - $query .= "'" . $now . "',"; - $query .= "'" . $lang . "')"; - //echo "<!--$query-->\n"; - if (mysql_query($query)):?> +if (isset($note)): + $now = date("Y-m-d H:i:s"); + $query = "INSERT INTO note (user, note, sect, ts, lang) VALUES "; + # protect all HTML-like stuff (may be "Joe Blow <joe@blow.com>") + $query .= "('" . htmlspecialchars($user) . "',"; + # only protect PHP-code start tags. + $query .= "'" . ereg_replace("<\\?", "&lt;?", $note) . "',"; + # or we could protect all HTML + #$query .= "'" . htmlspecialchars($note) . "',"; + $query .= "'$sect','$now',$lang')"; + //echo "<!--$query-->\n"; + if (mysql_query($query)):?> <P>Your submission was successful -- thanks for contributing! -<? $new_id = mysql_insert_id(); - $msg = stripslashes($note); - $msg .= "\n\n $redirect \n"; - mail("php-notes@lists.php.net","note $new_id added to $sect",$msg,"From: $user"); - else: - // mail it. - mail($mailto, "failed manual note query", $query); +<? $new_id = mysql_insert_id(); + $msg = stripslashes($note); + $msg .= "\n\n $redirect \n"; + mail("php-notes@lists.php.net","note $new_id added to $sect",$msg,"From: $user"); + else: + // mail it. + mail($mailto, "failed manual note query", $query); ?> <P>There was an error processing your submission. It has been automatically e-mailed to the developers. -<? endif;?> +<? endif;?> <P>You can <A href="<?echo $redirect?>">go back</A> from whence you came, or you can <A href="http://www.php.net/manual/">browse the manual with the on-line notes</A>. -<? else:?> +<?else:?> <P>You can contribute to the PHP manual from the comfort of your browser! Just add your comment in the big field below (and your email address in the @@ -92,20 +90,21 @@ are being edited and support questions are being <b>deleted</b> from them, so if you post a question, it will be removed. (But once you get an answer, feel free to come back and add it here!) -<P> -<A href="/support.php">Click here to go to the support pages.</A><BR> -<A href="http://bugs.php.net">Click here to submit a bug report.</A><BR> -<A href="http://bugs.php.net">Click here to request a feature.</A> +<p> +<a href="/support.php">Click here to go to the support pages.</a><br> +<a href="http://bugs.php.net/">Click here to submit a bug report.</a><br> +<a href="http://bugs.php.net/">Click here to request a feature.</a> +</p> -<?if (!isset($sect)):?> +<? if (!isset($sect)):?> <p><b>To add a note, you must click on the 'Add Note' button -on the bottom of a manual page so we know where to add the note!</b> -<?else:?> -<FORM method="POST" action="/manual/add-note.php"> -<INPUT type=hidden name="sect" value="<?echo $sect;?>"> -<INPUT type=hidden name="redirect" value="<?echo $redirect;?>"> -<INPUT type=hidden name="lang" value="<?echo $lang;?>"> -<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#D0D0D0"> +on the bottom of a manual page so we know where to add the note!</b></p> +<? else:?> +<form method="POST" action="/manual/add-note.php"> +<input type="hidden" name="sect" value="<?echo $sect;?>"> +<input type="hidden" name="redirect" value="<?echo $redirect;?>"> +<input type="hidden" name="lang" value="<?echo $lang;?>"> +<table border="0" cellpadding="5" cellspacing="0" bgcolor="#d0d0d0"> <TR VALIGN=top> <TD><B>Your email address:</B></TD> <TD><INPUT type=text name="user" size=40></TD> @@ -121,7 +120,7 @@ </TD></TR> </TABLE> </FORM> -<?endif; - endif; - commonFooter(); +<? endif; +endif; +commonFooter(); ?>

« previous php.mirrors (#4048) next »