PHP Web Development Tutorials

PHP Web Development Tutorials and Articles
  Title Reverse Sort Order / Author Replies
Views
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,205
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
7,117
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
18,099
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,769
Recently i had to implement a file split-er in PHP and was shocked find how LESS pre written scripts are available for the task. So thought of writing a quick one myself. If you just want the code, I have a fully featured php script hosted at github Just download it there and well CONTRIBUTE :)...
0
4,036
Recently, an obscure detail in the way PHP processes strings came to my attention. This is processed by code that checks for simple lists (like 1. blah 2. blah, or - blah - blah, etc.). However, an innocent call to in_array($x, array('1.', '0.')) had surprising and unexpected results: our...
1
10,356
This is temperature conversion script, used to convert temperature from Celsius, Fahrenheit, Rankine, and Kelvin. The Code Include the script in your php project and call one of the conversion functions with a numeric value as its parameter to get some output. You can convert from Celsius,...
4
4,288
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,804
Many websites generate temporary password or some generate the Activiation code for verification of email. They send the mail with that code in it and so If you wonder how they do this here is a function to do this. Input : - Length of the Random string you wish to generate Output :- Random...
6
12,996
There are many different traffic analysis tools, ranging from simple counters to complete traffic analyzers. Although there are some free ones, most of them come with a price tag. Why not do it yourself? With PHP, you can easily create a log file within minutes. In this article I will show you how!...
14
39,511
File Transfer Protocol or popularly known as FTP has been a de facto standard for transferring files for many years, can be used in many programs / utilities like backup programs, etc. PHP is being increasingly used in writing scripts for maintenance and other purposes and the FTP extensions...
0
2,335
Many times its required that we truncate a long string and add ellipsis to the end of the truncated string. Here's a function which does exactly that. function truncate( $varb, $num ) { $dnum = intval($num); if (strlen($varb)>$dnum) { $nvarb = substr($varb, 0,...
0
4,145
PHP will automatically convert data types as necessary across the board - you need not worry about it happening. If you specifically wish to override PHP's type conversion, you can perform what is called a type cast - you forcibly convert a variable of type A to type B. In PHP, type casting looks...
3
39,540
This is a guide, you will not have a stand-alone effect or file by the end of this guide, but you will - hopefully - have an understanding of the Unix timestamp that allows you a powerful form of managing your PHP applications. Note: This guide expects the reader to have an understanding on how...
0
12,192
The PDF (or portable document format) file is an amazingly versatile format for transferring what usually starts as a hard copy version of a document over the Internet. Many companies use the PDF format to transfer contracts, manuals, and other documents over the Internet without trying to convert...
2
16,825
The in-built array functions allow you to interact with and manipulate arrays in various ways. Arrays are essential for storing, managing, and operating on sets of variables. Simple and multi-dimensional arrays are supported, and may be either user created or created by another function. There...
14
16,673
Memcached is a high-performance open-source caching solution, generally used to improve web application performance by avoiding round-trips to RDBMS, to know more about memcached read Faster Webapps With Memcached. In this article we'll discuss about installing and using memcached in PHP. A PHP...
0
2,712
Introduction PHP comes with an extensive catalog of date and time functions, all designed to let you easily retrieve temporal information, massage it into a format you require, and either use it in a calculation or display it to the user. However, if you'd like to do something more complicated,...
5
19,270
When it becomes necessary to compare two or more text files in UNIX, most developers reach for the diff program. This program, included by default in almost all UNIX distributions, compares the files line by line and displays the changes between them in a number of different output formats. ...
0
18,031
All PHP coders are aware of the mail() function in PHP, which can be used to send mails. On Linux systems we ussually have Sendmail program installed, if someone is facing a problem sending mails with mail() function, they can alternatively use Sendmail to send mails. For sending mails using...
4
35,068