Re: Automatic Form processor

From: Date: Wed, 20 Oct 2004 02:51:20 +0000
Subject: Re: Automatic Form processor
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199841@lists.php.net to get a copy of this message
> I am in need of a PHP script that will take any POST data and parse it into > a file and email it out to users. The data needs to be completely > changeable, whether I have 20 items or 400, I just want to throw everything > to the script via POST and let it take the POST information and manipulate > it. > > IE: > > <form method="post" action="parse.php"> > <input type="text" name="question_1"> > <input type="text" name="question_2"> > <input type="text" name="question_3"> > <input type="text" name="question_4"> > <input type="text" name="question_5"> > ... > <input type="text" name="question_69"> > <input type="text" name="question_70"> > > <input type="submit"> > You could use a foreach... foreach ( $_POST as $key => $value ) { if ( substr( $key, 0, 4 ) == "quest" ) echo "$value: $key\n"; } -Dan Joseph

« previous php.general (#199841) next »