Jump to content

Sessions vs. Parameters


aldrin151

Recommended Posts

Hello everyone, I'm trying build a website and trying to eliminate which parameters are being passed on the url address bar. I'm trying to convert my site which is mostly passing parameters and converting the parameters to sessions. I was wondering if this is a conventional way if I have many parameters for example

 

http://192.168.0.101/test/user_search.php?title=&description=&category=Computer+Services&miles=30&sttileonly=on&FormListResults_Page=&mid=227

 

and also is there an easier way to eliminate the viewing of ?title=&description=&category and so on to the user on the address bar?

 

Thanks  :)

Link to comment
https://forums.phpfreaks.com/topic/126690-sessions-vs-parameters/
Share on other sites

What your looking for is a marriage of PATH_INFO and mod_rewrite.

 

 

You can take your url and make it http://<domainname>.tld/Computer_Services/search

 

or something even more appealing to you.  Try searching for Apache Mod_Rewrite on google.  Apache has wonderful documentation but sometimes it's a little heavy for beginners.

  • 2 weeks later...

A simple run down on how it works is as follows

 

[*]Apache Receives Request for a Path (ie /Computer/Services)

[*]Apache checks for any mod_rewrite rules affecting the path requested

[*]Appropriate rewrite rules will feed the path into a query string of index file sitting at the top level of path

[*]php parses index file which has path_info function to deal with what was sent

[*]PHP display appropriate information

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.