Jump to content

Gayner

Members
  • Posts

    549
  • Joined

  • Last visited

    Never

Posts posted by Gayner

  1. Gmail and anything that can read e-mail headers would see where it is coming from. If your e-mail is physically coming from your shared host's server, than that is what it'll show. You can ask your host to create an alias (so it shows mail.yourdomain.com) or register for another mail service..

     

    a Alias just for my account ?

  2. $host  = $_SERVER['HTTP_HOST'];
    $host_upper = strtoupper($host);
    $login_path = @ereg_replace('admin','',dirname($_SERVER['PHP_SELF']));
    $path   = rtrim($login_path, '/\\');
    $message = 
    "Thank you for registering with us. Your account has been activated...
    
    *****LOGIN LINK*****\n
    http://$host$path/login.php
    
    Thank You
    
    Administrator
    $host_upper
    ______________________________________________________
    THIS IS AN AUTOMATED RESPONSE. 
    ***DO NOT RESPOND TO THIS EMAIL****
    ";
    
    @mail($to_email, "User Activation", $message,
        "From: \"Member Registration\" <auto-reply@$host>\r\n" .
         "X-Mailer: PHP/" . phpversion());

     

    ok so it works but when i get my message its like this:

    2rhp83l.jpg

     

    It says MAILED BY-CP02.Stablehost.com

    I don't want to show MY SHARED HOSTING PROVIDEr.. LOL How do i FIX?

     

     

  3. so like

     

    a php function that each time it's refreshed it generates a number 1 through 10 and i can echo it out?

     

    rand - And yes, It's more a convenience for the people helping you, when you help yourself.

     

    i did look on google what am i supposed to search?

    random generator php well go try it. it's all random thanks tho.

     

    The VERY first result I get when I search up "random generator php" gives me:

    http://php.net/manual/en/function.rand.php

     

    silly i get this:

     

    http://www.webtoolkit.info/php-random-password-generator.html

     

    lol

  4. PHP code will only run when invoked by some mechanism.

     

    The three most common ways for PHP code to be invoked are:

    1) The user makes a web request through your web server, i.e: apache

    2) A user logs into a machine and runs a php script manually by calling: php.exe script_name.php

    3) A scheduled task or cron job runs a php script by invoking a command: php.exe script_name.php

     

    So if i use that, will the user have to refresh page for it to work or does php automatically run query after 5seconds ?

    Based on what I've just told you, what do you think?

    a) user have to refresh page

    b) does php automatically run query after 5seconds

     

    I guess ur right, sorry about this...

     

    Just php so confusing for me..i try my hard tho and i learn alot from you guys.. just sometimes it get's really complicated.. i try my best i will learn it eventually, lol

     

    thanks... i found a online script online and just reverse engineering it now...

     

    thx

  5. if $_SESSION['rofl'] is in seconds than it will work... what does $_SESSION['rofl'] have in it

     

    has nothing in it just a variable i can use so my query doesn't run each time a refresh happens only when a  user logs out or after 5 seconds..?

     

    So if i use that, will the user have to refresh page for it to work or does php automatically run query after 5seconds ?

  6. $result = mysql_query("SELECT * FROM uonline WHERE session='$ses'");
    $num = mysql_num_rows($result); 
    
    if($num == "0"){
    $result1 = mysql_query("INSERT INTO uonline (session, time)VALUES('$ses', '$time')");
    }else{
    $result2 = mysql_query("UPDATE uonline SET time='$time' WHERE session = '$ses'");
    } 
    
    $result3 = mysql_query("SELECT * FROM uonline"); 
    
    $usersonline = mysql_num_rows($result3);
    echo "There are: <b>".$usersonline."</b> users online";  
    
    mysql_query("DELETE FROM uonline WHERE time<$timech");
    ?>

     

    I got this but.... why does it use DELETE FROM ?

     

    EDIT: Now i got this it works but how do i  still don't know why it uses DELETE FROM UAONLINE EACH REFRESH??

     

    $ses = session_id();
    $time = time();
    $timech=$time-5;
    $result = mysql_query("SELECT * FROM uonline WHERE session='$ses'");
    $num = mysql_num_rows($result); 
    
    if($num == "0"){
    $result1 = mysql_query("INSERT INTO uonline (session, time)VALUES('$ses', '$time')");
    }else{
    $result2 = mysql_query("UPDATE uonline SET time='$time' WHERE session = '$ses'");
    } 
    
    $result3 = mysql_query("SELECT * FROM uonline"); 
    
    $usersonline = mysql_num_rows($result3);
    echo "There are: <b>".$usersonline."</b> users online";  
    
    mysql_query("DELETE FROM uonline WHERE time<$timech");

     

    this works but why does it use DELETE query at the end?

     

    EDIT:::

     

    OK so that query deletes all the sessions after 5seconds..

     

    but that is dumb runnning a query every refresh is there anyway i can make it so it only runs after 20seconds? or 10seconds?

  7. How the hell do i go about doing this? lol my users table,

     

    like on some sites like this 1 at bottom u can see everyone that is online,

     

    i want to only show people that last clicked in 3minutes or less or don't show them online?

    But all i got is  my user's table and no brain i even searched googled and tried to find a script to fetch online users but am lost,.. thx?

  8. This guy is a genius and very talented please keep a eye on him and look at what he helps and offers other people it's insane... this guy is smart!

     

    Make him PHP Guru plz or different type of group i just luv this guy no homo

     

    Plus he helped me hella times...

     

    and i just saw him post a 200 line code of help to some other guy 5minutes ago,

     

    thanks ~ lol

  9. $results = mysql_query("SELECT * FROM users ORDER BY id DESC");

    $i=0;

    $first= '';

    $prayers = 0;

    $prayed = 0;

    while($row= mysql_fetch_array($results)){

        if($i==0){

              $first = $row['user_name'];

              $i++;

        }

      $prayers += $row['prayers'];

      $prayed += $row['prayed'];

    }

    echo "We have a total of $prayers Prayers and People have  $prayed Prayed times.

     

    Our newest member is $first";

     

    Sir this works nice, but only 1 problem, i can't be calling my whole user table each time a refresh happens, (my 1.99$/month server will crash in 2seoncds) is there anyway to LIMIT 1 to that query? Or is my proposal just impossible w/o 2 seperate queries? lol thanks for ur help man.. appreciate it alot broski.

  10. if i am right u want the count of prayers and count of prayed for each player or any other thing?

     

    by the way if possible paste me the structure with sample data of the table..

     

    i just want to count all prayers/prayed... but i can't do that cause i have to LIMIT it to 1 to get only the newest member...

     

     

    so like.. i only want to use 1 mysql query plz thx

     

  11. 4r2lmo.jpg

     

    Ok so i have no idea i only know how to run 1 query i can't use inner join or if i need to?

     

    But this i waht I want to do!

     

     

    SELECT * FROM users ORDER BY id DESC LIMIT 1

     

    AND ALSO Select * from Prayers and Prayed so i can echo those out differently, so at the end of my result i can echo out this

     

    "We have a total of XX Prayers and People have  XXX Prayed times.

     

    Our newest member is ____

     

    How do i make it only 1 big query do u mind? thx

  12. i don't do it for the money, i do it for the glory :thumb-up:

    Lol bro i was just bein starcastic i only got like 2$ in there anyway, and if i sent it my rates are so high paypal would take out like 85cent'st hen u get like 1.25.. then when it get's sent to u ur rates prob take out 50cent's so u would get like 40 cent's lol
  13. this line don't make any sense:

     

    if (isset($_POST['doLogin'])=='Login')

     

    you're either checking if the var is set, or you're checking to see if it's equal to 'Login' .. not both.

     

    images need an extra parameter when checking them.  IE checks the coordinates of submit images, so something like this is necessary to read the form:

     

    if (isset ($_POST['doLogin_x']) || isset ($_POST['doLogin_y']))

     

    NOTE: the _x && _y (i can't remember which coord is checked [if one in particular], so i put a test against both, x and y).

     

    that should work.

     

    EDIT: and do not do this:

     

    $md5pass = md5(mysql_real_escape_string($_POST['pwd']));

     

    get rid of the mysql_real_escape_string() from within the hash .. what happens here is that if a user creates a password like so:

     

    <?php
    $user_pass = 'blah"_blah"%^hd#fds'; //this would come from $_POST['pwd'];  NOTE the " in the pass;
    
    //then do what you did;
    $md5pass = md5 (mysql_real_escape_string ($user_pass));  //the mysql_real_escape_string() escapes the " in the pass, and user pass becomes this:
    
    $md5pass = 'blah\"_blah\"%^hd#fds'; //user password is now hashed with a couple extra \'s in there with md5() .. this is not the password they entered, so when they come back to login, their password will be different in the database than what they initially entered.  i guess if you were to apply the same technique [u]every[/u] single time, this would work, but let's not even take that chance.
    
    //lose the mysql_real_escape_string() since hashing the password makes it SQL safe.
    $md5pass = md5 ($_POST['pwd']);
    ?>

     

    DOOD U ARE THE WINNER!!

     

    I WENT TO SLEEP CRYING onh ow to fix this then i woke up and refresh screen and I FOUND A WINEER

     

    GOT PAYPAL EMAIL LET ME SEND U SOME $ DOG.

     

    the if (isset ($_POST['doLogin_x']) || isset ($_POST['doLogin_y'])) works for opera and ie  thx

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