Advertisement
Guest User

Untitled

a guest
Mar 7th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path
  2.     . $filename))
  3. {
  4.     $req = $files->prepare('INSERT INTO toys(title, category, descrip, path) VALUES(:title, :category, :describ, :path)');
  5.     $req->execute(array(
  6.         ':title' => $_POST['title'],
  7.         ':category' => $_POST['type'],
  8.         ':describ' => $_POST['describ'],
  9.         ':path' => $upload_path));
  10.  
  11.          echo 'Your file upload was successful, view the file <a
  12.   href="' . $upload_path . $filename . '" title="Your
  13.   File">here</a>';
  14. }
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21. <form method="post" action="upload.php" enctype="multipart/form-data">
  22.   <label>Title</label> : <p><input type="text" name="title" /></p>
  23.        Select the right category :<br />
  24.        <input type="radio" name="type" id="lego"
  25.        /> <label for="lego">Lego</label><br />
  26.        <input type="radio" name="type" id="lego_technic"
  27.        /> <label for="lego_technic">Lego Technic</label><br />
  28.        <input type="radio" name="type" id="playmobil"
  29.        /> <label for="playmobil">Playmobil</label><br />
  30.        <input type="radio" name="type" id="meccano"
  31.        /> <label for="meccano">Meccano</label><br />
  32.  
  33.   <label for="Describ">Description of the file</label><br />
  34.   <textarea name="describ" id="describ" rows="10" cols="50" ></textarea>
  35.   <p>
  36.       <label for="file">Select a file:</label> <input type="file"
  37.       name="userfile" id="file"> <br />
  38.    <p>
  39.  
  40.   <input type="submit" name="upload" value="Upload" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement