Re: mailing a cookiecontent

From: Date: Mon, 02 Sep 2002 18:38:58 +0000
Subject: Re: mailing a cookiecontent
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-114955@lists.php.net to get a copy of this message
Nope, the cookie is a multivalue cookie (the values from several fields (30-40). The cookiestr is the formatted cookievalue (formatted with numbers and \n) "Dave" <dave@hawk-systems.com> skrev i meddelandet news:DBEIKNMKGOBGNDHAAKGNAECBBGAB.dave@hawk-systems.com... > >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 = "me@myhost.se"; > > $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

« previous php.general (#114955) next »