Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Pure VPN - Up to 27 Months
vgp
Updated:
Friday at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
May 30, 2026
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
php help in image uploading
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="rudr@" data-source="post: 21045082" data-attributes="member: 315778"><p>image witharak upload wenne ne, anith data tika enter wenawa...</p><p></p><p><img src="http://i66.tinypic.com/21ccb2g.jpg" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>[HTML]<!DOCTYPE></p><p><?php</p><p> include("includes/db.php");</p><p>?></p><p><html></p><p> <head></p><p> <title>Inserting Product</title></p><p> <script src="//cdn.tinymce.com/4/tinymce.min.js"></script></p><p> <script>tinymce.init({ selector:'textarea' });</script> </p><p> </head></p><p> <body bgcolor="skyblue"></p><p> <form action="insert_product.php" method="post" encrypt="multipart/form-data"></p><p> <table align="center" width="750" border="2" bgcolor="Orange"></p><p> <tr align="center"></p><p> <td colspan="7"><h2>Insert New Post Here</h2></td> </p><p> <tr></p><p> <td align="right"><b>Product Title:</b> </td></p><p> <td><input type="text" name="product_title" size="60" required/></td></p><p> </tr></p><p> <tr></p><p> <td align="right"><b>Product Category:</b> </td></p><p> <td> </p><p> <select name="product_cat" required/></p><p> <option>Select a Category</option></p><p> <?php</p><p> // select categories</p><p> $get_cats= "select * from categories ";</p><p> $run_cats = mysqli_query($con,$get_cats); </p><p> while ($row_cats= mysqli_fetch_array($run_cats)){ </p><p> $cat_id = $row_cats['cat_id'];</p><p> $cat_title = $row_cats['cat_title']; </p><p> echo "<option value='$cat_id'>$cat_title</option>";</p><p> }</p><p> ?> </p><p> </select> </p><p> </td></p><p> </tr></p><p> <tr></p><p> <td align="right"><b>Product Brand:</b> </td></p><p> <td></p><p> <select name="product_brand" required/></p><p> <option>Select a Brand</option></p><p> <?php</p><p> // select brands</p><p> $get_brands= "select * from brands ";</p><p> $run_brands = mysqli_query($con,$get_brands); </p><p> while ($row_brands= mysqli_fetch_array($run_brands)){ </p><p> $brand_id = $row_brands['brand_id'];</p><p> $brand_title = $row_brands['brand_title']; </p><p> echo "<option value='$brand_id'>$brand_title</option>";</p><p> }</p><p> ?> </p><p> </select> </p><p> </td></p><p> </tr></p><p> <tr></p><p> <td align="right"><b>Product Image:</b> </td></p><p> <td><input type="file" name="product_image"/></td></p><p> </tr></p><p> <tr></p><p> <td align="right"><b>Product Price: </b></td></p><p> <td><input type="text" name="product_price" /></td></p><p> </tr></p><p> <tr></p><p> <td align="right"><b>Product Description: </b></td></p><p> <td></p><p> <textarea name="product_desc" cols="30" rows="10" / ></textarea></p><p> </td></p><p> </tr></p><p> <tr></p><p> <td align="right"><b>Product Keywords:</b> </td></p><p> <td><input type="text" name="product_keywords" size="60" required/></td></p><p> </tr></p><p> <tr align="center"> </p><p> <td colspan="8"><input type="submit" name="insert_post" value="Insert Product Now"></td></p><p> </tr> </p><p> </tr></p><p> </table></p><p> </form> </p><p> </body></p><p></html></p><p><?php</p><p> </p><p> if(isset($_POST['insert_post'])){</p><p> </p><p> $product_title = $_POST['product_title'];</p><p> $product_cat = $_POST['product_cat'];</p><p> $product_brand = $_POST['product_title'];</p><p> $product_price = $_POST['product_price'];</p><p> $product_desc = $_POST['product_desc'];</p><p> $product_keywords = $_POST['product_keywords'];</p><p> </p><p> $product_image = $_FILES['product_image']['name'][0];</p><p> $product_image_tmp = $_FILES['product_image']['tmp_name'][0];</p><p> </p><p> </p><p> move_uploaded_file($product_image_tmp,"product_images/$product_image");</p><p> </p><p> echo $insert_product = "insert into products</p><p> (product_cat,product_brand,product_title,product_price,product_desc,product_image,product_keywords)</p><p> values('$product_cat','$product_brand','$product_title','$product_price','$product_desc','$product_image','$product_keywords')";</p><p></p><p> </p><p> $insert_pro = mysqli_query($con,$insert_product);</p><p> </p><p> if($insert_pro){</p><p> echo "<script>alert('Product Has Been Inserted')</script>";</p><p> echo "<script>window.open('insert_product.php','_self')</script>";</p><p> </p><p> }</p><p> </p><p> }</p><p> ?>[/HTML]</p></blockquote><p></p>
[QUOTE="rudr@, post: 21045082, member: 315778"] image witharak upload wenne ne, anith data tika enter wenawa... [IMG]http://i66.tinypic.com/21ccb2g.jpg[/IMG] [HTML]<!DOCTYPE> <?php include("includes/db.php"); ?> <html> <head> <title>Inserting Product</title> <script src="//cdn.tinymce.com/4/tinymce.min.js"></script> <script>tinymce.init({ selector:'textarea' });</script> </head> <body bgcolor="skyblue"> <form action="insert_product.php" method="post" encrypt="multipart/form-data"> <table align="center" width="750" border="2" bgcolor="Orange"> <tr align="center"> <td colspan="7"><h2>Insert New Post Here</h2></td> <tr> <td align="right"><b>Product Title:</b> </td> <td><input type="text" name="product_title" size="60" required/></td> </tr> <tr> <td align="right"><b>Product Category:</b> </td> <td> <select name="product_cat" required/> <option>Select a Category</option> <?php // select categories $get_cats= "select * from categories "; $run_cats = mysqli_query($con,$get_cats); while ($row_cats= mysqli_fetch_array($run_cats)){ $cat_id = $row_cats['cat_id']; $cat_title = $row_cats['cat_title']; echo "<option value='$cat_id'>$cat_title</option>"; } ?> </select> </td> </tr> <tr> <td align="right"><b>Product Brand:</b> </td> <td> <select name="product_brand" required/> <option>Select a Brand</option> <?php // select brands $get_brands= "select * from brands "; $run_brands = mysqli_query($con,$get_brands); while ($row_brands= mysqli_fetch_array($run_brands)){ $brand_id = $row_brands['brand_id']; $brand_title = $row_brands['brand_title']; echo "<option value='$brand_id'>$brand_title</option>"; } ?> </select> </td> </tr> <tr> <td align="right"><b>Product Image:</b> </td> <td><input type="file" name="product_image"/></td> </tr> <tr> <td align="right"><b>Product Price: </b></td> <td><input type="text" name="product_price" /></td> </tr> <tr> <td align="right"><b>Product Description: </b></td> <td> <textarea name="product_desc" cols="30" rows="10" / ></textarea> </td> </tr> <tr> <td align="right"><b>Product Keywords:</b> </td> <td><input type="text" name="product_keywords" size="60" required/></td> </tr> <tr align="center"> <td colspan="8"><input type="submit" name="insert_post" value="Insert Product Now"></td> </tr> </tr> </table> </form> </body> </html> <?php if(isset($_POST['insert_post'])){ $product_title = $_POST['product_title']; $product_cat = $_POST['product_cat']; $product_brand = $_POST['product_title']; $product_price = $_POST['product_price']; $product_desc = $_POST['product_desc']; $product_keywords = $_POST['product_keywords']; $product_image = $_FILES['product_image']['name'][0]; $product_image_tmp = $_FILES['product_image']['tmp_name'][0]; move_uploaded_file($product_image_tmp,"product_images/$product_image"); echo $insert_product = "insert into products (product_cat,product_brand,product_title,product_price,product_desc,product_image,product_keywords) values('$product_cat','$product_brand','$product_title','$product_price','$product_desc','$product_image','$product_keywords')"; $insert_pro = mysqli_query($con,$insert_product); if($insert_pro){ echo "<script>alert('Product Has Been Inserted')</script>"; echo "<script>window.open('insert_product.php','_self')</script>"; } } ?>[/HTML] [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom