#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Dublin, Ireland
    Posts
    9
    Rep Power
    0
    Hi,
    It's been a while but I hope you guys can be of assistance once more. I have a mail script (see below) which works with a Flash form. The script works absoloutly fine for me and most other people who install it. however others installers report that the script seems to loop and then return the 'no spamming message'. What could be causing this? It is successfully running on different platformsbrowsers so I can't see a pattern. Would it be cookies or something? I would really appreciate if someone could help me out with this. I'm a Flash person and just getting to grips with PHP and feel quite powerless.

    BTW. Feel free to d/l the FlashPHP source files for your own use. It really is quite nifty (when it works!) Thanks...

    My working version: http://www.stephenmoran.f2s.com
    Source: http://www.stephenmoran.f2s.com/php_mail.zip


    <?
    /****Here is the only two variables, that need to be defined.****/

    /*How many times at a stretch visitor can send mail using the script (2 times default)*/
    $opss = 50;

    /*And after what amount of time allow that visitor to send mail again (1 hour default)*/
    $ok = 3600;

    $php_header = "From: $name <$from>n".
    "X-Mailer: Polar Lights Studios/Flash-PHP3 script";
    $antispam = $HTTP_COOKIE_VARS["times"];
    $message_tosent=$message."nn send by $REMOTE_ADDR.";
    if ($antispam < $opss){
    setcookie("times",$antispam+1,gmdate(time()) +$ok);
    if (@Mail($to,
    $subject,
    $message_tosent,
    $php_header)){
    echo "&info=Mail sent. Thank you. A confirmation email wil be sent. &";
    $confirm_to = $name . "<$from>";
    $confirm_header = "From: Customer Service<mail@yoursite.com>";
    $confirm_message = "Your message has been sent. nTo: $tonSubject: $subjectn";
    $confirm_subject = "Email Confirmation";
    @mail($confirm_to,$confirm_subject,$confirm_message,$confirm_header);
    }else{
    echo "&info=Error. Please try later.&";
    }
    }
    else{
    echo "&info=Sorry. Spamming not allowed here.&";
    }
    ?>

  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    if ($antispam < $opss){
    setcookie("times",$antispam+1,gmdate(time()) +$ok);
    >>

    i think the above condition is giving problem.
    you have to check it out your cookie is setting properly
    or not.try something like this for checking wether the
    cookie is setting properly or not.

    if(isset($times)){
    echo "Yea,Cookie has been set properly";
    }else{
    echo "No !!Cookie is not settingn";
    }


    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."

Similar Threads

  1. problem in Uploading file of size more than 512k in php
    By ssomvanshi in forum PHP Development
    Replies: 3
    Last Post: February 7th, 2004, 06:32 AM
  2. PHP link opening problem
    By Real World in forum PHP Development
    Replies: 2
    Last Post: February 5th, 2004, 07:48 AM
  3. XML DOM and PHP Problem, not displaying wanted info
    By drazhargraig in forum PHP Development
    Replies: 2
    Last Post: February 3rd, 2004, 04:14 PM
  4. fread problem: doesn t compile php code
    By ghorghor2002 in forum PHP Development
    Replies: 2
    Last Post: February 3rd, 2004, 06:25 AM
  5. New to PHP - problem with tutorial
    By adam_j_c in forum PHP Development
    Replies: 3
    Last Post: February 1st, 2004, 10:31 AM

IMN logo majestic logo threadwatch logo seochat tools logo