Bitcoin Forum
June 08, 2024, 12:10:45 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: [Bounty] Fix this php code for me .5 btc  (Read 11960 times)
BitcoinINV (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
September 06, 2012, 09:53:07 PM
 #1

<?php
$con = mysql_connect("localhost","]","");
if (!$con)
{
die('Could not connect: ' .mysql_error());
}
mysql_select_db("", $con);
$username=$_POST['skiz22285'];
$result = mysql_query("SELECT * FROM `users` LIMIT 0, 30 ");
echo "<table border='1'>
<tr>

<th> Email </th>
<th> username </th>

</tr>";

{
echo "<tr>";

echo "<td>" .$row['email'] ."</td>";
echo "<td>" .$row['username'] ."</td>";

echo "</tr>";
}
echo "</table>";
mysql_close ($con);
?>
<html>
<body>
Login Successful
<p><a href="index.php\">Click here to logout!</a></p>
</body>
</html>


What I need it to do is display the users mysql information, right now its just posting the email and username with no database outputs.

Bitsky
Hero Member
*****
Offline Offline

Activity: 576
Merit: 514


View Profile
September 06, 2012, 09:58:40 PM
 #2

Try this:
Code:
$rows=mysql_num_rows($result);
for ($i=0; $i<$rows; $i++)
{
$row=mysql_fetch_array($result);
echo "<tr>";
echo "<td>" .$row['email'] ."</td>";
echo "<td>" .$row['username'] ."</td>";
echo "</tr>";
}
If you don't need an incrementing counter, you could also do
Code:
while ($row=mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" .$row['email'] ."</td>";
echo "<td>" .$row['username'] ."</td>";
echo "</tr>";
}
instead of the for-loop

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
BitcoinINV (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
September 06, 2012, 10:04:38 PM
 #3

Try this:
Code:
$rows=mysql_num_rows($result);
for ($i=0; $i<$rows; $i++)
{
$row=mysql_fetch_array($result);
echo "<tr>";--------------------------------------------------------------------- Parse error
echo "<td>" .$row['email'] ."</td>";
echo "<td>" .$row['username'] ."</td>";
echo "</tr>";
}
If you don't need an incrementing counter, you could also do
Code:
while ($row=mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" .$row['email'] ."</td>";
echo "<td>" .$row['username'] ."</td>";
echo "</tr>";
}
instead of the for-loop

Get a parse error

Bitsky
Hero Member
*****
Offline Offline

Activity: 576
Merit: 514


View Profile
September 06, 2012, 10:14:32 PM
 #4

Just tested the following code without any problems
Code:
<html>
<body>
<?php
$con
=mysql_connect('localhost''user''pass');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db("db"$con);
$username=$_POST['skiz22285'];
$result=mysql_query("SELECT * FROM users LIMIT 0, 30");
echo 
"<table border='1'>
<tr>
<th>Email</th>
<th>Username</th>
</tr>"
;
$rows=mysql_num_rows($result);
for (
$i=0$i<$rows$i++)
{
$row=mysql_fetch_array($result);
echo "<tr>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['username']."</td>";
echo "</tr>";
}
echo 
"</table>";
mysql_close ($con);
?>

Login Successful
<p><a href="index.php\">Click here to logout!</a></p>
</body>
</html>
Also tested the while-loop with no problems.

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
BitcoinINV (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
September 06, 2012, 11:32:17 PM
 #5

The problem with that is it displays all the mysql data, its not user specific.

dree12
Legendary
*
Offline Offline

Activity: 1246
Merit: 1077



View Profile
September 06, 2012, 11:45:16 PM
Last edit: September 07, 2012, 01:11:12 AM by dree12
 #6

<?php
$con
=mysql_connect('localhost''user''pass');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db("db"$con);
$username=$_POST['skiz22285'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>
Note that this uses $_POST['skiz22285'], which is probably not what you want.
BitcoinINV (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
September 07, 2012, 12:38:56 AM
 #7

the skiz22285 thing is just something for a troubleshooting guide I was reading but when I ran your code i got
Parse error: syntax error, unexpected T_VARIABLE  on line 78

gweedo
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000


View Profile
September 07, 2012, 12:41:32 AM
 #8

Code:
<?php
$con
=mysql_connect('localhost''user''pass');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db("db"$con);
$username=$_POST['skiz22285'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

he forgot a ; on the line of

Code:
$username=mysql_real_escape_string($username)
dree12
Legendary
*
Offline Offline

Activity: 1246
Merit: 1077



View Profile
September 07, 2012, 01:11:31 AM
 #9

Code:
<?php
$con
=mysql_connect('localhost''user''pass');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db("db"$con);
$username=$_POST['skiz22285'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

he forgot a ; on the line of

Code:
$username=mysql_real_escape_string($username)
That was it. Fixed now, it should work.
BitcoinINV (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
September 07, 2012, 01:14:22 AM
 #10

when you first login it  shows it for about 1 second then goes it goes away.

payb.tc
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
September 07, 2012, 01:18:15 AM
 #11

when you first login it  shows it for about 1 second then goes it goes away.

goes away to what? a blank page?
dree12
Legendary
*
Offline Offline

Activity: 1246
Merit: 1077



View Profile
September 07, 2012, 01:20:16 AM
 #12

when you first login it  shows it for about 1 second then goes it goes away.
Try this full HTML page:

Code:
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>
<p>
<?php
$con
=mysql_connect('localhost''user''pass');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db("db"$con);
$username=$_POST['skiz22285'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

</p>
</body>
</html>
BitcoinINV (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
September 07, 2012, 01:21:19 AM
 #13

no the users info shows up for a second then it goes away. Here is the whole page code
Code:
<?php
/*
**********
Member Page
**********
*/
/* Include Code */
include("assets/member.inc.php");
/* Is an Action set? */
if(isset($_GET['action'])) {
$action $_GET['action'];
} else {
$action null;
}
if(isset(
$_GET['subaction'])) {
$subaction $_GET['subaction'];
} else {
$subaction null;
}
if(
$action == 'logout') {
echo $member->logout();
$title 'Logging user out';
$content '<div class="notice info">You are being logged out...</div>';
} elseif(
$action == 'settings') {
$member->LoggedIn();
$user $member->data();
if($subaction == 'password') {
$title   'Change Password';
$content $member->changePassword($user->id);
} elseif($subaction == 'email') {
$title   'Change E-Mail';
$content $member->changeEmail($user->id);
} elseif($subaction == 'delete') {
$title   'Delete Account';
$content $member->deleteAccount($user->id);
} else {
$title   'Settings';
$content '<a href="member.php?action=settings&amp;subaction=password" class="button full">Change Password</a><a href="member.php?action=settings&amp;subaction=email" class="button full">Change E-Mail</a><a href="member.php?action=settings&amp;subaction=delete" class="button full">Delete Account</a>';
}
} elseif(
$action == 'register') {
$title   'Create an account';
$content $member->register() . '<p class="options group"><a href="member.php?action=login">Already have an account?</a> &bull; <a href="member.php?action=recover-password">Recover Password</a></p>';
} elseif(
$action == 'recover-password') {
$title   'Recover your password';
$content $member->recoverPassword() . '<p class="options group"><a href="member.php?action=login">Already have an account?</a></p>';
} elseif(
$action == 'verification') {
$title   'Your account has been verified';
$content $member->verification() . '<p class="options group"><a href="member.php?action=login">Already have an account?</a></p>';
} else {
$title   'Login';
$content =  $member->login() . '<p class="options group"><a href="member.php?action=register">Register</a> &bull; <a href="member.php?action=recover-password">Recover Password</a></p>';
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
</head>
<body>
<div id="members" class="group">
<h1><?php echo $title?></h1>
<?php echo $content?>
<html>
<body>
<?php
$con
=mysql_connect('localhost''xxx''xxxxx');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db("xxxxxx"$con);
$username=$_POST['username'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

Login Successful
<p><a href="index.php\">Click here to logout!</a></p>
</body>
</html>

scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
September 07, 2012, 01:22:46 AM
 #14

when you first login it  shows it for about 1 second then goes it goes away.

I think whoever fixed the code, has earned their bounty -- 99% sure this has nothing to do with the code you originally posted.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
payb.tc
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
September 07, 2012, 01:24:03 AM
 #15

no the users info shows up for a second then it goes away. Here is the whole page code
Code:
<?php
/*
**********
Member Page
**********
*/
/* Include Code */
include("assets/member.inc.php");
/* Is an Action set? */
if(isset($_GET['action'])) {
$action $_GET['action'];
} else {
$action null;
}
if(isset(
$_GET['subaction'])) {
$subaction $_GET['subaction'];
} else {
$subaction null;
}
if(
$action == 'logout') {
echo $member->logout();
$title 'Logging user out';
$content '<div class="notice info">You are being logged out...</div>';
} elseif(
$action == 'settings') {
$member->LoggedIn();
$user $member->data();
if($subaction == 'password') {
$title   'Change Password';
$content $member->changePassword($user->id);
} elseif($subaction == 'email') {
$title   'Change E-Mail';
$content $member->changeEmail($user->id);
} elseif($subaction == 'delete') {
$title   'Delete Account';
$content $member->deleteAccount($user->id);
} else {
$title   'Settings';
$content '<a href="member.php?action=settings&amp;subaction=password" class="button full">Change Password</a><a href="member.php?action=settings&amp;subaction=email" class="button full">Change E-Mail</a><a href="member.php?action=settings&amp;subaction=delete" class="button full">Delete Account</a>';
}
} elseif(
$action == 'register') {
$title   'Create an account';
$content $member->register() . '<p class="options group"><a href="member.php?action=login">Already have an account?</a> &bull; <a href="member.php?action=recover-password">Recover Password</a></p>';
} elseif(
$action == 'recover-password') {
$title   'Recover your password';
$content $member->recoverPassword() . '<p class="options group"><a href="member.php?action=login">Already have an account?</a></p>';
} elseif(
$action == 'verification') {
$title   'Your account has been verified';
$content $member->verification() . '<p class="options group"><a href="member.php?action=login">Already have an account?</a></p>';
} else {
$title   'Login';
$content =  $member->login() . '<p class="options group"><a href="member.php?action=register">Register</a> &bull; <a href="member.php?action=recover-password">Recover Password</a></p>';
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
</head>
<body>
<div id="members" class="group">
<h1><?php echo $title?></h1>
<?php echo $content?>
<html>
<body>
<?php
$con
=mysql_connect('localhost''xxx''xxxxx');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db("xxxxxx"$con);
$username=$_POST['username'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

Login Successful
<p><a href="index.php\">Click here to logout!</a></p>
</body>
</html>

well first of all, this code has two heads

remove one of them:

<head>
   <title><?php echo $title; ?></title>
   <!--CSS Files-->
   <link rel="stylesheet" type="text/css" href="assets/css/style.css" />


then change

<?php echo $content; ?>
   <html>
<body>
<?php

to

<?php echo $content; ?>
<?php
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
September 07, 2012, 01:27:07 AM
 #16

no the users info shows up for a second then it goes away. Here is the whole page code

You've got nested <head>'s and <body>'s, this could cause the "going away".

no the users info shows up for a second then it goes away. Here is the whole page code

EDIT: bah, you can't put formatting into the middle of code blocks.

What payb.tc said. Smiley

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
BitcoinINV (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
September 07, 2012, 01:31:46 AM
 #17

when you first login it  shows it for about 1 second then goes it goes away.

I think whoever fixed the code, has earned their bounty -- 99% sure this has nothing to do with the code you originally posted.

I was getting the same results as, I am with there code so...
no the users info shows up for a second then it goes away. Here is the whole page code
Code:
<?php
/*
**********
Member Page
**********
*/
/* Include Code */
include("assets/member.inc.php");
/* Is an Action set? */
if(isset($_GET['action'])) {
$action $_GET['action'];
} else {
$action null;
}
if(isset(
$_GET['subaction'])) {
$subaction $_GET['subaction'];
} else {
$subaction null;
}
if(
$action == 'logout') {
echo $member->logout();
$title 'Logging user out';
$content '<div class="notice info">You are being logged out...</div>';
} elseif(
$action == 'settings') {
$member->LoggedIn();
$user $member->data();
if($subaction == 'password') {
$title   'Change Password';
$content $member->changePassword($user->id);
} elseif($subaction == 'email') {
$title   'Change E-Mail';
$content $member->changeEmail($user->id);
} elseif($subaction == 'delete') {
$title   'Delete Account';
$content $member->deleteAccount($user->id);
} else {
$title   'Settings';
$content '<a href="member.php?action=settings&amp;subaction=password" class="button full">Change Password</a><a href="member.php?action=settings&amp;subaction=email" class="button full">Change E-Mail</a><a href="member.php?action=settings&amp;subaction=delete" class="button full">Delete Account</a>';
}
} elseif(
$action == 'register') {
$title   'Create an account';
$content $member->register() . '<p class="options group"><a href="member.php?action=login">Already have an account?</a> &bull; <a href="member.php?action=recover-password">Recover Password</a></p>';
} elseif(
$action == 'recover-password') {
$title   'Recover your password';
$content $member->recoverPassword() . '<p class="options group"><a href="member.php?action=login">Already have an account?</a></p>';
} elseif(
$action == 'verification') {
$title   'Your account has been verified';
$content $member->verification() . '<p class="options group"><a href="member.php?action=login">Already have an account?</a></p>';
} else {
$title   'Login';
$content =  $member->login() . '<p class="options group"><a href="member.php?action=register">Register</a> &bull; <a href="member.php?action=recover-password">Recover Password</a></p>';
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
</head>
<body>
<div id="members" class="group">
<h1><?php echo $title?></h1>
<?php echo $content?>
<html>
<body>
<?php
$con
=mysql_connect('localhost''xxx''xxxxx');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db("xxxxxx"$con);
$username=$_POST['username'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

Login Successful
<p><a href="index.php\">Click here to logout!</a></p>
</body>
</html>

well first of all, this code has two heads

remove one of them:

<head>
   <title><?php echo $title; ?></title>
   <!--CSS Files-->
   <link rel="stylesheet" type="text/css" href="assets/css/style.css" />


then change

<?php echo $content; ?>
   <html>
<body>
<?php

to

<?php echo $content; ?>
<?php

Still nothing lol been working on this for close to 3 hours now...... brain fried
fixed all that payb.tc said with no avail lol, came from all the cuting and pasting trying to fix this dang thing

BitcoinINV (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
September 07, 2012, 01:33:13 AM
 #18

Update on what the code looks like so far


Code:
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />


<body>
<div id="members" class="group">
<?php echo $content?>

<?php
<?php
$con
=mysql_connect('localhost''''');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db(""$con);
$username=$_POST['username'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

</p>
</body>
</html>

Login Successful
<p><a href="index.php\">Click here to logout!</a></p>
</body>
</html>

gweedo
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000


View Profile
September 07, 2012, 01:35:36 AM
 #19

Update on what the code looks like so far


Code:
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />


<body>
<div id="members" class="group">
<?php echo $content?>

<?php
<?php
$con
=mysql_connect('localhost''''');
if (!
$con) { die('Could not connect: '.mysql_error()); }
mysql_select_db(""$con);
$username=$_POST['username'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

</p>
</body>
</html>

Login Successful
<p><a href="index.php\">Click here to logout!</a></p>
</body>
</html>

remove the ?> at the top
dree12
Legendary
*
Offline Offline

Activity: 1246
Merit: 1077



View Profile
September 07, 2012, 01:36:58 AM
 #20

Update on what the code looks like so far


Code:
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />


<body>
<div id="members" class="group">
<?php echo $content?>

<?php
$username
=$_POST['username'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

</p>
</body>
</html>

Login Successful
<p><a href="index.php\">Click here to logout!</a></p>
</body>
</html>

Do the following:
  • Remove ?> at the beginning of the code.
  • Add "</head>" after    <link rel="stylesheet" type="text/css" href="assets/css/style.css" />
  • Add "</div>" after <?php echo $content; ?>
  • Add "<p>" after the </div> you just added.
  • Remove the first "</body></html>", located right after the </p>.
  • Put back the "$con=mysql_connect('localhost', '', '');
    if (!$con) { die('Could not connect: '.mysql_error()); }
    mysql_select_db("", $con);".

The code should look like this:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title?></title>
<!--CSS Files-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
</head>

<body>
<div id="members" class="group">
<?php echo $content?>
</div>

<p>
<?php
$con
=mysql_connect('localhost''''') or die('Could not connect: '.mysql_error());
mysql_select_db(""$con);
$username=$_POST['username'];
$username=mysql_real_escape_string($username);
$result=mysql_query("SELECT * FROM users WHERE username='$username'");
$row=mysql_fetch_array($result);
echo 
"Email: ".$row['email']."<br/>";
echo 
"Username: ".$row['username'];
mysql_close ($con);
?>

</p>

Login Successful
<p><a href="index.php\">Click here to logout!</a></p>
</body>
</html>
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!