Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path
- . $filename))
- {
- $req = $files->prepare('INSERT INTO toys(title, category, descrip, path) VALUES(:title, :category, :describ, :path)');
- $req->execute(array(
- ':title' => $_POST['title'],
- ':category' => $_POST['type'],
- ':describ' => $_POST['describ'],
- ':path' => $upload_path));
- echo 'Your file upload was successful, view the file <a
- href="' . $upload_path . $filename . '" title="Your
- File">here</a>';
- }
- <form method="post" action="upload.php" enctype="multipart/form-data">
- <label>Title</label> : <p><input type="text" name="title" /></p>
- Select the right category :<br />
- <input type="radio" name="type" id="lego"
- /> <label for="lego">Lego</label><br />
- <input type="radio" name="type" id="lego_technic"
- /> <label for="lego_technic">Lego Technic</label><br />
- <input type="radio" name="type" id="playmobil"
- /> <label for="playmobil">Playmobil</label><br />
- <input type="radio" name="type" id="meccano"
- /> <label for="meccano">Meccano</label><br />
- <label for="Describ">Description of the file</label><br />
- <textarea name="describ" id="describ" rows="10" cols="50" ></textarea>
- <p>
- <label for="file">Select a file:</label> <input type="file"
- name="userfile" id="file"> <br />
- <p>
- <input type="submit" name="upload" value="Upload" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement