TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-19-2008, 07:02 PM   #1 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Smile htaccess securing url

hi, im trying to build something like

_http://www.filecrunch.com

one question i do have is when i upload a file to filecrunch then try to download it the url becomes something like this:

_http://www.filecrunch.com/file/~wlrnof

how would i create something like this? so far i have in my interface is the upload field and when the file is uploaded it goes to a some directory that i've specified in php.ini

if there is a book i can purchase i would get it lol. but any help would be great.

thanks from the middle of my heart.
sarmenhb is offline  
Reply With Quote
Old 01-19-2008, 09:04 PM   #2 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

The name for the file is randomly generated after you upload it, and that link represents nothing but a truncation of a real file path. You can do that easily by writing a little htaccess file:

Code:
RewriteEngine On

RewriteRule ^~([a-zA-Z0-9])$ /some/path/on/server/script.php?process=$1
...for example. Get your script to work correctly first, and after that you take care of the urls. But to make it easier, don't hard code them (the urls).
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 01-19-2008, 09:49 PM   #3 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

Wildhoney (or any other administrator) has done the same thing.

1: Get the category it's posted in :: General
2: Get the ID of the post :: 2015
3: Get the title of the thread :: htaccess securing url
Everything is dynamically fetched from the database and rewritten by the .htaccess. Guessing this is what you want to do, you can search the web for some awesome RegEx for .htaccess or create your own.

The basics: Make Dynamic URLs Search Engine Friendly

Good luck.
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
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
Display Modes

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

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


All times are GMT. The time now is 04:55 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design