Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 10th Aug 2011, 08:35 AM   #1
Warrior
 
Join Date: 2011
Location: Suffolk, UK
Posts: 18
Thanks: 3
Thanked 2 Times in 2 Posts
Default
PHP hiding the variable type but showing the value.
Share on: 
fb share twitter share gplus share more share

Hi Guys,

Does anyone know how I can change a url from this:

example.com/?id=example1

to:

example.com/example1

when using a GET variable,
ie. taking out "?id=" in the url and showing just the value?

I have seen other people using this but I have no idea how to use it myself,

Thanks in advance

Chazbo is offline  
Unread 10th Aug 2011, 09:26 AM   #2
Active Warrior
 
Join Date: 2011
Location: Winnipeg, Manitoba
Posts: 36
Thanks: 1
Thanked 6 Times in 6 Posts
Default
Re: PHP hiding the variable type but showing the value.
Share on: 
fb share twitter share gplus share more share

They use HTACCESS to get the variable in the URL and silently send you to the PHP page, with that variable in the URL.

User goes to example.com/example
HTACCESS takes the example variable and puts it into a GET variable like example.com/?id=example
HTACCESS silently redirects the page to the PHP script
Speedyapoc is offline  
Unread 10th Aug 2011, 09:42 AM   #3
Warrior
 
Join Date: 2011
Location: Suffolk, UK
Posts: 18
Thanks: 3
Thanked 2 Times in 2 Posts
Default
Re: PHP hiding the variable type but showing the value.
Share on: 
fb share twitter share gplus share more share

ok, i'll look into it, thanks for your reply

Chazbo is offline  
Unread 10th Aug 2011, 10:27 AM   #4
Active Warrior
 
Join Date: 2011
Posts: 87
Thanks: 16
Thanked 10 Times in 9 Posts
Default
Re: PHP hiding the variable type but showing the value.
Share on: 
fb share twitter share gplus share more share

It called mod rewrite. You put rules into your .htaccess file and Apache will "rewrite" the pretty url to the correct url.

Need a QR Code? Check out my QR Code Generator. It's FREE!
dudeontheweb is offline  
Unread 10th Aug 2011, 07:47 PM   #5
HyperActive Warrior
War Room Member
 
Join Date: 2009
Posts: 145
Thanks: 3
Thanked 48 Times in 24 Posts
Default
Re: PHP hiding the variable type but showing the value.
Share on: 
fb share twitter share gplus share more share

.htaccess is the way to go.

You could also look into using an mvc framework like CodeIgniter, CakePHP or Recess.

723Media is offline  
Closed Thread


Bookmarks

Tags
hiding, php, showing, type, variable


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

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




All times are GMT -6. The time now is 12:26 PM.