 |
PHP can be used for a lot of different things, and is one of the most powerful scripting languages available on the web. Not to mention it's extremely cheap and widely used. However, one thing that PHP is lacking, and in fact most scripting languages are, is a way to update pages in real-time,...
By Kings
Last Message By shabbir
|
5 10,870 |
 |
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...
By shabbir
Last Message By gkumar
|
6 8,684 |
 |
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...
By pradeep
Last Message By manilodisan
|
4 33,337 |
 |
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>
By pradeep
Last Message By pipeten
|
2 6,589 |
 |
Background
I've needed the header function in php so many times I figured I'd write a tutorial on it. This tutorial should help you do most of the things that the header function is capable of. Simply put, the php header function will send a http header to the browser.
Headers in PHP
If...
By S k
Last Message By pradeep
|
4 3,978 |
 |
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,...
By pradeep
|
0 2,756 |
 |
Some web applications need to display numbers in words, like e-commerce, shopping web applications, so PEAR brings a package named Numbers_Words which converts numbers to words in 2 lines of PHP code.
Checkout the example below.
<?php
require('Numbers/Words.php');
$number =...
By pradeep
Last Message By pradeep
|
6 10,163 |
 |
Management of files
Manipulating files is a basic necessity for programmers and PHP gives you a great deal of tools for creating, uploading, and editing files. When you are manipulating files you must be very careful because you can do a lot of damage if you do some errors. Common errors include...
By Sanskruti
|
0 7,054 |
 |
Sometimes we need to find the number of items, located inside an array.Let's take this array as example,
$a=1;
$a=3;
$a=4;
$a=5; here the total item count is 4, but when you use count() function you get 3. So I wrote a small function which counts array elements, even recursively.
...
By pradeep
|
0 4,298 |
 |
If you have PHP4 working on your server, and have heard that PHP5 may screw up things. Here's how to have both running alongside.
#!/bin/sh
# PHP5 CGI Installer for cPanel/WHM Servers
VERSION=5.0.4
cd /usr/src
wget -O php.tbz2...
By pradeep
|
0 3,348 |
 |
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,...
By Mary
Last Message By gkumar
|
5 17,614 |
 |
Sometimes you just need to know what country your site visitors are coming from - for example, if you're trying to implement geo-targeted advertising. This article will show you how.
Sometimes you just need to know what country your site visitors are coming from - for example, if you're trying...
By Mary
Last Message By iglow
|
23 57,171 |
 |
Exceptions are used to change the normal flow of a script if a specified error occurs.Exception handling is used to change the normal flow of the code execution if a specified error (exceptional) condition occurs. This condition is called an exception.when an exception is triggered the current code...
By Sanskruti
|
0 6,416 |
 |
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.
...
By pradeep
|
0 15,731 |
 |
PHP is arguably the most popular scripting language for Web sites. This popularity comes with a price, however, and that is increased attention to various vulnerabilities in PHP itself and in the plethora of Web applications written in PHP. The security features built into PHP are weak, and the...
By pradeep
|
0 2,791 |
 |
Introduction
XOR encryption is a trivially simple symmetric cipher which is used in many applications where security is not a defined requirement.Exclusive-OR encryption, while not a public-key system such as RSA, is almost unbreakable through brute force methods. It is susceptible to...
By pradeep
Last Message By cignusweb
|
5 22,215 |
 |
Introduction
ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple Caesar cipher used in online forums as a means of hiding spoilers, punchlines, puzzle solutions, and offensive materials from the casual glance. ROT13 has been described as the "Usenet equivalent of a...
By pradeep
Last Message By LenoxFinlay
|
2 10,678 |
 |
Introduction
The RGB color model is an additive model in which red, green, and blue (often used in additive light models) are combined in various ways to reproduce other colors. The name of the model and the abbreviation ‘RGB’ come from the three primary colors, red, green, and blue and the...
By pradeep
Last Message By avneeshatri
|
3 23,208 |
 |
While working with currency calculations, we often require to round a number to the nearest 10 or the nearest 50, like 407 should be 410.
I've written a function which will do exactly that, it requires two parameters the number to the round, and the integer to be rounded to. The function is like...
By pradeep
Last Message By qforever
|
2 15,777 |
 |
password.class.php
<?php
/*
* Simple password generator
define ('PC_MINUS', 0x01);
define ('PC_CAPITAL', 0x02);
define ('PC_NUMBERS', 0x04);
define ('PC_SPACES', 0x08);
By extraweb
Last Message By gkumar
|
5 4,941 |