MLUG: Re: [MLUG] Cleaning up web page URL's
Re: [MLUG] Cleaning up web page URL's
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Thu, Aug 07, 2003 at 05:02:42PM -0500, Bruce Alspaugh wrote:
> Sometimes it is convenient to have the user click a link on a web page that 
> passes info to a PHP script.  I've been using links like:
> 
> <a href="myscript.php?action=myaction&page=mypage">My link</a>
> 
> I can "get" the values of action and page in the script and output the
> html accordingly.  This works great, but then I noticed that the URL
> in the address bar of the browser displays ugly stuff like:
> http://www.mydomain.com/myscript.php?action=myaction&page=mypage 
> 
> Of course there has to be a simpler way to clean things up.  Any
> ideas?
> 
> Thanks,
> 
> Bruce
> 

Does the URL have a side effect (update a db for instance) or is it 
simply to choose another view of your data?

In the fist case, can you put the link in a form and use POST instead of 
GET?  POST has some protection againt duoble submittal (the browser will 
at least ask first).

In the second case, it's appropriate to have those values in the URL.  
If you object to the ? and & characters, (and you use Apache) use 
mod_rewrite in a .htaccess file so you can refer to the url as 
http://www.mydomain.com/mypage/myaction

Does that give you any ideas?

Regards,
Mark
EMAIL:PROTECTED


_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members