...

View Full Version : getting all POST vars



boeing747fp
04-09-2004, 08:56 PM
can you have it so that you can have variable amounts and names of POST variables inserted into an email? i have this code that people can go to and have their forms submit to their emails via the accounts in the databases but some people have more fields and different names for their fields in each account... i need it to submit every field to the email.. is this possible?

raf
04-09-2004, 09:56 PM
i need it to submit every field to the email.. is this possible?
What do you mean?

You can do a


$mailcontent='';
foreach($_POST as $var=>$value){
$mailcontent .='<br />'.$value;
}

which will build a string with all posted values.
I ussually then start all my content-formfields with the same letters (or different groups of letters) so that you can elimitad the submitbutton ets-c. then you have something like



$mailcontent='';
$mailsubject='';
foreach($_POST as $var=>$value){
if (substr($var,0,4)=='cont'){
$mailcontent .='<br />'.$value;
}elseif (substr($var,0,4)=='subj'){
$mailsubject .='<br />'.$value;
}
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum