Hello i have a question.
I want to upload a file into 2 folders and a mysql database.
I am getting the file through a <input type="file" />
I already got the send part only the part that is putting in it to a folder not yet.
How must i do it?
I would like to do it with a include into the form part.
Here is the code for the form:
<?php
//echo $_POST;
include_once '../includes/db.inc.php';
include_once 'admin.inc.php';
check_login();
top_admin('occasions', $pagina_titel);
open_db();
echo '<form action="occ_send.php" method="post"> <br />';
echo 'Artikel:';
<input type="text" name="artikel"> <br />';
echo 'Korte omschrijving:';
<input type="text" name="korte_omschrijving"> <br />';
echo 'Uitgebreide omschrijving:';
<input type="text" name="uitgebreide_omschrijving"> <br />';
echo 'Prijs:';
<input type="text" name="prijs"> <br />';
echo 'Plaatje:';
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input type="file" name="plaatje"> <br />';
echo '<input type="submit" value="Invoeren"';
echo '</form>';
?>
And here is the code for the send to the database part:
<?php
//echo $_POST;
include_once '../includes/db.inc.php';
include_once 'admin.inc.php';
check_login();
top_admin('occasions', $pagina_titel);
open_db();
$sql="INSERT INTO occasion (occasion_name, occasion_short_description, occasion_long_description, occasion_price, occasion_picture)
VALUES
('$_POST[artikel]', '$_POST[korte_omschrijving]', '$_POST[uitgebreide_omschrijving]', '$_POST[prijs]', '$_POST[plaatje]')";
echo $sql . "<br />" . "<br />";
mysql_query($sql);
echo "1 artikel toegevoegd:" . "<br />";
echo "Artikel:" .$_POST['artikel'] . "<br />";
echo "Korte omschrijving:" .$_POST['korte_omschrijving'] . "<br />";
echo "Uitgebreide omschrijving:" .$_POST['uitgebreide_omschrijving'] . "<br />";
echo "Prijs:" .$_POST['prijs'] . "<br />";
echo "Plaatje:" .$_POST['plaatje'];
?>
I want to upload a file into 2 folders and a mysql database.
I am getting the file through a <input type="file" />
I already got the send part only the part that is putting in it to a folder not yet.
How must i do it?
I would like to do it with a include into the form part.
Here is the code for the form:
<?php
//echo $_POST;
include_once '../includes/db.inc.php';
include_once 'admin.inc.php';
check_login();
top_admin('occasions', $pagina_titel);
open_db();
echo '<form action="occ_send.php" method="post"> <br />';
echo 'Artikel:';
<input type="text" name="artikel"> <br />';
echo 'Korte omschrijving:';
<input type="text" name="korte_omschrijving"> <br />';
echo 'Uitgebreide omschrijving:';
<input type="text" name="uitgebreide_omschrijving"> <br />';
echo 'Prijs:';
<input type="text" name="prijs"> <br />';
echo 'Plaatje:';
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input type="file" name="plaatje"> <br />';
echo '<input type="submit" value="Invoeren"';
echo '</form>';
?>
And here is the code for the send to the database part:
<?php
//echo $_POST;
include_once '../includes/db.inc.php';
include_once 'admin.inc.php';
check_login();
top_admin('occasions', $pagina_titel);
open_db();
$sql="INSERT INTO occasion (occasion_name, occasion_short_description, occasion_long_description, occasion_price, occasion_picture)
VALUES
('$_POST[artikel]', '$_POST[korte_omschrijving]', '$_POST[uitgebreide_omschrijving]', '$_POST[prijs]', '$_POST[plaatje]')";
echo $sql . "<br />" . "<br />";
mysql_query($sql);
echo "1 artikel toegevoegd:" . "<br />";
echo "Artikel:" .$_POST['artikel'] . "<br />";
echo "Korte omschrijving:" .$_POST['korte_omschrijving'] . "<br />";
echo "Uitgebreide omschrijving:" .$_POST['uitgebreide_omschrijving'] . "<br />";
echo "Prijs:" .$_POST['prijs'] . "<br />";
echo "Plaatje:" .$_POST['plaatje'];
?>