PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.comp.lang.php > PHPMailer Question about using CC in Forms
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
PHPMailer Question about using CC in Forms

Réponse
 
LinkBack Outils de la discussion
Vieux 02/06/2007, 15h58   #1 (permalink)
cover
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut PHPMailer Question about using CC in Forms

My form processes the lines below just fine so long as there's
something in the cc field (which I'm trying to leave optional). If the
cc field of the form is left blank, I get an error. I need an if
statement where the cc is optionally blank and the $to still works. As
I have it, the $to line below works well because there's always going
to be an entry however again, the cc won't be used 100% of the time.
I was toying around with the if statement below but don't have it
figured out yet. Any is appreciated. TIA

$mail->AddAddress($arrEmailAddress[$to]);
$mail->AddCC($arrEmailAddress[$cc]);


----------code below clearly not there yet for the cc field-----------
if ($cc=''''){
$mail->AddCC($cc);
}

  Réponse avec citation
Vieux 05/06/2007, 10h07   #2 (permalink)
shimmyshack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHPMailer Question about using CC in Forms

On Jun 2, 3:58 pm, cover <coverlandNOSPAM...@yahoo.com> wrote:
> My form processes the lines below just fine so long as there's
> something in the cc field (which I'm trying to leave optional). If the
> cc field of the form is left blank, I get an error. I need an if
> statement where the cc is optionally blank and the $to still works. As
> I have it, the $to line below works well because there's always going
> to be an entry however again, the cc won't be used 100% of the time.
> I was toying around with the if statement below but don't have it
> figured out yet. Any is appreciated. TIA
>
> $mail->AddAddress($arrEmailAddress[$to]);
> $mail->AddCC($arrEmailAddress[$cc]);
>
> ----------code below clearly not there yet for the cc field-----------
> if ($cc=''''){
> $mail->AddCC($cc);
> }


do you mean?

if( $cc != '' )
{
$mail->AddCC($cc);
}

you could google for "conditionals in php" for more on using if
statements, but my advice is - if you are this new to php coding, DONT
play with scripts, you could easily create a working spam bot, which
would quickly increase your headaches by many orders of magnitude.

  Réponse avec citation
Vieux 05/06/2007, 17h41   #3 (permalink)
Tom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHPMailer Question about using CC in Forms


"shimmyshack" <matt.farey@gmail.com> wrote in message
news:1181034443.892877.186310@q66g2000hsg.googlegr oups.com...
> On Jun 2, 3:58 pm, cover <coverlandNOSPAM...@yahoo.com> wrote:
> > My form processes the lines below just fine so long as there's
> > something in the cc field (which I'm trying to leave optional). If the
> > cc field of the form is left blank, I get an error. I need an if
> > statement where the cc is optionally blank and the $to still works. As
> > I have it, the $to line below works well because there's always going
> > to be an entry however again, the cc won't be used 100% of the time.
> > I was toying around with the if statement below but don't have it
> > figured out yet. Any is appreciated. TIA
> >
> > $mail->AddAddress($arrEmailAddress[$to]);
> > $mail->AddCC($arrEmailAddress[$cc]);
> >
> > ----------code below clearly not there yet for the cc field-----------
> > if ($cc=''''){
> > $mail->AddCC($cc);
> > }

>
> do you mean?
>
> if( $cc != '' )
> {
> $mail->AddCC($cc);
> }
>
> you could google for "conditionals in php" for more on using if
> statements, but my advice is - if you are this new to php coding, DONT
> play with scripts, you could easily create a working spam bot, which
> would quickly increase your headaches by many orders of magnitude.
>


If you are using input from a web form to send email, you need to be really
careful that spammers don't hijack your script.

As an example that can submit an email address for the "To" header then add
a whole bunch of other addresses in the CC or Bcc header.

You need to be really careful about checking for conditions like that, such
testing for new line characters, in the form information people are
submitting to you.

Tom
--

Newsguy.com
90+ Days Retention
99% Article Completion
Create Your Own NZB Files




  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h50.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08531 seconds with 11 queries