OK.
I am using a simple username and password form to pass details to a php file to verify a user. In my msql database I also have a field called 'url' that I want to pull out and display as a clickable link for each user (the url field is different for each user). Below is what I have so far. What do I need to add to get the url field for a particular user to print on the page - and where do I put it. If someone could copy and paste the below code to demonstrate I would much appreciate it!
Form results pass to the following php file:
<head>
<title>db</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
$connection = mysql_connect("localhost", "myusername", "mypassword")
or die ("Couldn't connect to server.");
$db = mysql_select_db("clients", $connection)
or die ("Couldn't select database.");
$sql = "SELECT id
FROM login
WHERE username='$username' and password='$password'";
$result = mysql_query($sql)
or die("Couldn't execute query.");
$num = mysql_numrows($result);
if ($num == 1) {
echo "<P>You are a valid user!<br>";
echo "Your username is $username<br>";
echo "Your password is $password<br>";
} else if ($num == 0) {
echo "You are not authorized!";
}
//what do I add to the above code to print the url field (located in the same table) when the user is brought to this page?
?>
</body>