Jump to content

Akenatehm

Members
  • Posts

    262
  • Joined

  • Last visited

    Never

Everything posted by Akenatehm

  1. Because I want to check if I am going i nthe right direction and working code might not always be good and neat code. How can I fix the quotes in the $create variable?
  2. Hey Guys, I was wondering if you could check over the following scripts and see if they are set out well and if the syntax in them is valid. <?php include "connect.php"; $author=$_POST['author']; $time=$_POST['time']; $insert = "INSERT INTO `chatrooms` (author,time) VALUES ($author,$time)"; $result= "SELECT `chat_id` FROM chatrooms where time = $time AND author = $author"; while($row = mysql_fetch_array($result)) { $create = "CREATE TABLE "chat_".$result."" ( username text, message text )"; } ?> <?php include "connect.php"; <?php if(isset($_POST['submit'])) { $message=$_POST['message']; $username=$_POST['username']; $chat_id=$_POST['chat_id']; if(strlen($message)<1) { print "Please Enter a Message."; } else { $insert = "INSERT INTO /$chat_id' (username,message) VALUES ($username, $message)"; } } ?>
  3. Hey Guys, I get the following error: With the following script: <?PHP include "connect.php"; // Checks the database for a user with a particular user name $check = mysql_query("select ID from users where username='$username' limit 1;"); // get a row count of the number of rows found if(mysql_num_rows($check) == 1) { echo "Username Already In Use."; } else { if(isset($_POST['submit'])) { $username=$_POST['username']; $password=$_POST['password']; $email=$_POST['email']; if(strlen($username)<1) { print "You did not enter a username."; } else if(strlen($password)<1) { print "You did not enter a password."; } else { $insert = "INSERT INTO `users` (username,password,email) VALUES ('".mysql_real_escape_string ($username)."','".mysql_real_escape_string ($password)."','".mysql_real_escape_string ($email)."','".mysql_real_escape_string; mysql_query($insert) or die("Could not insert comment" . mysql_error()); echo "User Added. <a href=\"home.html\">Click here</a> To Go Home."; } } } ?> Help would be great.
  4. Ok, I think i fixed it. I changed to this: $sql = "SELECT username FROM `users` WHERE username = '$username' AND password = '$password'";
  5. Ok here's the reply: It has a 1 on the end.
  6. It now giving the $errorMessage "Invalid Username or Password" but the details I am using are in the database.
  7. Ok. Now the page just goes blank and it looks like the session doesnt get created at all.
  8. Ugh. Such an obvious one. Damn. Sorry and Thanks.
  9. Hey Guys, This script is apart of a login script. It shows up this error: Here's the code: <?php // we must never forget to start the session session_start(); $errorMessage = ''; if (isset($_POST['username']) && isset($_POST['password'])) { include 'connect.php' $username = $_POST['username']; $password = $_POST['password']; // check if the user id and password combination exist in database $sql = "SELECT username FROM users WHERE username = '$username' AND password = password('$password')"; $result = mysql_query($sql) or die('Query failed. ' . mysql_error()); if (mysql_num_rows($result) == 1) { // the user id and password match, // set the session $_SESSION['db_is_logged_in'] = true; // after login we move to the main page header('Location: home.php'); exit; } else { $errorMessage = 'Sorry, wrong Username or Password'; } } ?> Help would be greatly appreciated!
  10. Ok then lol. But It won't change anything with the HTML in the files though will it?
  11. By renaming them, would it make much difference?
  12. Could you explain how to do this a bit better please? Could you maybe state the other ways and/or explain how to do them please and how i would go about setting this up?
  13. Also.... is there a way to decrypt with php so that the data can be read in a SWF Flash Login.
  14. Thanks a ton man for your effort in helping me. Just one question, can the first little PHP script be inserted into an HTML page? and do I need to add the connection details myself to the second php script?
  15. Could you give me any direction in that? Would this: http://www.scripts.com/viewscript/admin-login-only/4609/ be a good one?
  16. I want the Login to come from a MySQL Database so I can have multiple admins. Is this possible with htaccess?
  17. Hey Guys, I was just wondering if it was possible to Password Protect HTML Pages with PHP. I need to secure my Administration Panel Sites. Any information or help would be greatly appreciated. Akenatehm
  18. Ok, I tried that but it outputs as: I want it to all be lined up together up against the left side.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.