All this snippet really needs is 2 arrays containing different values. The first array will be the field names in the table you're submitting to. The second array will hold the submitted data to add into the new record. You will need to arrange the fields and values in order for the snippet to work properly. Here's how it works. The first parameter needs the table name you're creating the new record in. The second parameter will be the variable that contains the array of field names of the table you have chosen. The third parameter will contain the values to add into the field names in it's own record. The fourth parameter is option. Adding true to it will return the last ID that mysql auto incremented to your PHP code, so you may use it in any way you like. Like the example shown, the $insert variable is going to retrieve the ID that Mysql sent back to be used in a header redirection. This code works for mysql_* functions, but you can modify it to work with MySQLi too.
This script shows how to redirect to a specific site.
this snippet will create a drop down menu from an array list.
pass in a path to a folder (string), and it will print out all the items found in that folder, if it exists.
This script makes a list of content for each month and puts the current month first, and then lists the months coming up.
_viewAggregate() function aggregates an array of IP addresses or networks according to supplied prefixes and their mask lengths. ip2long6() and long2ip6() function are taken from comments of online php manual and given there for ease of use. See http://php.net/ip2long
This will replace all html tags with a particular string.
Just like incrementing numbers, you an increment letters as well. (Run best using the CLI)
Need a drop down menu that shows 100 years into the past? this will do it for you, its good for registration forms for birthdays.
search text with format "@format" and convert it to link
Checking the length of a string
A simple tutorial of how to connect to a database.
This script shows how to escape characters in php
Copying or Moving Files and Child Files from Source Dir to Destination Dir
Take a valid string URL with get variables, so they can be accessed using php's P\predefined GET variables or just return an array
A easy way to create simple INSERT / UPDATE query's to MySql In the scrip change the value for $url, $dbuser and $pwrd
Replace substrings in a haystack with perl regular expression using preg_match_all()
Implode on an array's keys instead of its values.
This will convert Bulletin Board Code into readable HTML, good for comments, forums, etc.