Hi,
I am creating an order form that brings data of the items and its price from a external .txt file. I am to add the number of items and get the total price of that product. Here is the code:
<form action="pay.php" method="post" name="form1">
<?php
$lines = file('list.txt');
$fnames = explode("|", $lines[0]);
for($i=1;$i<count($lines);$i++) {
$fvalues[] = explode("|", $lines[$i]);
}
?>
<?php
$j = 0;
foreach($fnames as $name){
?>
Product:
<select>
<?php
for($k=0;$k<($i-1);$k++){
?>
<option><?=$fvalues[$k][$j]; ?></option>
<?php
}
?>
</select>
<?php
$j++;
}
?>
<br><br>
Number of Item : <input type="text" name="itemcount" size="20"/>
<input type="submit" name='Order' value="order" />
</form>
Can someone help me on this?
Thanks