Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
include '../../../database/catdb.php';
// include 'productheade.php';
?>
<?php
if(isset($_POST['add_product']))
{
$name = $_POST['txt_name'];
$price = $_POST['price'];
$description = $_POST['description'];
$procat = $_POST['product_cat'];
$featured = $_POST['feature'];
$images = $_FILES['txt_file']['name'];
$tmp_dir = $_FILES['txt_file']['tmp_name'];
$imageSize = $_FILES['txt_file']['size'];
$uploads_dir = '../../../../uploads/';
$imgExt=strtolower(pathinfo($images,PATHINFO_EXTENSION));
$valid_extensions=array('jpeg','jpg','png');
$pro_image=rand(1000, 1000000).".".$imgExt;
move_uploaded_file($tmp_dir, $uploads_dir.$pro_image);
$stmt=$pdo->prepare('INSERT INTO tbl_products
(pro_name,pro_image,price,description,feature,product_categories)
VALUES
(:uname, :upic, :uprice, :udescription,:ufeature,:uprocat)');
$stmt->bindParam(':uname',$name);
$stmt->bindParam(':upic',$pro_image);
$stmt->bindParam(':uprice',$price);
$stmt->bindParam(':udescription',$description);
$stmt->bindParam(':uprocat',$procat);
$stmt->bindParam(':ufeature',$featured);
if($stmt->execute()){
header('location:productdisplay.php');
}else
{
?>
<script>
alert('Error');
</script>";
<?php
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="productstyle.css">
</head>
<body>
<h2> Add Product </h2>
<form method="POST" action="addproducts.php" enctype="multipart/form-data">
<label>Name:</label><input type="text" name="txt_name" placeholder="Enter product name">
<label>File:</label><input type="file" name="txt_file" class="form-control">
<label>Price:</label><input type="text" maxlength="8" name="price">
<label>Description:</label> <textarea name="description"></textarea>
<label>Do you want your product to be featured?</label>
Yes<input type="radio" name="feature" value="yes">
No<input type="radio" name="feature" value="no">
<label>Category: </label>
<select name="product_cat">
<?php
$users = $pdo->prepare("SELECT * FROM tbl_cat");
$users->execute();
foreach ($users as $user) {
echo '<option value ="'.$user['cat_id'].'">'.$user['cat_name'].'</option>';
}
?>
</select>
<br><br>
<input type="submit" name="add_product" value="Add Product">
</form>
</body>
</html>
![]() |
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team