SitePoint Sponsor

User Tag List

Page 2 of 4 FirstFirst 1234 LastLast
Results 26 to 50 of 86
  1. #26
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by someonewhois
    Ok, the server is back up, and the following is the error:



    ANd then it takes me back to teh signup.php page!

    I don't know how to edit that messege, I can't find it anywheres!

    That is why it has kevin@sitepoint.com as the e-mail!

    Again, help neeed!

    Thanks,
    ~someonewhois

    It is that error pop-up messege...

    I have the right things for MySQL, and the tables are set up (see the image above) but it doesn't work!

    Thanks for your help, please continue to help!

    ~someonewhois

  2. #27
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Replace the following code:
    Code:
    if (!$result) {
    
     error("A database error occurred in processing your ". 
    
      "submission.\nIf this error persists, please ". 
    
      "contact kevin@sitepoint.com."); 
    
    }
    With this code:
    Code:
    if (!$result) {
    
     error("A database error occurred:". mysql_errno().": ".mysql_error()); 
    
    }
    Now run the code again - the error message you get will contain more specific information about what went wrong. Copy that information into a post here and we might be able to help you out.

  3. #28
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I did that, want me to post the error?

    Thanks,
    ~someonewhois

  4. #29
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    New error

    Parse error: parse error in /home/coaster/public_html/coasterthrills/php/sowiBB/sowiBB2/signup.php on line 85




    Not good....


    Line 85:

    }


    Never mind, it was becuase I had a "}" above it from copying what you ahd!

    Oops..

    I got rid of it, and ran the file... so far so good!

    I'll post the error when I hit submit!

  5. #30
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I get a new pop-up error:

    A database error occured:1046:No database selected


    What does that mean?

  6. #31
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oddly enough that means you haven't selected the database

    You should have a line in your code somewhere that looks something like this:
    Code:
    mysql_select_db("database_name",$connexion);
    You will need to know the name of your database for that - whoever is hosting the database for you should have told you the name of your database at some point.

  7. #32
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what part?

    user or database name?

  8. #33
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see a line like that anywhere!

    What file is it supposed to be in?

    I took the ziped file of these files, so it should be right!

    Thanks,
    ~someonewhois

  9. #34
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you don't see the mysql_select_db() appear anywhere in your script, you will have to add it.

    The start of your script shold be something like:

    PHP Code:
    $dbcnx mysql_connect($dbaddress,$username,$password) or die (mysql_error());

    mysql_select_db($dbname,$dbcnx); 

  10. #35
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What file?

  11. #36
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably in dbconnect.inc or something similar to that.

  12. #37
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think so, there isn't a file like that!

    The article is at http://www.webmasterbase.com/article/319 and the zip file that is suplied at the end is directed from http://www.webmasterbase.com/example...esscontrol.zip


    I hope this helps you find the problem

    THanks!

    sowi

  13. #38
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does that help?

  14. #39
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look in db.php

  15. #40
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok... should I add in that?

    Or what should I do?

    I'm lost!

  16. #41
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem seems to be that Kevin has "hard coded" the database name into the scripts. Work out what your database name is (the database which contains the user table you created earlier) and change line 33 of "accesscontrol.php" to this:
    Code:
    dbConnect("NAME_OF_YOUR_DATABASE_HERE");

  17. #42
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks a bunch!

    You helped a lot!

    I changed that in signup.php, but I didn't relize it was in accesscontrol.php aswell!

    Thanks,
    ~someonewhois

  18. #43
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I still can't connect!

    I changed it for all of them, and it still gives me a 1046 error...

  19. #44
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?

    I'm really stuck on this...

  20. #45
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please post your db.php and accesscontrol.php.

    -Helge

  21. #46
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, here it is!

    The only thing edited is I put **** for the password, becuase I don't want it showing.

    db.php
    Code:
    <?php // db.php
    if ($display=="source") {
    highlight_file("db.php");
    }
    
    $dbhost = "localhost";
    $dbuser = "coaster_coastert";
    $dbpass = "****";
    
    function dbConnect($db="coaster_coastert") {
        global $db,$dbhost,$dbuser,$dbpass;
        
        $dbcnx = @mysql_connect($dbhost, $dbuser, $dbpass);
    
        if ($db!="" and !@mysql_select_db($db))
           die("The site database is unavailable.");
        
        return $dbcnx;
    }
    ?>
    accesscontrol.php
    Code:
    <?php // accesscontrol.php
    
    include("common.php");
    include("db.php");
    
    session_start();
    
    if(!isset($uid)) {
      ?>
      <html>
      <head>
      <title> Please Log In for Access </title>
      </head>
      <body>
      <h1> Login Required </h1>
      <p>You must log in to access this area of the site. If you are
         not a registered user, <a href="signup.php">click here</a>
         to sign up for instant access!</p>
      <p><form method="post" action="<?=$PHP_SELF?>">
        User ID: <input type="text" name="uid" size="8"><br>
        Password: <input type="password" name="pwd" SIZE="8"><br>
        <input type="submit" value="Log in">
      </form></p>
      </body>
      </html>
      <?php
      exit;
    }
    
    session_register("uid");
    session_register("pwd");
    
    dbConnect("coaster_coastert");
    $sql = "SELECT * FROM user WHERE
            userid = '$uid' AND password = PASSWORD('$pwd')";
    $result = mysql_query($sql);
    if (!$result) {
      error("A database error occurred while checking your ".
            "login details.\\nIf this error persists, please ".
            "contact sowibb@hotmail.com.");
    }
    
    if (mysql_num_rows($result) == 0) {
      session_unregister("uid");
      session_unregister("pwd");
      ?>
      <html>
      <head>
      <title> Access Denied </title>
      </head>
      <body>
      <h1> Access Denied </h1>
      <p>Your user ID or password is incorrect, or you are not a
         registered user on this site. To try logging in again, click
         <a href="<?=$PHP_SELF?>">here</a>. To register for instant
         access, click <a href="signup.php">here</a>.</p>
      </body>
      </html>
      <?php
      exit;
    }
    
    $username = mysql_result($result,0,"fullname");
    ?>

    I hope this helps!

  22. #47
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try changing this line in db.php
    PHP Code:
    global $db,$dbhost,$dbuser,$dbpass
    with this:
    PHP Code:
    global $dbhost,$dbuser,$dbpass
    -Helge

  23. #48
    Shiver me timbers!! anthony_irl's Avatar
    Join Date
    Aug 1999
    Location
    Dublin, Ireland
    Posts
    495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I reckon the problem could lie with your $dbhost variable. From the information given in a previous post you seem to be running the script on an internet server:

    /home/coaster/public_html/coasterthrills/php/sowiBB/sowiBB2/signup.php
    but your $dbhost variable is set to localhost. Try setting the $dbhost variable to the value given to you by your hosting company ie.

    $dbhost = "http://mysql.host.com";

    That should fix the problem.
    Anthony - How's tings?

    24 hours in a day, 24 beers in a case. Coincidence? I think not.
    Contact me by: PM Email NEW! Carrier Pigeon

  24. #49
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thank you both of you!

    I will try both of those!

  25. #50
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In this function:

    PHP Code:
    function dbConnect($db="coaster_coastert") {
        global 
    $db,$dbhost,$dbuser,$dbpass;
        
        
    $dbcnx = @mysql_connect($dbhost$dbuser$dbpass);

        if (
    $db!="" and !@mysql_select_db($db))
           die(
    "The site database is unavailable.");
        
        return 
    $dbcnx;

    Change it to:

    PHP Code:
    function dbConnect($db="coaster_coastert") {
        global 
    $db,$dbhost,$dbuser,$dbpass;
        
        
    $dbcnx mysql_connect($dbhost$dbuser$dbpass) or die(mysql_error());

        
    mysql_select_db($db) or die(mysql_error());
        
        return 
    $dbcnx;

    That way you will get to see what the error message is, which will help in solving your prob.

    I suspect your database address is not localhost.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •