Click to See Complete Forum and Search --> : Generalized php scripts


deesse
09-05-2007, 04:04 AM
HI All,

May I know, how can I generalize my php script and how would that script be like based on these description:

1--The new script should be a ONE php-program that takes a file name (URL) to download as command line parameter.

2--Depending on the extension of the file to download, the program should choose between downloading and unpacking (.ext1 extension), or just downloading (.ext2 and .ext3).

overall working archi.....
.
|
|
-------------
file extension |------ext1-----set ext1=true---
------------- |
| ext2, ext3 |
| |
--------------- |
set ext1=true |
--------------- |
| |
|--------------------------------------
---------------
download
---------------
|
|
--------------- ------------
ext1 | ------true---- unzip
--------------- ------------
| |
false ready