>Here's what I wanna do: >On the first page I collect a lot of formfield values into a cookie. On the >next page I display the content of this cookie. This works. >What I even want to do is mailing the cookie content in the same time I >submit the forms in the first page (or, when the new page loads). >I use this code on the second page: > >if ($REQUEST_METHOD=='POST') { > $name = escapeshellcmd($name); > $group = escapeshellcmd($group); > $to = "[EMAIL PROTECTED]"; > $from = "FROM: $name, $group"; > $subject = "The subject of this mail\n\n"; > $body = "Name: $name\t"; > $body .= "Group: $group\n"; > $body .= "\n\n$comments\n\n";
see below, but if you cookie is named cookiestr, just us the variable here $body .= "\n\n$cookiestr\n\n"; > > mail($to,$subject,$body,$from); > exit; >} > >Well, I recieve a mail, but the mailcontent is empty. >The cookie string is written to a hidden field like this: > > document.write('<FORM><INPUT TYPE=HIDDEN NAME=\"comments\" >VALUE=\"'+cookiestr+'\"></FORM>'); so your cookie variable name is "cookiestr" why use Javascript, and not just echo '<FORM><INPUT TYPE=HIDDEN NAME="comments" VALUE="'.$cookiestr.'"></FORM>'; Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php