It should be fairly easy.
Have your Javascript generated form submit to a PHP file (most likely the same one that generates the original form).
Use sessions to store the package in a temporary variable. Print out the contents of that variable at the bottom of the page when it is being generated.
Then have another button to "Finish" the process, which goes through the session variable and submits it into MySQL.
Somewhat like this:
package.php
PHP Code:
session_start();
Code:
<form action="package.php">
( Your Form )
<input type="submit" name="add" />
<input type="submit" name="finish" />
</form>
PHP Code:
if (isset($_REQUEST['finish'])) {
foreach ($_SESSION['packages'] as $package) {
// TODO: Use MySQL to insert each package into the Database
echo "Your order has been received!";
}
}
if (isset($_REQUEST['add'])) {
// TODO: Create an array with the phone package here
$_SESSION['packages'][] = $package;
}
foreach ($_SESSION['packages'] as $package) {
// TODO: Echo your package details as HTML
}