Firstly sorry if the title make some of you confuse ... here's the real problem.
I am developing a system that generates a receipt from HTML Form. The real problem is that I don't know how to get all descriptions because I'm using multiple input controls on the form.
In add.php
, there are some description boxes where staff can enter the purchased info. I'm using Input. The code's are:
<input type='text' name='desc[1]' size='40px'><!-- (I'll copy paste it 9 times) -->
This is the only place to enter all info, then it will redirect to view the order info.
I can echo everything using $_REQUEST
, but I don't know how to echo this. People say it's an array but I don't understand it that much.
Here some code:
Add.php
<?php
include 'server.php';
session_start();
$id = $_SESSION['id'];
if (isset($_POST['submit'])) {
$order = $_POST['order'];
$name = $_POST['name'];
$tel = $_POST['tel'];
$orderdate = $_POST['orderdate'];
$firstfit = $_POST['firstfit'];
$event = $_POST['event'];
$desc = $_POST['desc'];
$color = $_POST['color'];
$address = $_POST['address'];
$syntax = "INSERT INTO `client` (`order`,`name`,`tel`,`orderdate`,`firstfit`,`event`,`desc`,`color`) VALUES ('$order','$name','$tel','$orderdate','$firstfit','$event','$desc','$color')";
$insert = mysqli_query($config, $syntax);
header("Location: do.php");
}
Then here's the input
<tr>
<th>DESCRIPTION :</th>
<td>
<input type="text" name="desc[1]" size="90px"><br>
<input type="text" name="desc[2]" size="90px"><br>
<input type="text" name="desc[3]" size="90px"><br>
<input type="text" name="desc[4]" size="90px"><br>
<input type="text" name="desc[5]" size="90px"><br>
<input type="text" name="desc[6]" size="90px"><br>
<input type="text" name="desc[7]" size="90px"><br>
<input type="text" name="desc[8]" size="90px"><br>
<input type="text" name="desc[9]" size="90px"><br>
</td>
</tr>
So how can I echo out all the 9 different descriptions into the receipt? I'm sorry if this question is not clear because I'm still a beginner :-(