Jump to content

emopoops

Members
  • Posts

    342
  • Joined

  • Last visited

    Never

Posts posted by emopoops

  1. i have a sign in check thats included in every page that is a members only page which is basically all of my pages. that im working on anyways..

    but heres the code..... that works MOST of the time. which doesnt make sense to me and i will explain below what it did.

    <?php
    session_start (); 
    if(!session_is_registered(mysessionvariable) || $_SESSION[mod] == "") //if your variable isn't there, then the session must not be
    {$_SESSION = array();
    session_unset();
    session_destroy();
    if (isset($_COOKIE[session_name()])) {
        setcookie(session_name(), '', time()-55, '/');
    }
    $fullurl = 'http://www.socialemo.com'.$_SERVER['PHP_SELF'];
    ?>
    <meta http-equiv="refresh" content="1;url=http://www.socialemo.com/home.php?homeredirect=
    <?php echo $fullurl; ?>">
    <?php 
    exit(); }
    else //otherwise, they are logged in & do check
    {$checkifrealuser = mysql_num_rows(mysql_query("SELECT id FROM users WHERE username = '$_SESSION[theusername]'"));
    if($checkifrealuser == 0){session_unset ();session_destroy ();exit("logged out on this computer too");}}

     

    thats the check is does. first of all when a user signs in at my site they are given a session variable(AKA $_SESSION[mod] along with the sessions called mysessionvariable. mod NEVER IS SET TO EQUAL NOTHING it equals like a number or a word or something if u log in. i added the check if $_SESSION[mod] == "" because the other one alone didnt work all the time or something... that seemed to be working until lately i get redirected with the meta thing AND THEN I GO TO THE PAGE I CANT VIEW UNLESS IM SIGNED IN AND I CAN VIEW IT, I DONT GET REDIRECTED.? WTF?!

    obviously it didnt destroy my session like it should have when it redirected me.. OR THE CHECK JUST DOESNT WORK? i dont get it.

     

    and the other thing is ill just randomly get the message "logged out on this computer too"

    which i made the second part of the script for like someone that deleted there account as was logged in on two computers at the same time... thats why it checks if the session theusername variable is in the database...?

     

    how do i get this thing to work and why is it doing this? do i have to run a check of all of the session variable? or what?

  2. simple. u use well... u use;;

    $numberofrows =mysql_num_rows(ur query here) OR the count(any column) thing in a mysql_query

    to see how many rows ur going to have to output.

    the u do a  $thequery = mysql_query("SELECT specificcategorycolumn FROM table")

    and then u do

    for($i = 0; $i < $numberofrows; $i++)
    {$thefielddata = mysql_result($thequery, $i); echo $thefielddata;}

    it will start from the first row  and go to the last in whatever order u specify in the query aka ORDER BY id DESC or whatever u should know what i mean.

     

  3. well i just mad a point about it and someone thinks im a troll because sessions really seems like a unique way to do it if there is like going to be a pray a lot but not in one session. but i explained earlier in my previous previous. etc.. post why u would need to use database or why u would need to use session.s so condescending... i was just explaining more ok.

  4. $flush55 = mysql_query("DELETE FROM dumps WHERE id='$flushing' AND time = '$wow'");
    $flush2 = mysql_query("DELETE FROM tp WHERE dump = '$flushing'");
    if($flush55){echo "SUCCESSFULLY FLUSHED THE DUMP HON!<br>";}

    i dont understand because the variables arent the right ones (like i put in fake ones because they are coming from a $_GET POST.. to see if people could mass delete stuff and no matter what it says sucessful, and THERE IS NOTHING BEING DELETED halp!

  5. caps because its absolutely rediculous.

    i dontunderstand why its not working. there is a column called id and a collumn called to

    then there is also. two rows with the field for `to` equal to the number: 1

    still doesnt work:

    just outputs . this user has no commnets, none. (every single time)

    :'(

    <?php $testlll = mysql_query("SELECT to FROM cmnts WHERE to = 1");
    if(!$testlll){echo "this user has no comments, none.";} else{echo "this user has $testlll comments";} echo $testlll; ?>

     

    and of course $testlll (which i renamed trying to fix it -from $test) is equal to, well. NOTHING!!! whats going on here? do i have to change a table name or something?

    i didnt try that because i would have to redo the whole table. theres only one column called to and one column called id (so no dupes)

    also im not dumb it used to be $testlll = mysql_num_rows(mysql_query thing but that didnt work either.

×
×
  • 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.