kingc — 2012-08-06T05:17:31-04:00 — #1
Real simple question I am sure.
I am using a $_GET function to load mysql data onto a page.
The url that Calls the information reads something like this ::: http://examplesite.com/?dbvariable=bill
Everything on the page loads up fine; MY question is, how would I code my script so that http://examplesite.com/bill - does the same things that the previous url does (load all information in my database, connected to 'bill' --- which of course would change dynamically, if instead of 'bill' it were to read 'john' - now it will pull all johns' info.
I am sure this might have been covered before; I just don't quite know what 'term' to use to properly find my answer; I know it's do-able!
Thanks in advance to anyone who understands this question; and can provide any solutions... or at least, point me in the right direction.
kingc — 2012-08-06T05:18:08-04:00 — #2
p.s. please do not lick those links............ just examples.
markdidj — 2012-08-06T05:21:41-04:00 — #3
You'll need to look in to mod_rewrite and .htaccess to do things like this. It can't be done without as the server will expect a default file to be in the folder /name
.htaccess, unlike global.asa in asp, gets called before any files do. So you can use that with mod_rewrite to send data as though it was coming from a default file
kingc — 2012-08-06T15:32:41-04:00 — #4
that makes sense; I might look into that then instead .....
i was also wondering if there is a way to Shorten /?dbvariable= .... to something like /?u=
where the string ?u is = to ?dvariable
for something like that, am I looking at using String Replace??
is that even possible? - because if I can shorten the link, that would be better, than changing how the site reads for files/folders I am thinking; thanks again for any help or points provided.
dklynn — 2012-08-07T08:17:32-04:00 — #5
Mark was correct. You might benefit from reading the mod_rewrite tutorial linked in my signature as it contains explanations and sample code. It's helped may members and should help you, too.