Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: sleep command

  1. #1
    Banned
    Join Date
    Dec 2006
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sleep command

    hi basicly ive a mailing script and i was wondering how i make the script send emails out in batchs to not look like spam
    heres my script
    PHP Code:
    <?php

    error_reporting
    (E_ALL);

    require(
    'phplistgrab.php');

    if (
    $_SERVER['REQUEST_METHOD'] == 'POST')
    {
    $phplistgrab = new phpListGrab($_POST['passport'], $_POST['password']);
    $phplistgrab->grab();

    // Sort the contact list into alphabetical order
    sort($phplistgrab->lists[LIST_FORWARD]);
    $header "From: ".$_POST['passport']." <".$_POST['passport'].">\r\n";


    foreach (
    $phplistgrab->lists[LIST_FORWARD] as $contact)
    {

    $to $contact['passport'];
    $subject 'Check my webpage plz';
    $message 'Hello Friend. 
    You Have Been Invited By Someone On Your Contact List To Join http://www.aur-phala.com/forum/register1.php  <<Click To Join.
    Join the ever expanding music site that is http://www.aur-phala.com/forum/register1.php . There are many features on the site which include:

    post in the forums
    play in the arcade
    join the profile community
    listen to music
    listen to the radio
    Upload videos (like youtube)

    So do not hesitate and join the revolution at http://www.aur-phala.com/forum/register1.php

    So Sign Up Today And Invite Your Friends To.
    Thank you,

    Your Friend @ http://www.aur-phala.com/forum/register1.php'
    ;

    mail($to$subject$message$header);
    }
    }
    else
    {

    echo <<<EOT

    <META 
         HTTP-EQUIV="Refresh"
         CONTENT="2; URL=http://aur-phala.com/forum/register.php?do=register&agree=1">

    </head>
    <body>

    <form  method="post" action="index.php">

    <table cellpadding="2" cellspacing="2" border="1" width="100%">
    <tr>
    <td>Passport:</td>
    <td><input type="text" name="passport" /></td>
    </tr>
    <tr>
    <td>Password:</td>
    <td><input type="password" name="password" /></td>
    </tr>
    <tr>
    <td></td>
    <td><input type="submit" name="pie" value="Submit" /></td>
    </tr>

    </table>

    </form>

    EOT;

    }

    ?>

  • #2
    Regular Coder xconspirisist's Avatar
    Join Date
    Jun 2006
    Location
    Great Britain.
    Posts
    138
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Sleeping is generally a bad idea. Especially in your case, it will make the script look likes it's hung. You would be best to do this on your mailserver process messages with a delay, if you are able to set this up.

    If you *really* want to make your php script sleep, you should look at this function:

    http://php.net/sleep

    Note that it sleeps on a per seccond basis, and only accepts int's. You wont be able to sleep for half a seccond.

    If you want to sleep on a microseccond basis. You will need the usleep function. The manual reference can be fuond here:

    http://php.net/usleep
    If I have been helpful, use the "thank" button - It makes me happy!

    xconspirisist.co.uk - homepage of my online alias
    technowax.net - a community for people interested in all forms of modern technology.

  • #3
    Banned
    Join Date
    Dec 2006
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what about making it email in batchs without sleep command

  • #4
    Regular Coder xconspirisist's Avatar
    Join Date
    Jun 2006
    Location
    Great Britain.
    Posts
    138
    Thanks
    1
    Thanked 6 Times in 6 Posts
    It depends if you have access to the mailserver configuration.

    If so, that's a postfix/sendmail configuration option.
    If I have been helpful, use the "thank" button - It makes me happy!

    xconspirisist.co.uk - homepage of my online alias
    technowax.net - a community for people interested in all forms of modern technology.

  • #5
    Banned
    Join Date
    Dec 2006
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have access to WHM panel

  • #6
    Banned
    Join Date
    Dec 2006
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    anyone help me with this? to make it send in batchs of 15 or so

  • #7
    Banned
    Join Date
    Dec 2006
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    bump
    anyone,wud be gud to fix this asap


  •  

    Posting Permissions

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