Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2008
    Posts
    50
    Tokens
    10

    Default Needing some assistance!



    Join Date » Nov 2009
    Posts » 76
    Rep Power » 0



    Needing some assistance!
    I need help with one thing im sure one of you guys would know, probably how to fix this issue but im working on a User system atm and im getting an error like this

    Warning: Cannot modify header information - headers already sent by (output started at myurlwebsite/index.php:7) in myurlwebsite/index.php on line 137

    Warning: Cannot modify header information - headers already sent by (output started at myurlwebsite/index.php:7) in /myurlwebsite/index.php on line 138
    Thank You! You will be redirected
    on line 137 & 138 it shows this.
    setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
    setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
    i tried configuring some things around but this page is for users login they will be able to see the links but everytime i enter my user & pass it goes straight to that can anyone help?
    Last edited by lSFresh; 16-02-2010 at 09:38 AM.

  2. #2
    Join Date
    Aug 2004
    Location
    United Kingdom
    Posts
    5,769
    Tokens
    1,249
    Habbo
    Beneficial

    Latest Awards:

    Default

    This generally means sessionstart or cookies aren't at the very top of the file and have already been set.
    what is fetch gretchen?

  3. #3
    Join Date
    Oct 2008
    Posts
    50
    Tokens
    10

    Default

    So what will this mean this is the code i have in the index.php page

    <style type="text/css">
    /*this is what we want the div to look like
    when it is not showing*/
    div.loading-invisible{
    /*make invisible*/
    display:none;
    }

    /*this is what we want the div to look like
    when it IS showing*/
    div.loading-visible{
    /*make visible*/


    /*position it 200px down the screen*/
    position:absolute;
    top:0px;
    left:0;
    width:100%;
    height:100%;
    text-align:center;

    /*in supporting browsers, make it
    a little transparent*/
    background:#fff;
    opacity:.80;
    border-top:1px solid #ddd;
    border-bottom:1px solid #ddd;
    }



    </style>
    </head>




    <script language="JavaScript1.1" type="text/javascript">
    <!--
    var image1=new Image()
    image1.src="images/welcome.png"
    var image2=new Image()
    image2.src="images/upload.png"
    var image3=new Image()
    image3.src="images/forum.png"
    var image4=new Image()
    image4.src="images/jobs.png"
    var image5=new Image()
    image5.src="images/contact.png"
    var image6=new Image()
    image6.src="images/firefox.png"


    //-->
    </script>

    <body>

    <div id="wrapper">
    <div id="logo"></div>
    <div id="top">

    <div id="login">

    <div id="login_top"></div>
    <div id="side_mid_g">

    <div align="left">

    <?
    oB_start();
    // allows you to use cookies.
    include("config.php");
    if (!$logged[username])
    {
    if (!$_POST[login])
    {
    echo("


    <a href=\"register.php\" target=\"mainframe\">Register</a> | <a href=\"lostpw.php\" target=\"myframe\">Lost Password</a>

    <form method=\"POST\">
    <table>

    <tr>
    <td>
    <font size=\"1px\"> <b><font color=\"grey\">Username:</font></b></font><br />
    <input type=\"text\" name=\"username\" class=\"text\" />
    </td>
    </tr>
    <tr>
    <td>
    <font size=\"1px\"><b><font color=\"grey\">Password:</font></b></font><br />
    <input type=\"password\" name=\"password\" class=\"text\" />
    </td>
    </tr>
    <tr>
    <td>
    <input type=\"submit\" name=\"login\" class=\"button\">
    </td>
    </tr>
    </table>


    </form>");
    }
    if ($_POST[login]) {
    // the form has been submitted. We continue...
    $username = $_POST['username'];
    $pass = md5($_POST[password]);
    // the above lines set variables with the submitted information.
    $info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
    $data = mysql_fetch_array($info);
    if($data[password] != $pass) {
    // the password was not the user's password!
    echo "Incorrect username or password!";
    }else{
    // the password was right!
    $query = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
    $user = mysql_fetch_array($query);
    // gets the user's information

    setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
    setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");

    // the above lines set 2 cookies. 1 with the user's id and another with his/her password.
    echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=index.php\"/>Thank You! You will be redirected");
    // modify the above line...add in your site url instead of yoursite.com
    }
    }
    }
    else
    {
    // we now display the user controls.
    $new = mysql_query("select * from pmessages where unread = 'unread' and touser = '$logged[username]'");
    $new = mysql_num_rows($new);
    echo ("<center>Welcome <b>$logged[username]</b><br /></center>
    - <a href=\"editprofile.php\">Edit Profile</a><br />
    - <a href=\"messages.php\">Private Messages ($new New)</a><br />
    - <a href=\"members.php\">Member List</a><br />
    - <a href=\"logout.php\">Logout</a>");
    }
    ?>
    </div>
    </div>
    <div id="side_bot_g"></div></form>

    </div></div>

  4. #4
    Join Date
    Aug 2004
    Location
    United Kingdom
    Posts
    5,769
    Tokens
    1,249
    Habbo
    Beneficial

    Latest Awards:

    Default

    More than likely, this:
    Code:
    setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
    setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
    Needs to be at the top of the file?
    what is fetch gretchen?

  5. #5
    Join Date
    Oct 2008
    Posts
    50
    Tokens
    10

    Default

    so all the way at the top of the file? wont it need a session start type thing

  6. #6
    Join Date
    Oct 2008
    Posts
    50
    Tokens
    10

    Default

    Sorry for Double Posting!

    Its not working Homosexuality uhm can you help me out if not then its cool if you have msn can you PM me and we can talk more i just need help with just this one error.

  7. #7
    Join Date
    Aug 2004
    Location
    United Kingdom
    Posts
    5,769
    Tokens
    1,249
    Habbo
    Beneficial

    Latest Awards:

    Default

    It does need a sessionstart type thing, try adding that too.
    what is fetch gretchen?

Posting Permissions

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