Custom URL
#1
Posted 25 January 2006 - 02:22 PM
#2
Posted 25 January 2006 - 02:36 PM
users.php?user=bob
#3
Posted 25 January 2006 - 02:56 PM
#4
Posted 25 January 2006 - 03:00 PM
<?php
$username = mysql_real_escape_string($_GET['user']);
$sql = "SELECT * FROM `users` WHERE `username` = '$username' LIMIT 1";
$q = mysql_query($sql);
$n = mysql_num_rows($q);
if ($n) {
$r = mysql_fetch_assoc($q);
echo "The username is: $r[username]";
} else {
die('Username not found.');
}
?>
Something like that, you should get the jist of it
Edited by HaloprO, 25 January 2006 - 03:01 PM.
#5
Posted 25 January 2006 - 03:02 PM
http://www.pixel2life.com/forums/index.php...&hl=php+include
#6
Posted 25 January 2006 - 03:10 PM
#7
Posted 25 January 2006 - 03:39 PM
#8
Posted 25 January 2006 - 04:14 PM
#9
Posted 25 January 2006 - 04:22 PM
what im trying to do is sort of what the topic avalanche put... like the index.php?section=support... basically thats what im trying to do.
#10
Posted 25 January 2006 - 04:46 PM
#11
Posted 25 January 2006 - 06:18 PM
But demonix, that stuff after and including the '?' in the url is known as a query string. In php, you get stuff out of that string through the $_GET var.
http://www.php.net/manual/en/reserved.vari...d.variables.get <-- more info.
#12
Posted 26 January 2006 - 10:45 AM
#13
Posted 27 January 2006 - 02:47 PM
#14
Posted 27 January 2006 - 04:06 PM
#15
Posted 27 January 2006 - 05:18 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
