Wednesday, November 28, 2012

Disable Browser Cache using PHP

Disable Browser Cache using PHP

This is a simple function which sends combination of headers that completely disable any browser caching.<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ function disable_browser_cache() { header("Expires: Tue, 03 Jul 2001 06:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store,...
Download files from Amazon

Download files from Amazon

Amazon S3 (Simple Storage Service) is a commercial storage web service offered by Amazon Web Services. It is inexpensive, scalable, responsive, and highly reliable. It has no minimum fee, and no start-up cost.This code uses standard PHP sockets to send REST (HTTP 1.1) queries to Amazon S3 server. It...

Thursday, November 15, 2012

Easy to use and reliable mail function php

Easy to use and reliable mail function php

How to send email with PHP. Although PHP has built in function mail() to send email, it's quite insecure and use nonobvious arguments. In below example function Send_mail can send mail when called with just four arguments: from, to, subject, text. To avoid email injection (using malformed parameters to...

Wednesday, November 14, 2012

Detect user's browser with PHP

Detect user's browser with PHP

You can use this value with get_browser() to tailor your page's output to the capabilities of the user agent. By php.net, get_browser attempts to determine the capabilities of the user's browser, by looking up the browser's information in the browscap.ini file. Note: In order for this to work, your...

Monday, November 5, 2012

Set limitation for download rate

Set limitation for download rate

This snippet allows you set a limitation for download rate of the file that visitors download from your site.<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ /* set here a limit of downloading rate (e.g. 10.20 Kb/s) */ $download_rate = 10.20; $download_file = 'download-file.zip'; $target_file =...
Generate passwords automatically php

Generate passwords automatically php

Sometimes you need to generate passwords for customers automatically when a new account is created. This code allows you choose the desired length and strength for the password and it is very flexible.<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ function GeneratePassword($length=8, $strength=0){ $vowels = 'aeuy';...

 

© 2014 4everTutorials. All rights resevered.

Back To Top