Default TemplateGreen TemplateBlue TemplateRed TemplateGold TemplateBlue Gloss Template
Sri Lanka News Categories

PHP Scripts Examples and Tutorials

Uploading Files To MySQL Database
Using PHP to upload files into MySQL database sometimes needed by some web application. For instance for storing pdf documents or images to make som kind of online briefcase (like Yahoo briefcase).
[Views:69] [Tue, Nov 11, 2008] [Full Article]

Check the domain extension using PHP
This function will help you to get the domain extension, simply pass the domain name and it will print the domain extension
[Views:401] [Mon, Feb 04, 2008] [Full Article]

PHP coding tips to write less code (If then else and for loop)
PHP is a good language, but there are always surprises. This tip is useful to "lazy" developers who do not even think about variable names. They may prefer magic names like ${0} and 0 is good enough variable name, why not... So here are a few tips that can make your code shorter and harder to read :-)
[Views:313] [Thu, Jan 31, 2008] [Full Article]

Getting Screen resolution using JavaScripts & PHP
In this article we will discuss how to get the users screen resolution. Wouldn’t it be great if you get the users screen resolution so that you could send optimized content for that particluar resolution, we can get users resolution using JavaScript’s but the problem is how do we get PHP to recognize it.
[Views:447] [Thu, Nov 15, 2007] [Full Article]

PHP and Cookies
In this article we will discuss about cookies and how to make cookies work with PHP.
[Views:339] [Thu, Nov 15, 2007] [Full Article]

Maximum execution time in PHP
Solution for script time out. Some time back I had problems when I am uploading files, when I am doing some big process bla bla bla always PHP gives a message "PHP Fatal error: Maximum execution time of xx seconds exceeded".
[Views:381] [Mon, Nov 05, 2007] [Full Article]

Send mail using php
This is a xustom made function and you can include this function in top of your website and call from any where.
[Views:434] [Mon, Oct 01, 2007] [Full Article]

Attach file when your are sending email
a small script that will attach a file and send using php File name "test_mail.php". This will solve the question of "How to send a mail with attachment?" or "How to attach a file when sending a mail using php"
[Views:370] [Fri, Aug 24, 2007] [Full Article]

Want to display html string as text using php?
This small code will tell you how to display html code as text using php and also this code will remove the chr13 (breaker points) and it will make all the text as one line. This is good when you are doing the program with JavaScript also.
[Views:556] [Mon, Dec 11, 2006] [Full Article]

Check number of days between 2 dates
This is a little old function I have made, but up-to now it is very useful for me to include in many place: if you pass start date and end date to this function it will tell you how many days are pending or how many days are more. the result will be depending on your hand.
[Views:583] [Thu, Nov 30, 2006] [Full Article]

How do I greet web site visitors using php?
Greet your website visitors depending on server time: You may ask the question like:: How do I greet web site visitors using php? Ok here is the answer, this is a small code if you think properly.
[Views:515] [Thu, Nov 30, 2006] [Full Article]

Adding Logic with PHP
Introducing the if else construct, while loops and other control loops that will help you in adding logic to your code. Okay our task is to make our programs intelligent I mean let's learn how to add decision making logic in our code. PHP like all other good programming languages provides logic and looping by using if and while statements.
[Views:527] [Sun, Oct 15, 2006] [Full Article]

PHP Sessions
In this article we will discuss what are Sessions and how to work with sessions in PHP. Imagine that you have some data about a particluar user and this information you need on all of the pages, woudn't it be great if you could store that info in a variable and access it from any page, Sessions exactly do that.
[Views:546] [Sun, Oct 15, 2006] [Full Article]

How to Send Email from a PHP Script Using SMTP Authentication
PHP mail() and SMTP Authentication Part of what makes the PHP mail() function is so simple is its lack of flexibility. Most importantly and frustratingly, the stock mail() does not usually allow you to use the SMTP server of your choice, and it does not support SMTP authentication, required by many a mail server today, at all.
[Views:529] [Fri, Sep 29, 2006] [Full Article]

Sort Array By String Length
This function provides a way to sort an array by string length.
[Views:493] [Tue, Aug 22, 2006] [Full Article]

Watermark Images on the Fly in PHP
Let's suppose that you've just been given five screenshots from the biggest upcoming video game of the year. You want to share your screenshots, but credit has to be given where credit is due -- after all, you haven't been sweet-talking public relations representatives for fun, right? The solution is to watermark the images. But the standard watermarking procedure of editing the image in a photo-editing application is time consuming. PHP offers a far better solution. PHP 4+ and GD 2.0+ represent a powerful combination when it comes to creating or altering images dynamically. In this tutorial, we'll look at some of the GD and standard PHP functions as we watermark images on the fly.
[Views:514] [Tue, Aug 22, 2006] [Full Article]

Adding Logic with PHP
Introducing the if else construct, while loops and other control loops that will help you in adding logic to your code. Okay our task is to make our programs intelligent I mean let's learn how to add decision making logic in our code. PHP like all other good programming languages provides logic and looping by using if and while statements.
[Views:428] [Tue, Aug 22, 2006] [Full Article]

Upload Image and resize proportionally using PHP
This example will show you how to Upload a Image and resample the image proportionally with 100% quality, I have made a function it will do the needful, so you don't have to change the function, If you want to change you can change it, I am not going to charge anyway.
[Views:523] [Mon, Aug 21, 2006] [Full Article]

Get height and width from a image using php
This example will show you how to get the height and width from a image
[Views:307] [Thu, Aug 03, 2006] [Full Article]


Members Login
User ID
Password
    Register
Forgot password?

Buy from Domain Hosting Market




Resources - Top Link Exchange
Join Sri Lanka Banner Exchange | Link Exchange