note 14537 deleted from control-structures.switch by david
| From: | david@php.net | Date: | Thu, 30 May 2002 15:50:45 +0000 |
| Subject: | note 14537 deleted from control-structures.switch by david | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-31212@lists.php.net to get a copy of this message | ||
To make simple download script.
<?
switch($file) {
case "file1":
include('file1.zip');
break;
case "file2":
include('file2.zip');
break;
case "file3":
include('file3.zip');
break;
case "file4":
include('file4.zip');
break;
default:
include('downloads.php');
break;
}
?>
Name file file.php urls will look like file.php?file=file1 and it will download file1.zip. If you
just enter file.php it will display downloads.php