icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » Downloads Links

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old September 18th, 2004, 9:23 AM   #1 (permalink)
Registered User
Seasoned Poster
 
Dima's Avatar
 
Joined in Sep 2004
43 posts
Gave thanks: 0
Thanked 0 times
Downloads Links

I was wondering what do i have to do to convert normal html links like:

http://www.mydomain.com/folder/folder2/file.ext

to say something like this:

http://www.mydomain.com/download.php?get=file109445
Can anyone help me please?



Thank you
__________________
Dima is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 9:30 AM   #2 (permalink)
Caffeine fiend
Comfy Contributor
 
pvera's Avatar
 
Joined in Aug 2004
Lives in Reston, Virginia
Hosted on pass15
270 posts
Gave thanks: 0
Thanked 0 times
Four options I see:

1. Fake it with a php SWITCH statement as explained elsewhere in the "hide PHP" thread.

2. Write a little bit more php so the actual filenames are stored in a MySQL database, that way you can add more of these files without messing with the programming.

3. Find an open source module that already does #2. Almost every CMS known to man has that feature, so in theory you can install the CMS in a folder, turn everything off except for the downloads module and use the admin part of it to manage the links to the files. Then you can use the URLS generated by it anywhere else in your site. I bet it takes less work to do this than to do either #1 or #2.

4. Use mod_rewrite rules to redirect each request to its intended location.
pvera is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 9:30 AM   #3 (permalink)
Marketing Maven
Surpass Staff
 
Kayla's Avatar
 
Joined in May 2003
Lives in Chicago
24,757 posts
Gave thanks: 946
Thanked 807 times
Thanks for helping, pvera. You beat me to it.
Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 9:33 AM   #4 (permalink)
Caffeine fiend
Comfy Contributor
 
pvera's Avatar
 
Joined in Aug 2004
Lives in Reston, Virginia
Hosted on pass15
270 posts
Gave thanks: 0
Thanked 0 times
Early weekend crowd, aren't we all?

Funny thing is I started assuming I had three answers, and halfway I realized I could use mod_rewrite too. I tell you, there is a mod_rewrite conspiracy out there.

/waits for the black helicopters
pvera is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 9:35 AM   #5 (permalink)
Registered User
Seasoned Poster
 
Dima's Avatar
 
Joined in Sep 2004
43 posts
Gave thanks: 0
Thanked 0 times
Ok thanks




PS. its 1.40PM here so it aint early
__________________
Dima is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On