Write Dynamic Form Results

Thanks in advance for any help. With only a small a working knowledge of PHP I am attempting to write a form with dynamic field population, and email those results based on only the submitted values. In the form some dynamic inputs will populate (need up to 100 times), model, serial, date, etc. Each new time it is written it appends the number to the variable so you end up with

model, serial, date
model2, serial2, date2
model3, serial3, date3
etc.

And in my email template I would like to print the additional fields only if they are input.

My form processor uses $SESSION_ACCESS - is there a way to write this into the array that I don’t have to add hundreds of field names?

Same question with the email template, how can I count/automate this so I don’t have to write all the potential names:

[code]session_start();
$_SESSION[‘model’];
$_SESSION[‘serial’];
$_SESSION[‘date’];
$_SESSION[‘model2’];
$_SESSION[‘serial2’];
$_SESSION[‘date2’];
$_SESSION[‘model3’];
$_SESSION[‘serial3’];
$_SESSION[‘date3’];

if(isset($_SESSION[‘model’]))

echo "

Model # “. $_SESSION[“model”] .” Serial # ". $_SESSION["serial"] ." Purchased Date: ". $_SESSION["date"] ." "; else echo("");

if(isset($_SESSION[‘model2’]))

echo "

Model # “. $_SESSION[“model2”] .” Serial # ". $_SESSION["serial2"] ." Purchased Date: ". $_SESSION["date2"] ." "; else echo("");

if(isset($_SESSION[‘model3’]))

echo "

Model # “. $_SESSION[“model3”] .” Serial # ". $_SESSION["serial3"] ." Purchased Date: ". $_SESSION["date3"] ." "; else echo("");[/code]

I know someone knows a simple answer, thanks!!!

Sponsor our Newsletter | Privacy Policy | Terms of Service