Jump to content

Flowdy

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by Flowdy

  1. I took the brackets out and still not working...i dont quite understand what you mean janim Errors Code <?php $dbhost = "localhost"; $dbuser = "poison_mygame"; $dbpass = "england"; // keep your password here $dbname = "poison_mygame"; mysql_connect("127.0.0.1", "poison_mygame", "england"); // 127.0.0.1 goes to the IP of the host (where most likely your db is stored). mysql_select_db("poison_mygame"); // Check to see if user logged in session_start(); if((!isset($_SESSION['id'])) || (!isset($_SESSION['username'])) || (!isset($_SESSION['password']))) { unset($_SESSION['username']); unset($_SESSION['password']); unset($_SESSION['id']); $loggedin = 0; } else { $loggedin =1; } ?>
  2. Sure here is the code <?php $dbhost = "localhost"; $dbuser = "poison_mygame"; $dbpass = "england"; // keep your password here $dbname = "poison_mygame"; mysql_connect("127.0.0.1", "poison_mygame", "[england]"); // 127.0.0.1 goes to the IP of the host (where most likely your db is stored). mysql_select_db("poison_mygame"); // Check to see if user logged in session_start(); if((!isset($_SESSION['id'])) || (!isset($_SESSION['username'])) || (!isset($_SESSION['password']))) { unset($_SESSION['username']); unset($_SESSION['password']); unset($_SESSION['id']); $loggedin = 0; } else { $loggedin =1; } ?>
  3. Sorry for the double post...incase you cant see the page as a friend told me she couldn't i get these errors But i can see text boxes for username password and submit button
  4. ooo that helped but now there are loads of errors you should be to see wat i mean by clicking here http://www.testphp.poison-envy.net/index.php
  5. Nope didnt work.. Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'poison_mygame'@'localhost' (using password: YES) in /home/poison/public_html/testphp/connect.php on line 8 Could not connect: Access denied for user 'poison_mygame'@'localhost' (using password: YES) Am starting to think i added a username and password to the database the wrong way
  6. I did use my password last time i just took it out when posting the code on here....I changed things and now i get this the code <?php $dbhost = "localhost"; $dbuser = "poison_mygame"; $dbpass = ""; // keep your password here $dbname = "poison_mygame"; <?php mysql_connect($dbhost, $dbuser, $dbpass) or die('Could not connect: ' . mysql_error()); ?> // Check to see if user logged in session_start(); if((!isset($_SESSION['id'])) || (!isset($_SESSION['username'])) || (!isset($_SESSION['password']))) { unset($_SESSION['username']); unset($_SESSION['password']); unset($_SESSION['id']); $loggedin = 0; } else { $loggedin =1; } ?> The error
  7. The posion_frgn1 isnt the database i made for this its the poison_game one is the first attached image... so i put in the poison_game instead, this being the new code <?php $dbhost = "localhost"; $dbuser = "poison_mygame"; $dbpass = ""; // keep your password here $dbname = "poison_mygame"; $link = mysql_connect($dbhost, $dbuser, $dbpass); if (!$link) { die('Could not connect: ' . mysql_error()); } $selectdb = mysql_select_db($dbname) or die("Could not connect to database."); ?> // Check to see if user logged in session_start(); if((!isset($_SESSION['id'])) || (!isset($_SESSION['username'])) || (!isset($_SESSION['password']))) { unset($_SESSION['username']); unset($_SESSION['password']); unset($_SESSION['id']); $loggedin = 0; } else { $loggedin =1; } ?> I took my password out but now i get this message ???
  8. I did that and this is what i see [attachment deleted by admin]
  9. in the MySQL databases via Control Panel there is nothing under the database i made for this code ??? just has the title poison_mygame
  10. Ok thanx but i don't understand which password to put there as i thought it was the password for the username i added for the database? or would it be the password i use to login to my Cpanel?
  11. were do i correct it? in the code or somewere else?
  12. Ah right ok! then i have no idea i really am that new to php/MySQL
  13. Yeah it must be on the connect.php as the other are ...index.php...logout.php and register.php and they all coming up with the cannot connect to database. PHP is confusing dont think ill ever get to understand it
  14. Ah thanx i feel stupid now am i just stupid cos when i go to http://www.testphp.poison-envy.net/register.php i just get Could not connect to database. shouldnt a form come up to register?
  15. Thanx guys i got it working thanx to your help...i changed the connection to mysql_connect() but now i have a different problem on the register.php <?php include('connect.php); if($loggedin == '1') die("you can't register another account while you're logged in."); // Register Script // Putting new data into databases. if(isset($_POST['submit'])) { // trim removes the whitespaces from the beginning and end of text // this keeps someone from having a username of " " $uname = trim($_POST['username']); // Make sure all forms were filled out. if((!isset($_POST['username'])) || (!isset($POST_['pass'])) || ($uname == '') || ($_POST['pass'] == '')) die("please fill out the form completely. <br><br> <a href=register.php>Continue</a>"); // Make sure name hasn't already been used. $check = @mysql_query("SELECT id FROM players WHERE username = '$uname'"); $check = @mysql_num_rows($check); if($check > 0) die("sorry username has already been taken. Please try again. <br><br> <a href=register.php>Continue</a>"); // Encrypt password $pass=md5($_POST['pass']); $date = date("m/d/y"); // Finally, create record. $newplayer = @mysql_query("INSERT INTO players (username, password, registered) VALUES ('$uname', '$pass', '$date')") or die("Error: ".mysql_error()); echo 'you have been registered! you make now <a href=index.php>Log in</a>.'; } else { // A simple example of a form. echo '<form action=register.php method=post> Username: <input type=text name=username><br> Password: <input type=password name=pass><br> <input type=submit name=submit value=Submit> </form>'; } ?> The error i get is
  16. I changed the die() and this is the error i got Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'flow'@'localhost' (using password: YES) in /home/poison/public_html/testphp/connect.php on line 13 Could not connect to server.Access denied for user 'flow'@'localhost' (using password: YES) I asked about the username earlier today and i got a reply saying i should use the username i assigned to the database
  17. I havent got a clue what you mean ive only really new to PHP ??? The other thing i could think off with my username is that it should be poison_flow but then i get the same error message
  18. I just took my password out.. My server is set for localhost i've set other things up and used the localhost before.
  19. I seem to keep getting problems with this code <?php // This script will connect user to the database. // It will also check if logged in or not. // It should be included on every page created. // Set the variables below to match your settings $dbhost = 'localhost'; $dbuser = 'flow'; $dbpass = ''; $dbname = 'mygame'; $link = mysql_pconnect($dbhost, $dbuser, $dbpass) or die("Could not connect to server."); $selectdb = mysql_select_db($dbname, $link) or die("Could not connect to database."); // Check to see if user logged in session_start(); if((!isset($_SESSION['id'])) || (!isset($_SESSION['username'])) || (!isset($_SESSION['password']))) { unset($_SESSION['username']); unset($_SESSION['password']); unset($_SESSION['id']); $loggedin = 0; } else { $loggedin =1; } ?> The error i get is thanx
  20. Thank you, i had a huntch i just wanted to make sure
  21. Am following a little example code which is helping me learn, but am alittle confused at this part example code // Set the variables below to match your settings $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbname = 'mygame'; I'm ko with the $dbhost as mine is localhost also, but the $dbuser am guessing is the username of the database..so i created a database and added a username that database...but am confused with if i should put poison_flow or just flow for the $dbuser..and then what would i put the password? the password i created with the username for the database? thanx for any help
  22. First off sorry if this is the wrong place... I'm trying to install a forum which is not installing.. This is wat i use to fill in the forum database settings database type: MySQL Database host: localhost Db username: poison_flowdy db password: the password i made when i created the username poison_flowdy and added to the datebase Database Database name: poison_forum FTP settings Use FTP: Yes Ftp Username: Poison FTP Password: The password i use with Poison to get into an FTP program FTP Path (E.G. /public_html/forums/ ) : Im guessing is this part were am going wrong this is wat i entered /public_html/testphp/ImperialBB_2.3.5/ thanx for any help
  23. I'm still getting the same error msg This is going to sound stupid but is it cos i havent got a connect.php?
  24. Thanx for that now am getting an error on line 9 am guessing its this part echo file_get_contents("/templates/register.html"); as its were your file is stored right..and mine isnt stored in /templates/ mine is in /home/poison/public_html/testphp/register.html but when i put that in i still get the same error msg
  25. That could be why... According to this http://www.testphp.poison-envy.net/infophp.php i have php 4.4.7
×
×
  • 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.