im a beginner in php / mysql so go easy on me :)
I made a very basic php order form for our work which has lots of dropdown boxes. This submits the results via an email using sendmail in php.
Now im trying to make it dynamic using a sql database.
I have the form set up using the sql and php, but my problem lies in the sending of the dynamically generated data.
I have all the variables available by using this line
extract($_POST['orderdetails'], EXTR_SKIP);
the variables end up as $vanilla00, $vanilla06, $vanilla11, etc...
So now I have this code to create the table using these variables
while($row = mysql_fetch_array($resultbline))
{$message .="<tr><td>"
. $row['prod_name']
. "</td><td> </td><td></td>
<td>$" . $row['prod_selectname'] . "0</td>
<td>$" . $row['prod_selectname'] . "6</td>
<td>$" . $row['prod_selectname'] . "11</td>
<td>$" . $row['prod_selectname'] . "18</td>
<td>$" . $row['prod_selectname'] . "t</td>
<td>$" . $row['prod_selectname'] . "24</td>
<td>$" . $row['prod_selectname'] . "36</td>" ;
}
The prod_selectname is taken from the database and in this instance will be vanilla, so the final table ends up reading
while($row = mysql_fetch_array($resultbline))
{$message .="<tr><td>"
. $row['prod_name']
. "</td><td> </td><td></td>
<td>$vanilla0</td>
<td>$vanilla6</td>
<td>$vanilla11</td>
<td>$vanilla18</td>
<td>$vanillat</td>
<td>$vanilla24</td>
<td>$vanilla36</td>" ;
}
the problem is that the resulting email shows the variable name (ie vanilla18) instead of treating it as a variable.
Am I missing some . { ( [ or other code somewhere ?
Sorry to be so thorough, but I dont know how else to explain it.
Thanks in advance