David Gillen wrote:[color=blue]
> An noise sounding like Luke Bellamy said:[color=green]
> > Hi,
> > I have several types of contact forms on my web site and when[/color][/color]
submit[color=blue][color=green]
> > is hit I would like the PHP code to build a string with each[/color][/color]
variable[color=blue][color=green]
> > name and value and dump it in an email to me.
> > So I need to iterate through all the request variables on the[/color][/color]
contact[color=blue][color=green]
> > form in a generic fashion.
> > Can someone please let me know the best way to do this?
> > I am very new to PHP so feel free to point out a better way than[/color][/color]
below[color=blue][color=green]
> > to send an email.
> >[/color]
> ob_start();
> print_r($_REQUEST);
> $stuff = ob_get_contents();
> ob_end_clean();
>
> Then mail $stuff to yourself.
> You could also use $_POST or $_GET as appropriate.[/color]
There is an optional argument to the print_r function, when set to
TRUE, will return the output instead of printing it.
$stuff = print_r($_REQUEST,TRUE);
See
www.php.net/print_r
Ken