thanks all for the help.
The scripts are now working fine, but It doesnt display information or post by the user. Thanks again for all post.
==============
<?php //connect to database
include ("db_connect.php");
$match = "SELECT id FROM registration WHERE username = '".$_POST['username']."' AND password = '".$_POST['password']."';";
$qry = mysql_query($match)
or die ("could not match data because ".mysql_error());
$num_rows = mysql_num_rows ($qry);
if ($num_rows <= 0)
{
echo "Sorry,there is no Username $username with the specified password.<br>";
echo "<a href="" Again,</a>";
exit;
}else{
// form and execute query statement
$query = "SELECT first, family, email FROM registration WHERE username = '$username'";
$result = mysql_query($query);
// matches found, format records
list ($first, $family, $email) = mysql_fetch_row ($result);
print "<h2>User Information:</h2>";
print "<b>First:</b> $first <br>";
print "<b>Family:</b> $family <br>";
print "<b>Email:</b> $email <br>";
print "<h2>Post Information:</h2>";
// form n execute 'post' query
$query = "SELECT username, post, date FROM post WHERE username = '$username' ORDER BY date DESC";
$result = mysql_query ($query);
print "<table border = 1>";
print "<tr><th>Username</th><th>Post</th><th>Date</th></tr>";
// format and display return rows
while (list ($username, $post, $date) = mysql_fetch_row ($result)):
print "<tr>";
print "<td>$username</td><td>$post</td><td>$date</td>";
print "</tr>";
endwhile;
print "</table>";
setcookie ("loggedin", "TRUE", time()+(3600 * 24));
setcookie ("mysite_username", "$username");
echo "You are now logged in!<br>";
echo "Click Here:<a href="" Out.</a>";
}?>
==============
I am a Sun, impatiently waiting for dawn.
---------------------------------
Blab-away for as little as 1ยข/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
[Non-text portions of this message have been removed]
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
SPONSORED LINKS
| Php mysql | Job postings |
YAHOO! GROUPS LINKS
- Visit your group "php-list" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
