PHP Web Development Tutorials

PHP Web Development Tutorials and Articles
  Title / Author Replies
Views
Cookies have long been used in PHP scripts, and are a very useful function. But what exactly are cookies? Maybe you have used then, but you still don't know exactly what they are. Or you are completely new to cookies? It doesn't matter, because in this tutorial I will show you exactly what cookies...
1
7,959
What are Regular Expressions? A regular expression is a pattern that can match various text strings. Using regular expressions you can find (and replace) certain text patterns, for example "all the words that begin with the letter A" or "find only telephone numbers". Regular expressions are...
5
7,081
Many sites send you a temporary password after u sign up with them. Here is is how you too can do that function TempPassword($tp_len) { $pstring = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWXxYyZz0123456789"; $plen = strlen($pstring); for ($i = 1; $i <= $tp_len; $i++) ...
1
5,598
Show page processing time at the end of the page using PHP <?php //Page process time calculation /* The microtime() function fetches the current current Unix timestamp with microseconds another alternative method is to use the microtime() so that it returns a float value...
1
14,450
Haversine Formula The haversine formula is an equation important in navigation, giving great-circle distances between two points on a sphere from their longitudes and latitudes. It is a special case of a more general formula in spherical trigonometry, the law of haversines, relating the sides...
0
17,478
Building web applications with membership management is one of the most frequent tasks that every programmer does. Managing membership data, such as username, password and the member's profile with sessions in PHP is the easiest and simplest solution. Sessions stores data about a particular...
2
4,497
With an ODBC connection, you can connect to any database, on any computer in your network, as long as an ODBC connection is available. Here is how to create an ODBC connection to a MS Access Database: 1.Open the Administrative Tools icon in your Control Panel. 2.Double-click...
0
18,589
I like coding PHP, in Perl we can change an associative array to a list then to a string. In case if we wish to do the same in PHP, we need to write some user functions for that purpose. Here are two functions which will convert Array to String and vice-versa. //array to string ...
0
5,213
Well, I always had a problem identifying my MP3 files because of their vague filenames like, "Track 1.mp3" or "Bryan Adams 1.mp3", I was wondering whether I could rename the file depending upon the MP3 tags, so I came with up this script with reads MP3 tags and renames the file according to the...
0
4,456
I never recommend using " (double quotes) when programming with PHP. Always use ' (single quotes) unless you need the features of " (double quotes). You might think it's much easier to write code as: echo "Today is the $day of $month"; However, using single quotes forces variables to be...
0
6,530
There are times when we require to put a calendar in some web appplication of ours,writing the code to generate a calendar from scratch is painstaking and waste of time. So PEAR comes to rescue with its Calendar package. The package gives a ton of features, below you'll find a simple program to...
0
6,817
The PHP Extension and Application Repository (PEAR) is an open source structured library of packages for PHP developers. These packages provide routines which solve problems PHP developers regularly face: sending structured e-mail (such as an HTML attachment), interacting with different databases...
0
9,546
Manier times we require to create logs of various activities/errors in our web applications, so here we'll look into how to achieve that. Logging data to a file in PHP can be as simple or as complex as you want to make it. Break it down, though, and it all comes down to these three simple lines...
0
14,141
PHP offers one alternative - a special Log class that comes courtesy of PEAR, the PHP Extension and Application Repository (http://pear.php.net). In case you didn't know, PEAR is an online repository of free PHP software, including classes and modules for everything from data archiving to XML...
0
11,024
How to show the no. of users online on your site using PHP & MySQL. Step1: Creating the database Create a new table called 'useronline', with 3 fields inside a table. The fields are timestamp, ip and file. Below is the SQL to create the table. CREATE TABLE useronline ( timestamp...
1
3,913
Introduction At some point, most developers have a need to create graphs. I've known some to get frustrated and end up exporting the data to a spreadsheet, rather than relying upon the graphing capabilities of Open Office or Excel. That can be the way to go in certain cases, but not because...
1
12,308
Title says it all but to reemphasize that below PHP code block validate an email address. Its always good to have a client side validation for faster user responses but backend check is also needed for user not having client side scripting on. <?php function emailsyntax_is_valid($email) { ...
0
3,159
Many times we require to format a number to output with thousand place comma separator, here is a function will help you do so. function numcomma ($value) { if(strpos($value,".")) { $decimalval = substr($value,strpos($value,".")+1); $value =...
0
2,186
Shell Sort function in PHP <? function shellsort($elements,$length) { $k=0; $gap=(int) ($length / 2); while($gap>1) { $k++;
0
5,859
Here's a function which will format the passed bytes into KB,MB,GB...appropriately. function GetSize ($sizeb) { $sizekb = $sizeb / 1024; $sizemb = $sizekb / 1024; $sizegb = $sizemb / 1024; $sizetb = $sizegb / 1024; $sizepb = $sizetb / 1024; if ($sizeb > 1) {$size =...
0
2,342