Algorithms Arrays Passwords Uncategorized
Commerce Uncategorized
Databases Abstraction Layers Informix LDAP MS SQL MySQL ODBC PostgreSQL Uncategorized
Date & Time Calculators Conversion Translation Uncategorized
Discussion Chat Forums Guestbooks Polls Uncategorized
Email Validation Uncategorized
External Uncategorized
Files and Directories Uncategorized
Games Uncategorized
Graphics 3-D Graphs Resizing Thumbnails Uncategorized
HTML Forms Menus & Navigation Source Viewers Tables Templates Uncategorized
HTTP Authentication Cookies File Uploading Uncategorized
I18N Uncategorized
Math Uncategorized
Miscellaneous Uncategorized
Searching and Trees Uncategorized
Security Uncategorized
Text Uncategorized
Utilities Calendars Counters Link Checkers Weather Uncategorized
XML Uncategorized
| php sample source codes |
|---|
|
If you make form with birtdate-field or any other date-fields then this simple script may be can help.
|
|
takes a multidimensional array and puts all the elements into HTML hidden input types so data can be carried through to another page
|
|
Using this quick snippet you can auto fill your drop down boxes easily using microsoft access.
|
|
I was seeking a simple way to refresh my selections and checkboxes. I figured out a way to handle it quite easily using a combination of php and javascript. Hopefully it will help you. There are lots of applications around; shops, mailform, etc.
|
|
This is a simple function which can be used when you have a form for your users to post their message and you want to censor every badwords that they might write on that form.
|
|
Paranoia was designed to check the validity of the parameters that a php page will receive after a form submision. It can be used to check the variables sent by POST or GET
|
|
This function allows you to pass in:
<ul>
<li>name
<li>table
<li>SQL statement
<li>id
</ul>
to generate a select box dynamically. Optionally you can pass in an <b>$id</b> to have it create a select box with a specific value set as "selected".
|
|
This function will read a directory and put the result into a listbox.
So you can choose a file from that listbox.
|
|
list your database to drop down menu
|
|
This function updates the second box, depending on the selection of first box.
Adapted from code by Leon Atkinson.
|
|
This function is great for when you have a multi-page form such as an application. This function forwards fields on one page to hidden fields on the next page, and so on. Very simple to call. The beauty of it is, it also will handle arrays with multiple dimensions.
If you have a field with the same name on the next form, it's a good rule to call field_forwarder() at the BEGINNING of your form so that when that form is passed, the field (with the same name) will overwrite the previous form. It's also good to put field_forwarder() at the top so the final page will have all the fields in the order of the application.
This is a recursive function, i.e. it re-calls itself when it encounters form elements that are arrays such as:
Finally, if you wish to print out PHP code of the array instead of hidden fields, add this line right before you call field_forwarder():
$FFoutputType = 'print';
and it will print out, in text form, the values of the fields as php variables -- this is great for storing php code in a database.
|
|
Form generator which waits for an array and gives back a full input form.
It can process the data (insert, update, delete)
Now supports file upload and styles
|
|
A complete formfield function minus listbox function, you can make textbox, radio button, checkbox, textarea, button and form opening function.<p>
You can obtain listbox function from my previous posting <br>( <b><a href="http://www.zend.com/codex.php?id=525&single=1">another date drop-down-menu </a> </b> and <b> <a href="http://www.zend.com/codex.php?id=540&single=1">make listbox from array or database-table </a></b>)
|
|
Over the summer I wrote a utility class to make it easy to pull information from HTML forms and place into databases and do various manipulations on arrays without having to write much special code for each case. I have used this class library from everything from a member management database to secure credit card updating utility.
Key features:
1. Return array data where field keys match a certain prefix such as CUSTOMER_, CREDITCARD_ (even from HTTP_POST_VARS).
2. Create MySQL Insert, Update, and basic Create Table statements from associative array data.
Note: There is a lot of code here and it is very useful. The documentation could definitely be better, but I do not have enough time to document this as well as I would a commercial product for the time being. The code is intended to be readable and each function should have a JavaDoc like header. I welcome comments and/or additions to this library class.
|
|
With this little class you can create update or insert forms. It's so easy and useful
|
|
This code produces a set of radio-buttons with given name, with values and texts taken from the array
|
|
This code produces a list of OPTION tags from an array, array keys being option values and array items being option texts. It will also pre-select items from the second argument
|
|
This script contain 2 function to make a drop-down-menu from an array and from mysql-database table.
|
|
This script allows you create a multiple entry form on the fly.
The end-user determines how many entries they want and the form
is created accordingly.
|
|
This function takes three arguments and returns your option code. All you have to do is provide the form and select code as in the example. ;-]
|
|
Takes variables posted from the previous page's form, and converts them to hidden inputs so they can be passed along multiple page forms.
|
|
Form processing program. A trimmed-down version of the popular Phorm script, Phorm Jr. has just email, acknowledgement and text log capabilities, but with the same security and error-handling features of its big brother.
|
|
Generates a query string from POST'ed form variables.
|
|
This is a simple way to set and get values from a readio button or drop down box. Less code than other methods.
|
|
A rudimentary sample of how to require elements of a form to be filled out.
|
|
Allows to generate HTML controls as SELECT, RADIO, CHECKBOX from PHP arrays.
|
|
Autosetup Smarty plugin capture forms controls from smarty templates and populate it's value attributes with values provided by user callback function.
|
|
Validation class for user submitted data. I had many times had to make sure people submitted the right kind of data into form fields. After writting many functions in many places. I've decided to compose on that i can use
all the time
|
|
I was not so comfortable with this one( http://zend.com/codex.php?id=59&single=1 )
So, I simplified the one enough to feed me.
|