Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting query string based on URL directory string? 2

Status
Not open for further replies.

jpo245

Programmer
Jan 16, 2005
45
US
Hi everyone, I've been puzzling over this, and can't seem to find the correct key words to do a search on google for answers.

Basically, how do i extract query string based on a "Directory" that a user types in the URL?

For example, if the user types in:
I want my php script to do a search for "PHP" and "Editor"

Another example:
URL: Result: Php script searches for "GOOD UTILITIES"

and hopefully i'd be able to add even more functionality where if i precede the text argument by symbols

other ideas are for example,

URL: would tell the php script to list details of user called "userjohn"

URL: would tell the script to list all new users created after the date 2003/12/05 etc...

Thanks!


Any help would be much appreciated!
 
To do the functionality you want, you'd likely need to look into [tt]mod_rewrite[/tt], which is quite a complicated concept. However, there are a lot of tutorials out there to help you along the way.

Basically, you'd tell Apache where to map a url. So, for instance, I could type and you could map it (behind the scenes) to
Similarly, you could map to
So, mod_rewrite seems to be one effective way to go.

*cLFlaVA
----------------------------
[tt]tastes great, less filling.[/tt]
 
dude you are awesome...

mod_rewrite, thats all i needed to know!!

kudos to u!!

thanks a crazillion
 
cool. i just implemented mod_rewrite on my site, so I am familiar with the basics. let us know if you need any help along the way.

*cLFlaVA
----------------------------
[tt]tastes great, less filling.[/tt]
 
another way to go, is thru .htaccess and defining a php page to run as php, without extension.

then you can make the php-page:
search (no .php in the name)

.htaccess will define it to run as PHP.

I posted some samples of this on this forum, but I only rewrote something I found on (searchfriendly urls part I and II).

you can then explode the url.

Olav Alexander Mjelde
Admin & Webmaster
 
thanks dabutcher, that definitely is very helpful.... great resource man!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top