PHP Web Development Tutorials

PHP Web Development Tutorials and Articles
  Title / Author Replies
Views
Ill start by giving the code to the guest book then I will give a step by step on what each part does. <?php if(isset($_POST) && isset($_POST)) { if($_POST != "" && $_POST != "") { $F_D = getdate(); $FT = $F_D."/".$F_D."/".$F_D;
0
36,430
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
8,152
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,294
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,720
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,996
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,820
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,649
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,843
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,690
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,683
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,999
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,759
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
16,747
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
12,018
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
4,062
Do a WHOIS query for any domain using the script below.:) <form method="POST" action= "<?$_SERVER?>"> <label>Do a WHOIS query:</label> <P> <INPUT name="domain" SIZE="20" MAXLENGTH="22"> <INPUT TYPE="SUBMIT" VALUE="Check name"> <INPUT TYPE="RESET" VALUE="Clear"> </P> </FORM>
2
7,276
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,311
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,292
Shell Sort function in PHP <? function shellsort($elements,$length) { $k=0; $gap=(int) ($length / 2); while($gap>1) { $k++;
0
6,121
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,453