users details
I have looked on the net and had a play around but it dosnt seem to be working
help would be great thanks
Eric
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "********";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("SELECT * FROM users WHERE username = '$username'");
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['name'];
echo $row['age'];
echo $row['website'];
echo $row['email'];
echo $row['username;quote;madashat_users";
$dbuser = "madashat_eric";
$dbpass = "********";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("SELECT * FROM users WHERE username = '$username'");
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['name'];
echo $row['age'];
echo $row['website'];
echo $row['email'];
echo $row['username'];
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
?>Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);Code: Select all
<form name="login" method="post" action="login.php">
<table border="0" width="225" align="center">
<tr>
<td width="219" bgcolor="#999999">
<p align="e;center"e;><font color="e;white"e;><span style="e;font-size:12pt;"e;><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "gateway2";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
$query = "select * from users where username='$username' and password='$password'";
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "Bad Login";
include "login.html";
} else {
$_SESSION[‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysqm name="login" method="post" action="login.php">
<table border="e;0"e; width="e;225"e; align="e;center">
<tr>
<td width="219"e; bgcolor="e;#999999"e;>
<p align="e;center"e;><font color="e;white"e;><span style="e;font-size:12pt;"e;><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$query = "e;select * from users where username='$username' and password='$password'"e;;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "e;Bad Login"e;;
include "e;login.html"e;;
} else {
$_SESSIONї‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $rowї'firstname'];
echo $rowї'lastname'];
echo $rowї'address'];
echo $rowї'age'];
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysqlalign="center">
<tr>
<td width="219" bgcolor="#999999"e;>
<p align="e;center"e;><font color="e;white"e;><span style="e;font-size:12pt;"e;><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$query = "e;select * from users where username='$username' and password='$password'"e;;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "e;Bad Login"e;;
include "e;login.html"e;;
} else {
$_SESSIONї‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $rowї'firstname'];
echo $rowї'lastod="post" action="login.php">
<table border="0" width="225"e; align="e;center"e;>
<tr>
<td width="219" bgcolor="#999999">
<p align="e;center"e;><font color="e;white"e;><span style="e;font-size:12pt;"e;><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$query = "e;select * from users where username='$username' and password='$password'"e;;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "e;Bad Login"e;;
include "e;login.html"e;;
} else {
$_SESSIONї‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
lCode: Select all
<form name="login" method="post" action="login.php">
<table border="0" width="225" align="center">
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;>
<p align="e;center"e;><font color="e;white"e;><span style="e;font-size:12pt;"e;><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$query = "e;select * from users where username='$username' and password='$password'"e;;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "e;Bad Login"e;;
include "e;login.html"e;;
} else {
$_SESSIONї‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $rowї'firstname'];
echo $rowї'lastna login which works fine.
login.htmlCode: Select all
<form name="login" method="post" action="login.php">
<table border="0" width="225"e; align="e;center"e;>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;>
<p align="e;center"e;><font color="e;white"e;><span style="e;font-size:12pt;"e;><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$query = "e;select * from users where username='$username' and password='$password'"e;;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "e;Bad Login"e;;
include "e;login.html"e;;
} else {
$_SESSIONї‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $rowї'firstname'];
echo $rowї'lastname'];
echo $rowї'address'];
login which works fine.
login.htmlCode: Select all
<form name="login" method="post" action="login.php">
<table border="0" width="225" align="center"e;>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;>
<p align="e;center"e;><font color="e;white"e;><span style="e;font-size:12pt;"e;><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$query = "e;select * from users where username='$username' and password='$password'"e;;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "e;Bad Login"e;;
include "e;login.html"e;;
} else {
$_SESSIONї‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $rowї'firstname'];
echo $rowї'lastname'];
echo $rowї'address'];
echo $rowї'age'];
}
// Free the resources associuote;login" method="post" action="login.php">
<table border="0" width="225" align="center">
<tr>
<td width="219" bgcolor="#999999">
<p align="center"><font color="white"><span style="font-size:12pt;"><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="219">
<table border="0" width="220" align="center">
<tr>
<td width="71"><span style="font-size:10pt;">Username:</span></td>
<td width="139"><input type="text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$query = "e;select * from users where username='$username' and password='$password'"e;;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "e;Bad Login"e;;
include "e;login.html"e;;
} else {
$_SESSIONї‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "ed="post" action="login.php"e;>
<table border="e;0"e; width="225" align="center">
<tr>
<td width="219" bgcolor="#999999"e;>
<p align="e;center"e;><font color="e;white"e;><span style="e;font-size:12pt;"e;><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$query = "e;select * from users where username='$username' and password='$password'"e;;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "e;Bad Login"e;;
include "e;login.html"e;;
} else {
$_SESSIONї‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row() fine.
login.htmlCode: Select all
<form name="login" method="e;post"e; action="e;login.php"e;>
<table border="0" width="225" align="center">
<tr>
<td width="e;219" bgcolor="#999999">
<p align="e;center"e;><font color="white"><span style="font-size:12pt;"><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POSTї'username'];
$password = $_POSTї'password'];
$query = "e;select * from users where username='$username' and password='$password'"e;;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "e;Bad Login"e;;
include "e;login.html"e;;
} else {
$_SESSIONї‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "e;localhost"e;;
$dbname = "e;madashat_users"e;;
$dbuser = "e;madashat_eric"e;;
$dbpass = "e;gateway2"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assamp;lt;tr>
<td width="219" bgcolor="#999999">
<p align="center"><font color="white"><span style="font-size:12pt;"><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="219">
<table border="0" width="220" align="center">
<tr>
<td width="71"><span style="font-size:10pt;">Username:</span></td>
<td width="139"><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="71"><span style="font-size:10pt;">Password:</span></td>
<td width="139"><input type="password" name="password"></td>
</tr>
<tr>
<td width="71"> </td>
<td width="139">
<p align="right"><input type="submit" name="submit" value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
code]
<form name="login"e; method="e;post"e; action="e;login.php"e;>
<table border="e;0"e; width="e;225"e; align="e;center"e;>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;>
<p align="e;center"e;><font color="e;white"e;><span style="e;font-size:12pt;"e;><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="e;219"e;>
<table border="e;0"e; width="e;220"e; align="e;center"e;>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Username:</span></td>
<td width="e;139"e;><input type="e;text"e; name="e;username"e;></td>
</tr>
<tr>
<td width="e;71"e;><span style="e;font-size:10pt;"e;>Password:</span></td>
<td width="e;139"e;><input type="e;password"e; name="e;password"e;></td>
</tr>
<tr>
<td width="e;71"e;>&nbsp;</td>
<td width="e;139"e;>
<p align="e;right"e;><input type="e;submit"e; name="e;submit"e; value="e;Submit"e;></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="e;219"e; bgcolor="e;#999999"e;><font color="e;white"e;>Not Registered? </font><a href="e;register.html"e; target="e;_self"e;><font color="e;white"e;>Register</font></a><font color="e;white"e;> </font><b><i><font color="e;white"e;>Now!</font></i></b></td>
</tr>
</table>
</form>Code: Select all
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "gateway2";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
$query = "select * from users where username='$username' and password='$password'";
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "Bad Login";
include "login.html";
} else {
$_SESSION[‘username’] = $username;
include ('http://eric.madashatters.com/memberspage.php?');
}
?>Code: Select all
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "gateway2";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = ("SELECT * FROM users WHERE username = '$username'");
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['firstname'];
echo $row['lastname'];
echo $row['address'];
echo $row['age'];
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
?>Should beCode: Select all
$_SESSION[‘username’] = $username; include ('http://eric.madashatters.com/memberspage.php?');
Code: Select all
if (!isset($_SESSION)) session_start();
$_SESSION['username'] = $username;
include ('http://eric.madashatters.com/memberspage.php?');Should beCode: Select all
$query = ("SELECT * FROM users WHERE username = '$username'")/eric.madashatters.com/memberspage.php?');
Code: Select all
if (!isset($_SESSION)) session_start();
$_SESSION['username'] = $username;
include ('http://eric.madashatters.com/memberspage.php?');Should beCode: Select all
$query = ("SELECT * FROM users WHERE username = '$username'");
Code: Select all
if (!isset($_SESSION)) session_start();
$username = $_SESSclude ('http://eric.madashatters.com/memberspage.php?');Should beCode: Select all
$query = ("SELECT * FROM ');
Code: Select all
if (!isset($_SESSION)) session_start();
$_SESSION['username'] = $username;
include ('http://eric.madashatters.com/memberspage.php?');Should beCode: Select all
$query = ("SELECT * FROM users WHERE username = 'username’] = $username; include ('http://eric.madashatters.com/memberspage.php?');
Code: Select all
if (!isset($_SESSION)) session_start();
$_SESSION['username'] = $username;
include ('http://eric.madashatters.com/memberspage.php?');Should beCode: Select all
$query = ("e;SELECT * FRCode: Select all
$_SESSION[‘username’] = $username; include ('http://eric.madashatters.com/memberspage.php?');
Code: Select all
if (!isset($_SESSION)) session_start();
$_SESSION['username'] = $username;
include ('http://eric.madashatters.com/memberspage.php?');Should beCode: Select all
$query = ("e;SELECT * FROM users WHERE username = '$username'&amCode: Select all
$_SESSION[‘username’] = $username; include ('http://eric.madashatters.com/memberspage.php?');
Code: Select all
if (!isset($_SESSION)) session_start();
$_SESSION['username'] = $username;
include ('http://eric.madashatters.com/memberspage.php?');Shoultters.com/memberspage.php?');Code: Select all
$query = ("SELECT * FROM users WHERE username = '$username'");
Code: Select all
if (!isset($_SESSION)) session_start();
$_SESSION['username'] = $username;
include ('http://eric.madashatters.com/memberspage.php?');Should beCode: Select all
$query = ("SELECT * FROM users WHERE username = '$username'");
Code: Select all
if (!isset($_SESSION)) session_start();
$username = $_SESSION['username'];
$query = ("SELECT * FROM users WHERE username = '$username'");Code: Select all
if (!isset($_SESSION)) session_start();
$_SESSION['username'] = $username;
include ('http://eric.madashatters.com/memberspage.php?');Should beCode: Select all
$query = ("SELECT * FROM users WHERE $_SESSION[‘username’] = $username; include ('http://eric.madashatters.com/memberspage.php?');
Code: Select all
if (!isset($_SESSION)) session_start();
$_SESSION['username'] = $username;
include ('http://eric.madashatters.com/memberspage.php?');Should beCode: Select all
$query = ("SELECT * FROM users WHERE username = '$username'");
Code: Select all
if (!isset($_SESSION)) session_start();
$username = $_SESSION['username'];
$query = ("SELECT * FROM users WHERE username = '$username'");Code: Select all
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "********";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
if (!isset($_SESSION)) session_start();$username = $_SESSION['username'];
$query = ("SELECT * FROM users WHERE username = '$username'");
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['name'];
echo $row['age'];
echo $row['email'];1]
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "********";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
if (!isset($_SESSION)) session_start();$username = $_SESSION['username'];
$query = ("SELECT * FROM users WHERE username = '$username'");
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['name'];
echo $row['age'];
echo $row['email'];
echo $row['website'];
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
?>Code: Select all
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "********";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
if (!isset($_SESSION)) session_start();$username = $_SESSIONї'username'];
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $rowї'name'];
echo $rowї'age'];
echo $rowї'email'];
echo $rowї'website'];
}
// Free the resources associated with the result nothing shown on my memberspage.php
the code i have for it now isCode: Select all
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "********"e;;
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("e;Could not connect: "e;.mysql_error());
mysql_select_db($dbname) or die(mysql_error());
if (!isset($_SESSION)) session_start();$username = $_SESSIONї'username'];
$query = ("e;SELECT * FROM users WHERE username = '$username'"e;);
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "e;\n"e;;
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $rowї'name'];
echo $rowї'age'];
echo $rowї'email'];
echo $rowї'website'];
}
// Free the resources associated with the result set
// This is done automatically at t nothing shown on my memberspage.php
the code i have for it now isCode: Select all
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "********";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
if (!isset($_SESSION)) session_start();$username = $_SESSION['username'];
$query = ("SELECT * FROM users WHERE username = '$username'");
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['name'];
echo $row['age'];
echo $row['email'];
echo $row['website'];
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
?&
<?php
$dbhost = "localhost";
$dbname = "madashat_users";
$dbuser = "madashat_eric";
$dbpass = "********";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
if (!isset($_SESSION)) session_start();$username = $_SESSION['username'];
$query = ("SELECT * FROM users WHERE username = '$username'");
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['name'];
echo $row['age'];
echo $row['email'];
echo $row['website'];
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
?>Code: Select all
tags [b]not[/b]Code: Select all
tags when posting PHP code [/color]huh? I didn't even post in here lolericburnard wrote:OMG thank you very much Burrito that is the simplist anyone has made it for me. It works now
and im sorry Jcart i totaly forgot i had posted this one :p sorry
thanks again
Eric