TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-05-2008, 04:46 AM   #1 (permalink)
The Acquainted
 
Peuplarchie's Avatar
 
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
Peuplarchie is on a distinguished road
Application array to email...

Good day to you all,
I was wondering how can I make my array listed in my email script below.
I know how to send an e-mail, I pass it through a form...

Here is it:

PHP Code:

 <?php
$pics 
$_POST["pics"];


foreach (
$pics as $p) {
echo 
$p."<br />";
}






$to "franck@peuplies.info, fbeausol@justice.gc.ca";
$from_header "From: franck@peuplies.info";

$subject "Salut Marc, voici le choix d'Andrew.";
$contents "$pics";
if(
$contents != "$p")
{
   
//send mail - $subject & $contents come from surfer input
   
mail($to$subject$contents$from_header);
   
// redirect back to url visitor came from
   
header("Location: images.php?folder=Andrew/View");
}
  else
{
   print(
"<HTML><BODY>Error, no comments were submitted!");
   print(
"</BODY></HTML>");
}







?>

Thank for any help with this !
__________________
That's why we are not alone on earth... let's build !
Peuplarchie is offline  
Reply With Quote
Old 09-05-2008, 10:40 PM   #2 (permalink)
The Wanderer
 
Join Date: Aug 2008
Posts: 13
Thanks: 2
almsamim is on a distinguished road
Default

do u want to send to a lot of e-mails from an array ?!
Send a message via MSN to almsamim
almsamim is offline  
Reply With Quote
Old 09-08-2008, 05:34 AM   #3 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

are you trying to add an array of pics to the content of your email?

if that's the case you need to flat out the email in the content variable. more so like this:

PHP Code:
 <?php
$pics 
$_POST["pics"];
if (empty(
$pics[0])){
    foreach (
$pics as $p)
        
$contents .= $p."<br />"//this is of course assuming that each $p value is a valid image tag

    
$to "franck@peuplies.info, fbeausol@justice.gc.ca";
    
$from_header "From: franck@peuplies.info";

    
$subject "Salut Marc, voici le choix d'Andrew.";
    
//send mail - $subject & $contents come from surfer input
    
mail($to$subject$contents$from_header);
    
// redirect back to url visitor came from
    //$_SERVER['HTTP_REFERER']  already has the address of the page (if any) which referred the user agent to the current page
    
header("Location: ".$_SERVER['HTTP_REFERER']);
}else{
    
$error_msg="Error, no comments were submitted!";
}
?>
I hope that makes sense or that is what you asked
tony is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:02 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design