Here the form:
<?php
session_start();
echo "<form name=\"aaaa\" method=\"post\" action=\"order_select3.php\">";
$values[1] = "I have select item1...";
$values[2] = "I have select item2...";
function radiob( $label, $var, $values )
{
foreach( $values AS $key => $value ) {
if ( isset( $_SESSION["$var"] ) AND $_SESSION["$var"] == $key )
$checked = "checked=\"checked\"";
else
$checked = "";
?><input type="radio" name="<?php echo $var;
?>" id="<?php echo $var;
?>" value="<?php echo $key;
?>" <?php echo $checked;
?>/>
<?php echo $value;
?> <br />
<?php
}
}
radiob( "Items select" , "items" , $values );
?>
<input type="submit" name="submit" value="order" />
Here the response:
<?php
session_start();
$_SESSION['items'] = $_POST['items'];
$items= $_POST['items'];
?>
<?php
$values[1] = "I have select item1...";
$values[2] = "I have select item2...";
echo $values[$_SESSION['items']];
?>
<input type="submit" name="submit" style="background-color:#00CC66" value=" I confirm" onClick="location.href='order_select_confirm3.php'">
<input type="submit" name="submit" style="background-color:#FF0000" value=" I change my order" onClick="location.href='order_form_select3.php'">
And here the confirm script that will send a mail with the selected value:
<?php
session_start();
$items = $_SESSION['items'];
$values[1] = "item1";
$values[2] = "item2";
$subject ="test";
$message =" you have select $items";
mail('my_mail_adress',$subject,$message);
print "Thanks";
?>
On the mail I get the value 1 or 2, what I want is "item1"(for $value1) or "item2" (for $value2) to be printed on the mail.
I appreciate your help, thanks