<div> <p><font size="+1" color = 'red'>image must rename as category id & only upload .jpg format </br> max (h-95px / W 165px) </font></p> <label for="img">Image:</label> <input type="file" name="image" /> <input type="submit" name="submit" value="submit" /> </div>
if(isset($btnadd)){ $sql = "insert into category (cat_id,cat_name) values (:id,:cname)"; $stmt = $con ->prepare($sql); $stmt->execute(array(':id'=>$id,':cname'=> $cname)); $result = $stmt->fetch(PDO::FETCH_ASSOC); $tmp=$_FILES["file"]["tmp_name"]; $extension = explode("/", $_FILES["file"]["type"]); $name=$id.".".$extension[1]; move_uploaded_file($tmp, "images/" . $id.".".$extension[1]);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)