Entries tagged with 'php'

Your Ad Here

Simplified PHP $_POST data handling

When posting data from a form to a page, the $_POST variable gets set to an array similar to this:
Array ([name] => “daniel”, [state] => “illinois”, [phone] => “630-618-9588″)
Now, one way to process this is to know in advance (which, normally you will), what the values will be, and set them to more usable variables. [...]

Dealing with timestamps in WordPress is so fucking fucked.

While modifying a plugin to work correctly in WP 2.5, I came across this code snippet.
I haven’t had to deal with it myself, but maybe someone else will find it useful, or hilarious as I did. Here’s the code to make timestamps WordPress friendly (apprently):
// Dealing with timestamps in WordPress is so fucking fucked.
$offset = [...]

Pagination PHP script

Here is a nice, simple way to add pagination to a site with many items using PHP. This code will allow you to display your content normally, or automatically create pagination if the content exceeds a set number of items. This code is provided as is, with no warranty, but can be modified to your [...]

AJAX Contact form

I did some searching online for a quick and easy AJAX contact form… There isn’t one. The free ones are two years old and don’t work, and the other ones I saw cost money. So I fixed the problem.
Unzip to your directory, modify the two variables in “config.php” to your liking and voila.
Download (ver 1.01): [...]

Creating a website template you can work with

Everyone wants a site that looks good, loads fast, and is easy to work with. It really isn’t as hard as one might think, as long as you follow some of the basic rules of design that you would with any development project. With this, I’m going to assume you’ll be writing a PHP based [...]