Jump to content


Photo

Problem with Emailer


  • Please log in to reply
2 replies to this topic

#1 perezf

perezf
  • Members
  • PipPipPip
  • Advanced Member
  • 301 posts
  • LocationFort Lauderdale

Posted 22 May 2006 - 03:31 PM

Something is going wrong with my for statement
im not sure what it is but when i send and email to my self to test it
it sends 100's but what i want it to do is jus get the number that was put into the text box
and then send that number of emails
the name of the text box is "number"

below is the php script for the emailer

<?php
$to = "$email";
$subject = "$idea";
$from_header = "From: $from";




for ($i = $number; $i >= 1 ; $i++) {
mail($to, $subject, $contents, $from_header);
}
?>

can any one help me please

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 22 May 2006 - 03:36 PM

I'm about 99% sure I closed another thread like this. Emailing the same person x amount of times is nothing but a spam/joke generator and won't be tolerated on these forums. Unless you can PM me with a valid reason for a tool like this, the thread will remain closed.

EDIT: Reopened.

Unless you're using an old version of PHP, you need to use $_POST['number'] or $_GET['number']... same goes with the name, email address, etc.

Also, your for loop is setup backwards. The middle term needs to be <=, it's a conditional statement that says keep going until it reaches x.

Info: PHP Manual


#3 perezf

perezf
  • Members
  • PipPipPip
  • Advanced Member
  • 301 posts
  • LocationFort Lauderdale

Posted 22 May 2006 - 03:46 PM

[!--quoteo(post=376059:date=May 22 2006, 11:36 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ May 22 2006, 11:36 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I'm about 99% sure I closed another thread like this. Emailing the same person x amount of times is nothing but a spam/joke generator and won't be tolerated on these forums. Unless you can PM me with a valid reason for a tool like this, the thread will remain closed.

EDIT: Reopened.

Unless you're using an old version of PHP, you need to use $_POST['number'] or $_GET['number']... same goes with the name, email address, etc.

Also, your for loop is setup backwards. The middle term needs to be <=, it's a conditional statement that says keep going until it reaches x.
[/quote]

Thank you very much




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users