Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

"masking" url

General discussions related to php

Moderators: macek, egami, gesf

"masking" url

Postby xyoon » Thu Jul 17, 2003 5:31 am

Hi,

I have a question here regarding url stuff.

Let say I have (just random example url)
http://www.mysite.com
and I want to have few directories say

http://www.mysite.com/food
http://www.mysite.com/home
http://www.mysite.com/sport
http://www.mysite.com/job
http://www.mysite.com/leisure

and within each directory, there will be plenty of buttons that will invoke different php scripts.

Let say now a user is in the food directory.
How can I make the url to appear at the address browser as
"http://www.mysite.com/food" without any extension
while the user surf through the food directory

I remember I saw this few times somewhere and what appears on the status bar when you click on the link is not within the food directory (let say for the above example) but in other directory. It somehow "mask" the url.

Does anyone know how to do this?
Any idea would be very much appreciated.
Thank you very much in advance.



regards
xyoon
New php-forum User
New php-forum User
 
Posts: 40
Joined: Fri Jun 27, 2003 10:57 pm

Postby swirlee » Thu Jul 17, 2003 6:29 am

First, a warning: This is a terrible idea. URLs are there for a reason -- they tell a user where they are and give them a sense of the hierarchy of the site. If you remove the way a URL relates to a site, not only does the user lose that sense of hierarchy, bookmarks/favorites become meaningless since they'll take a user to a different page than they thought they were bookmarking. Please don't do it. I can't imagine a single good reason to.

That said, the typical, and easiest way to do this is with frames. Just create a frameset at the /foods url and have every page load inside the frameset. The URL in the address bar won't change and the user will get confused and you've accomplished what you're after.

The other, more difficult, why-bother way to do this would be to use only form-button navigation (again, a terrible idea) and have all of the buttons POST to /foods/ (we'll presume there's an index.php or similar there), and have the single index generate the content for every page based on the values passed in the POST.

I'm going to leave it up to you to figure out the rest, because I think it's a bad idea.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Xeth » Sat Jul 26, 2003 4:03 am

rofl @ swirlee
User avatar
Xeth
New php-forum User
New php-forum User
 
Posts: 38
Joined: Tue Jul 08, 2003 10:59 am

Re: "masking" url

Postby WiZARD » Sat Jul 26, 2003 11:41 pm

Hi!
in some situation swirlee is right......
but right only in one, than user come to you're site, than him too hard search first page......... :cry:
but if you wish create random page like at http://www.apple.com/trailers
to you need crefte file or table in database and read and put in array and just use shuffle function
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Postby Oleg Butuzov » Sun Jul 27, 2003 2:05 am

mod_rewrite.so =)

apache.org for docs =)
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby xyoon » Mon Jul 28, 2003 9:38 pm

Hi,

Thank you for all your reply.
But the reason I ma doing so is because I am planning to create a forum.

So, within the food forum, there will be some navigators (as you suggest, a frame) that will always show where users are and users can easily go to another page.

Why I am asking this is that a site that I previously visited, it seems like it's not using any frame for some reasons.
But for the time being, I will be using frames. Thanks.


regards
xyoon
New php-forum User
New php-forum User
 
Posts: 40
Joined: Fri Jun 27, 2003 10:57 pm

Postby swirlee » Tue Jul 29, 2003 5:31 am

xyoon wrote:Why I am asking this is that a site that I previously visited, it seems like it's not using any frame for some reasons.


You can have a frameset with only one frame. Or you can have two frames but give one of them a width or height of 0 or 1 so it's essentially invisible.

xyoon wrote:So, within the food forum, there will be some navigators (as you suggest, a frame) that will always show where users are and users can easily go to another page.


I don't understand why you need to obfuscate the user experience in order to accomplish that. Woe be to the first user who tries to bookmark a message and discovers 15 minutes later that his bookmark goes to the front page instead.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to PHP General

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron