Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "php.php";
- $pripojeni = pripojeni();
- if (isset($_POST["submit"])) {
- $imagesCount = count($_FILES['image']['name']);
- for ($i = 0; $i < $imagesCount; $i++) {
- if (move_uploaded_file($_FILES['image']['tmp_name'][$i], 'galerie/' . $_FILES['image']['name'][$i]))
- echo ('nahráno');
- else
- echo ('chyba');
- }
- $Nadpis = $_POST["Nadpis"];
- $Text = $_POST["Text"];
- //$Id = $_SESSION["Id"];
- $Obr = $_POST["image"];
- $Dotaz = $pripojeni->prepare("INSERT INTO `clanek`(`Id_uzivatele`,`Nadpis`, `Txt`, `Obr`) VALUES (?,?,?,?)");
- var_dump($Dotaz);
- $Dotaz->bind_param("isss", $Id, $Nadpis, $Text, $Obr);
- $Dotaz->execute();
- }
- ?>
- <form method=POST class=clanek>Nadpis:<input type=text name=Nadpis>
- Text: <textarea name=Text cols=30 rows=10></textarea>
- Obr: <input type=file multiple= size=26 name=image[]>
- <input type=submit name=submit value=odeslat>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment