-
Posts
162 -
Joined
-
Last visited
Never
Everything posted by Ads
-
umm fixed that error, When I log in It Just Displays "you are not allowed to acces this page" On mina.php And If i enter in the wrong info, loginck.php displays nothing. and On Loginck.php i changed that 'header location' thingy to this print "<script>"; print " self.location='main.php';"; print "</script>";
-
Am still getting this Error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
-
Notice: Undefined index: email line 17 Notice: Undefined index: password line 18 Notice: Undefined variable: check line 23 Query was empty
-
Cool loginck.php works, but now Main.php doesn;t, It says i am entering Incorrect Stuff <?php session_start(); ?> <?php include "include/db.php"; ?> <html> <head> <title> </title> <link href="style1.css" rel="stylesheet" type="text/css"> </head> <body> <?php $email = trim($_SESSION['email']); $password = trim($_SESSION['password']); $sql = "SELECT username FROM players WHERE email='$email' and password='$password'"; $sql = mysql_query($sql); $row = mysql_fetch_assoc($sql); $username = $row['username']; if (!isset($_COOKIE['username'])) { echo "you are not allowed to acces this page"; exit; } else { echo "logged in"; } ?> </body> </html>
-
Still nothing sorry Still getting the Erros
-
$row = mysql_fetch_assoc($check); Thats where the error is Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
-
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource useing that code above
-
Fixes the Error, but Gives back Nothing
-
only Problem now is i can't Login in at all.
-
oh i see, i don't think you can Do what you are looking for. But Don;t Hold me to it/
-
my Login pages logins no matter what i enter Login.php <!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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Login</title> <link href="style1.css" rel="stylesheet" type="text/css" /> </head> <body> <form method="post" action="loginck.php" target="_parent"> <p align="center"> <span class="style2">Enter Email:</span> <br> <input type="text" name="email"> <br> <span class="style2">Enter Passowrd:</span><br> <input type="password" name="password"> <br> <input name="Submit" type="submit" class="top" value="Submit"> </p> <p align="center"> </p> <p align="center"> </div> <strong>Messages:</strong> </p> </p> <div align="center">Working on</div> </body> </html> loginck.php <? session_start(); ?> <?php include "include/db.php"; ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <link href="style1.css" rel="stylesheet" type="text/css"> <title>(Type a title for your page here)</title> </head> <body> <? // convert username and password from _POST or _SESSION if($_POST['submit']){ $_SESSION['email']=$_POST["email"]; $_SESSION['password']=$_POST["password"]; } // query for a user/pass match $result=mysql_query("select * from players where email='" . $_SESSION['email'] . "' and password='" . $_SESSION['password'] . "'"); // retrieve number of rows resulted $num=mysql_num_rows($result); // print login form and exit if failed. if($num < 1){ echo "You are not authenticated. Please login.<br><br> "; exit; } print "<script>"; print " self.location='main.php';"; // Comment this line if you don't want to redirect print "</script>"; ?> </body> </html> main.php <?php session_start(); ?> <?php include "include/db.php"; ?> <html> <head> <title>Apples xD </title> <link href="style1.css" rel="stylesheet" type="text/css"> </head> <body> <?php $email = trim($_SESSION['email']); $sql = "SELECT username FROM players WHERE email = '$email'"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['username'] . "<br />"; } else { echo "No results found"; } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; } ?> </body> </html>
-
Thank You, That Fixed it Now Lots more Erros to Fix
-
Cool thanx, BUT, now it says That there are no results found? But there should be. heres the code. $email = $_SESSION['email']; $sql = "SELECT username FROM players WHERE email = '$email'"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['username'] . "<br />"; } else { echo "No results found"; } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; }
-
This is the New error i get: Query failed You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SELECT username FROM players WHERE email = $email = $_SESSION['email']; $sql = "SELECT username FROM players WHERE email = $email"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['username'] . "<br />"; } else { echo "No results found"; } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; } What i am trying to do is get the Persons Name to Be displayed By Finding there Email.
-
Query failed Unknown column 'data' in 'field list' SELECT data FROM players WHERE id = 1 LIMIT 1 Thats the Error $sql = "SELECT data FROM players WHERE id = 1 LIMIT 1"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['username'] . "<br />"; } else { echo "No results found"; } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; }
-
Could you Elberate any further on that?
-
I am haveing a realy bad day with PHp, I aplogise Here is My problem I want to request A Row of Data from a Table in the Data base? how do i do this
-
If you don't want the users to be able to do anything, Wont a Picture of the site be enough?
-
I don;t think so Lol I think i fixed it Problem was The Include was Before the Session Start
-
I still have the Error. ? session_start(); include "include/db.php"; ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <link href="style1.css" rel="stylesheet" type="text/css"> <title>(Type a title for your page here)</title> </head> <body> <? // convert username and password from _POST or _SESSION if($_POST){ $_SESSION['email']=$_POST["email"]; $_SESSION['password']=$_POST["password"]; } // query for a user/pass match $result=mysql_query("select * from players where email='" . $_SESSION['email'] . "' and password='" . $_SESSION['password'] . "'"); // retrieve number of rows resulted $num=mysql_num_rows($result); // print login form and exit if failed. if($num < 1){ echo "You are not authenticated. Please login.<br><br> "; exit; } ?>
-
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent Is that saying that Seesion arent Enabled on my PC?
-
I tried Useing them before, I got Mega Erros with it any Help there would be nice