View Full Version : need some help
peace
10-12-2004, 07:19 AM
Hi,
I’m new in here so please be nice with me ;)
Ok here is my problem:
I need create a action where my clients type order number, than they click "Get file Now" and if order number is correct download of file starts automatically .
here is example:
http://www.xewex.com/test.html
can someone help me please
thanks
Emancipator
10-12-2004, 07:48 AM
i would do an sql database, and have two fields
- order number
- file
In the order number would be your order number, in the file would be the FILE. If the order number is valid, it downloads the file, if not it gives you a message. VERY easy to program in php.
number7
12-22-2004, 03:16 PM
while having MySQL fields:
order_number
file_name
1. Step - Check for order_number validity. For security reasons if your order_number contains digits only check if it has not alphanoumeric and other characters.
2. Step - Check if order_number is in your database.
3. Step - Use PHP header file to send file for the user:
if ($bIS_ORDER_OK) {
//ZIP file
header("Content-type: application/zip");
header("Content-Length: ".filesize('file_name.zip')); // Send file size to the client. Some clients may don't work correctly when they don't know file size.
header("Content-Disposition: attachment; filename=file_name_visible for user.zip");
// load ZIP source from server
readfile('file_name.zip');
}
Powered by vBulletin® Version 4.2.2 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.