= 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) > 70) { $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") { // 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']) ) ); // 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 { echo ""; echo "There was an error processing your submission. It has been automatically e-mailed to the developers, who will process the note manually.
"; } } // 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.
'; } // Provide a backlink for the page the user is coming from echo 'You can go back from whence you came.
'; // 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 can contribute your notes to the PHP manual from the comfort of your browser! Just add your comment in the big field below, and, optionally, your email address or name in the little one. After submission, your note will appear under the documentation as a part of the manual.
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!)
Please read the following points carefully before submitting your comment. If your post falls into one of the categories mentioned there, it will be rejected by one of the editors.
Just to make the point once more. The notes are being edited and support questions/bug reports/feature request/comments on lack of documentation, are being deleted from them (and you may get a rejection email), so if you post a question/bug/feature/complaint, it will be removed. (But once you get an answer/bug solution/function documentation, feel free to come back and add it here!)
(And if you're posting an example of validating email addresses, please don't bother. Your example is almost certainly wrong for some small subset of cases. See this information from O'Reilly Mastering Regular Expressions book for the gory details.)
Please note that periodically, the developers may go through the notes and incorporate the information in them into the documentation. This means that any note submitted here becomes the property of the PHP Documentation Group.
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 {?>