Re: Problem with a my function and a simple mail

From: Date: Wed, 23 Aug 2000 21:36:06 +0000
Subject: Re: Problem with a my function and a simple mail
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13230@lists.php.net to get a copy of this message
At 05:18 AM 8/24/2000 +0200, n e t b r a i n wrote:
function list_my_values($var_array) {
        while(list($key,$value)=each($var_array)) {
        echo("".stripslashes(strip_tags(escapeshellcmd($key))).":
".stripslashes(strip_tags(escapeshellcmd($value)))."");
        }
} mail($me,$subject," HI, these value were submitted: --------------------------- ".list_my_values($fuseVarMust)." --------------------------- "); The big problem is that my function doesn't print anything in the body of the email: instead, it sends the print out to the client browser ...
Hi Max, Of course it prints out to the browser, you are using echo aren't you ? Try using this : function list_my_values($var_array) { while ( list($key, $value) = each($var_array) ) {
    $output .= stripslashes(strip_tags(escapeshellcmd($key))) . ": " . stripslashes(strip_tags(escapeshellcmd($value))) . "\n";
} return $output; } Best Regards, Joao -- Joao Prado Maia Web Developer Kefta.com, Inc

« previous php.general (#13230) next »