= 4096) { $error = "Your note is too long. You'll have to make it shorter before you can post it. Keep in mind that this is not the place for long code examples!"; } // Check if the note is not too short elseif (strlen($note) < 32) { $error = "Your note is too short. Trying to test the notes system? Save us the trouble of deleting your test, and don't. It works."; } // Chek if any line is too long else { // Split the note by whitespace, and check length foreach (preg_split("/\\s+/", $note) as $chunk) { if (strlen($chunk) > 120) { $error = "Your note contains a bit of text that will result in a line that is too long, even after using wordwrap()."; break; } } } // No error was found, and the submit action is required if (!$error && strtolower($_POST['action']) != "preview") { $redirip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : (isset($_SERVER['HTTP_VIA']) ? $_SERVER['HTTP_VIA'] : ''); // Post the variables to the central user note script // ($MQ is defined in prepend.inc) $result = posttohost( "http://master.php.net/entry/user-note.php", array( 'user' => ($MQ ? stripslashes($user) : $user), 'note' => ($MQ ? stripslashes($note) : $note), 'sect' => ($MQ ? stripslashes($_POST['sect']) : $_POST['sect']), 'ip' => $_SERVER['REMOTE_ADDR'], 'redirip' => $redirip ) ); // If there is any non-header result, then it is an error if ($result) { if (strpos($result, '[TOO MANY NOTES]') !== FALSE) { print "
As a security precaution, we only allow a certain number of notes to be submitted per minute. At this time, this number has been exceeded. Please re-submit your note in about a minute.
"; } else if (($pos = strpos($result, '[SPAMMER]')) !== FALSE) { $ip = trim(substr($result, $pos+9)); $spam_url = $ip_spam_lookup_url . $ip; print 'Your IP is listed in one of the spammers lists we use, which aren\'t controlled by us. More information is available at '.$spam_url.'.
'; } else if (strpos($result, '[SPAM WORD]') !== FALSE) { echo 'Your note contains a prohibited (usually SPAM) word. Please remove it and try again.
'; } else if (strpos($result, '[CLOSED]') !== FALSE) { echo 'Due to some technical problems this service isn\'t currently working. Please try again later. Sorry for any inconvenience.
'; } else { echo ""; echo "There was an internal error processing your submission. Please try to submit again later.
"; } } // There was no error returned else { echo 'Your submission was successful -- thanks for contributing! Note ', 'that it will not show up for up to a few hours on some of the mirrors, but it will find its way to all of ', 'our mirrors in due time.
'; } // Print out common footer, and end page site_footer(); exit(); } // There was an error, or a preview is needed else { // If there was an error, print out if ($error) { echo "$error
\n"; } // Print out preview of note echo 'This is what your entry will look like, roughly:
'; echo '

You may contribute notes to the PHP manual by adding comments in the form below, and, optionally your email address and/or name. And the note will appear under the documentation as a part of the manual after about an hour.
There is no need to obfuscate your email address, as we have a simple conversion in place to convert the @ signs and dots in your address. You may still want to include a part in the email address only understandable by humans, to make it spam protected, as our conversion can be performed the other way too. You may submit your email address as user@NOSPAM.example.com for example (which will be displayed as user at NOSPAM dot example dot com. Although note that we can only inform you of the removal of your note, if you use your real email address.
Note that HTML tags are not allowed in the posts, but the note formatting is preserved. URLs will be turned into clickable links, PHP code blocks enclosed in the PHP tags <?php and ?> will be source highlighted automatically. So always enclose PHP snippets in these tags. (Double-check that your note appears as you want during the preview. That's why it is there!)
The SPAM challenge requires numbers to written out in English, so, an appropriate answer may be nine but not 9.
User notes may be edited or deleted, and usually a note is deleted because of the following reasons:
Please note that periodically the developers go through the notes and may incorporate information from them into the documentation. This means that any note submitted here becomes the property of the PHP Documentation Group and will be available under the same license as the documentation.
Your IP Address will be logged with the submitted note and made public on the PHP manual user notes mailing list. The IP address is logged as part of the notes moderation process, and won't be shown within the PHP manual itself.
To add a note, you must click on the "Add Note" button (the plus sign) ', 'on the bottom of a manual page so we know where to add the note!'; } // Everything is in place, so we can display the form else {?>