...

View Full Version : dynamic url help



teemone2001
10-25-2012, 10:35 PM
can anybody in the forum explain how i can create a dynamic url for a website in php, i dont want my site scripts to be displayed, i want something like this
www.mywebsite.com/gbibhjsbs7i3498yhiouhf8793
that will always change if another user points to www.mywebsite.com. thanks i will be grateful if anybody can help me asap.

sunfighter
10-26-2012, 04:45 AM
php scripts are never displayed to the user, so what your doing is not necessary. Only if someone breaks into your site will they see your php and then nothing you do will stop them.

teemone2001
10-26-2012, 05:04 AM
bro, what am saying is i want all or some of my websites link to auto generate ur token after my domian, on this forum we can all see the newreply.php i dont want that make sql injection easy, but if is a one time url token, they cant sql your site, hope u understand what am trying to tell u. thanks

Custard7A
10-26-2012, 11:48 AM
You seem to be trying to append a session token to the URL — or a once-only deal — correct me if I'm wrong there, without the URL appearing dynamic.

A dynamic URL is simply variables passed in the URL, meaning you can't avoid something like domain.com/file.php?variable=value. However, you can 'mask' these URLs with htaccess, which works by allowing access to that path via another. For the example I just used, I could change it to be accessed as domain.com/file/value. This is a good technique for set pages, such as a user page, however I don't believe there is an efficient way to mask a random value you are passing to every page. You would need to create a new htaccess mask for every page on your site, and if you miss one.. it would be messy.

More importantly, this is an absurd approach to preventing SQL injection — or any form of attack — and is a waste of time. Knowing the name of variables, such as this page using the "t" variable, is of no benefit to an attacker if a few simple sanitations are in effect. Sanitation > security by obscurity.

teemone2001
10-26-2012, 08:19 PM
good, can u show me how to go about creating it? thanks

tangoforce
10-27-2012, 12:15 AM
php scripts are never displayed to the user, so what your doing is not necessary. Only if someone breaks into your site will they see your php and then nothing you do will stop them.

I think you need to stop guessing :p :D :thumbsup:

The op is saying they don't want www.domain.com/file.php?something=else
Instead they way something like www.domain.com/something/else

The technique the op wants is url rewriting. With apache it's mod_rewrite that does the job. Its been years since I've used it so I'm not a good one to provide examples but you have to store the urls and the converted urls in a .htaccess file.

Peeyush
10-28-2012, 05:05 PM
http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/

This might help you



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum