SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Oct 2010
    Posts
    323
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    session_start() [function.session-start]

    please i am having this error, wat does it mean.
    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/reachea2/public_html/activate.php:2) in /home/reachea2/public_html/include/global.php on line 7

    Code:
    <?php
     //ob
        ob_start();
    
        //session
        session_start();
    
        //connect to database
        $error = "Problem connecting";
        mysql_connect("localhost","12345","abcdef") or die($error);
        mysql_select_db("12345") or die($error);
    
        ?>
    
    and
    
    Code:
     <?php
     include 'include/global.php';
    
        $code = $_GET['code'];
    
        if (!$code)
            echo "No code supplied";
        else
        {
            $check = mysql_query("SELECT * FROM users WHERE code='$code' AND active='1'");
            if (mysql_num_rows($check)==1)
                echo "You have already activated your account";
            else
            {
                $activate = mysql_query("UPDATE users SET active='1' WHERE code='$code'");
                echo "Your account has been activated!";
            }
            
        }
        ?>

  2. #2
    SitePoint Addict
    Join Date
    Oct 2010
    Posts
    323
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    there was white space before the code, i have sorted it


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
  •