Pages

Tuesday, March 25, 2014

Create a Random Photo Gallery - part 2 (Create a photo Upload Form)

This video series about How to display a gallery with specified  number of photos randomly, each time  you load the webpage

PHP + HTML , Wampserver

This shows how to
create a file upload form with PHP + HTML







<?php 
 $db_con=mysqli_connect('localhost','root','','photos') or die("Connection error");
  $form = '<form id="myfrom" enctype="multipart/form-data" method="POST" action="photoDB.php">';
  $form .= 'Chose photos to Upload :';
 $form .= '<input type="file" name="photoUp" accept="image/*" required/>'; 
 $form .= '<p><button type="submit" value="upload ">Upload </button>';
 $form .= '</form>';
?>
<!DOCTYPE html>
<html>
<head> 
 <meta charset="UTF-8"/> 
</head>
<body style="background:#303030;"> 
 <div id = "photoform" style="color:#fff;margin:20px 50px;" ><?php echo $form ; ?></div> 
</body>
</html>

No comments:

Post a Comment