WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : ANTI leech script, use this if you want that people can't see the original URL. The files can be on your own server or on another server.
Categories : HTML, Misc, PHP Update Picture
Marcel Lemmen
Date : May 11th 1999
Grade : 1 of 5 (graded 2 times)
Viewed : 8439
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Marcel Lemmen
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?
/*
Copyright (c) 1999 Marcel Lemmen
E-mail: lemmen@support.nl
All rights reserved.

This code provided "As Is" with no warrantees express or implied.
The author and contributors are not liable for anything good or bad
that results from your use of this code.

You are free to distribute this for free provided this notice is included.
Please forward fixes/enhancements to the
author for inclusion in the next revision.

Usage:
Replace $files with the original with your files.
Replace $filenames with the filename people see when
downloading (CAN be different then file's!!!)
Replace $URL with your directory or the other URL.

That's all!!!

*/

$files=array('file1.zip','file2.zip');
$filenames=array('File1.zip','File2.zip');
$url="/home/lemmen/public_html/data/";
/* When the files are on another server, use the
whole address (http://www.server.com/dir/) in stead of /home/lemmen... */

$referer=ereg_replace("\?.","",$HTTP_REFERER);
$thisfile="http://$HTTP_HOST$PHP_SELF";

if ($referer!=$thisfile)
for ($i=0;$i<count($files);$i++)
echo "<P><A HREF=\"$PHP_SELF?$i\">",$filenames[$i],"</A>\n";

else {
$i=$QUERY_STRING;
$total=$url . $files[$i];
Header ("Content-Type: application/octet-stream");

Header ("Content-Length: ".filesize($total));
Header("Content-Disposition: attachment; filename=$filenames[$i]");

readfile($total);
}
?>



Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
A simple class with some HTML output functions that would come in handy for consistent page layout etc.
Categories : PHP, PHP Classes, HTML and PHP, HTML, Navigation
Script to check values being submitted by POST or GET method from a form. This script may help diagnose what variables are being supplied by a browser to other php scripts.
Categories : HTML, Variables, Debugging, PHP, HTTP
BBCode Formatting String
Categories : PHP, HTML, Regexps, Arrays
color codes for positive and negative numbers
Categories : PHP, MySQL, Databases, HTML
Parses HTTP_USER_AGENT so that you can customize your site to different browsers
Categories : HTML, PHP, Complete Programs
FormWizard reads a mysql table and generates automatically a html formular in a html-table
Categories : PHP, MySQL, HTML
Allows you to parse a deliniated string and put the individual fields in a SELECT option in a form
Categories : HTML, PHP, Strings
Browser Detecor Class
Categories : PHP Classes, PHP, HTML
Display Slashdot headers on your own site
Categories : HTML and PHP, HTML, PHP
webcam cam view image ispy browser independant
Categories : Graphics, HTML, HTML and PHP, PHP
Builds JavaScript that updates the contents of one selector based on another.
Categories : HTML, Java Script, PHP, Complete Programs, General
ASCII To HTML Converter
Categories : PHP, HTML, ASCII
How to preset a text string in a textarea input field
Categories : HTML, HTML and PHP, PHP, Beginner Guides
Automatic generation of HTML code for a table. OO interface. Can define colspan, rowspan, table style, cell style, and data style. Simple, but effective.
Categories : PHP, PHP Classes, HTML, HTML and PHP