I seriously don’t know how to do this.
The user is allowed to attached as many recipe.pdf they want.. but i don’t know how to put it inside array. Can you guys show me how?
Here’s my code.
include('connect.php');
$db = mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_database);
$result = mysql_query("SELECT * FROM recipe_list");
echo "<ul>";
while ($row = mysql_fetch_row($result))
{
foreach($row as $recipe)
echo "<li>"<input type='checkbox[]' value='".$recipe."' checked /><label>".$recipe."</label></li>";
}
echo "</ul>";
mysql_free_result($result);
Next Code is the Part where I have the Email Attachments..
I seriously don’t know how to do the array part.
$file_folder = "/home/rdash/public_html/recipes/";
$recipes = array("recipe_001.pdf","recipe_002.pdf");
$files = array ($file_folder.$recipes[0], $file_folder.$recipes[1]);
In this code, i already input pdf names.
But how am i going to pull the $recipe from the first code?
I’m talking about the recipes from the query results. The one with the checkboxes.
Please help me.
If you’ll need more details. Just ask 🙂 Thanks
on next page you will get as
$_POST, if you set your form to post, an array ($_POST['recipes']) with recipe names.EDIT: if you just need the array: