|
Posted by Pedro Graca on 10/08/06 20:17
jflash top-posted:
> OK, I am now fairly thoroughly confused. What I am asking is for a way
> to have a page which can display information from a database filtered
> and/or sorted based on arguments supplied by the user in the URL. I
> wish I could explain it better, but that's the best way I know how.
> Anything else that I need to know, I suppose I can figure out later.
> Right now, I'm just trying to get the sorting/filtering down.
Can you make a page that displays "Hello, <USER>!" when <USER> comes
from the query string?
Suppose I go to http://www.yourserver.com/hello.php?user=Pedro
The "hello.php" script would be something like
<?php
if ((isset($_GET['user'])) && ($_GET['user'] != '')) {
echo "Hello, {$_GET['user']}!";
} else {
echo "Hello, anonymous!";
}
?>
It's just about the same thing when you want to use data from the query
string for database selection/sort. You just need to get the data and
incorporate it in the SQL commands (*after validating the data*).
--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
[Back to original message]
|