PDA

View Full Version : Filtering by URL


ZGeek
08-17-2005, 09:38 PM
Is is possible to make a filter that takes its conditions from the URL?

With my db, I'd like to make it so that when a person checks out the site, it only displays entries by them

http://www.zgeek.com/test/deft_payments_view.php

I can pass the value of the username from the site I've coded, but I have no idea if and how it is possible to do this.

I was thinking something close to

http://www.zgeek.com/test/deft_payments_view.php?deft_payments.username_log<=>Theusername

ZGeek
08-18-2005, 11:07 PM
hello? Anybody home?

sarg
08-21-2005, 12:46 PM
I guess nobody understands what you mean by:
"takes its conditions from the URL"

ZGeek
08-21-2005, 09:16 PM
damn terminology.

Basically I want to make it so people can search the database using a username. So they'd click on the url and it would automatically filter the search results displaying only with the records entered by their username.

markh
10-09-2005, 07:08 AM
$uri = substr(strstr( $_SERVER['QUERY_STRING'], '='),1);

use this snippet at at the beginning of your code, it will extract the query from url.

www yourname com/filename php?userID=55

your results will be 55

select * from databse where column = $uri

there ya go