General discussion

Place for discussing all the general topics

168
1

Hello,

i have php 5.6 project and mysql database used. previously we are useing the mysql_connect,mysql_sql we convert all these to mysqli_connect, mysqli->query().

on local environment this project works properly but if transfert the containts and database to share server it gives an error "user abc already has more than 'max_user_connections' active connections."

please guide me how to resolve this issue.

287
4
phig330 posted Mar 20 '18 at 12:43 pm

hello codo team !!
any news and/or update on codoforum ? Are you still working on the forum ?

We had not enough time to upgrade our 3.7 forum to 4.1, as we have modified forum code to add some features that are not yet in 4.1 ( like custom userlist with personnalized fields ).
Is there a new release planned ?

thanks for your work !

139
0

<?php
session_start();
error_reporting(0);
include('includes/config.php'smile;
if(isset($_POST['submit'])){
if(!empty($_SESSION['cart'])){
foreach($_POST['quantity'] as $key => $val){
if($val==0){
unset($_SESSION['cart'][$key]);
}else{
$_SESSION['cart'][$key]['quantity']=$val;

        }
    }
        echo "<script>alert('Your Cart has been Updated');</script>";
    }
}

// Code for Remove a Product from Cart
if(isset($_POST['remove_code']))
{

if(!empty($_SESSION['cart'])){
foreach($_POST['remove_code'] as $key){

            unset($_SESSION['cart'][$key]);
    }
        echo "<script>alert('Your Cart has been Updated');</script>";
}

}
// code for insert product in order table

if(isset($_POST['ordersubmit']))
{

if(strlen($_SESSION['login'])==0)
{
header('location:login.php'smile;
}
else{

$quantity=$_POST['quantity'];
$pdd=$_SESSION['pid'];
$value=array_combine($pdd,$quantity);


    foreach($value as $qty=> $val34){

mysqli_query($con,"insert into orders(userId,productId,quantity) values('".$_SESSION['id']."','$qty','$val34'smile"smile;
header('location:payment-method.php'smile;
}
}
}

?>

<!DOCTYPE html>

<html lang="en" style = "background-color: #07A612;">
<head>
<!-- Meta -->
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="MediaCenter, Template, eCommerce">
<meta name="robots" content="all">

<title>My Cart</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/main.css">
<link rel="stylesheet" href="assets/css/green.css">
<link rel="stylesheet" href="assets/css/owl.carousel.css">
<link rel="stylesheet" href="assets/css/owl.transitions.css">
<!--<link rel="stylesheet" href="assets/css/owl.theme.css">-->
<link href="assets/css/lightbox.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/animate.min.css">
<link rel="stylesheet" href="assets/css/rateit.css">
<link rel="stylesheet" href="assets/css/bootstrap-select.min.css">

<!-- Demo Purpose Only. Should be removed in production -->
<link rel="stylesheet" href="assets/css/config.css">

<link href="assets/css/green.css" rel="alternate stylesheet" title="Green color">
<link href="assets/css/blue.css" rel="alternate stylesheet" title="Blue color">
<link href="assets/css/red.css" rel="alternate stylesheet" title="Red color">
<link href="assets/css/orange.css" rel="alternate stylesheet" title="Orange color">
<link href="assets/css/dark-green.css" rel="alternate stylesheet" title="Darkgreen color">
<!-- Demo Purpose Only. Should be removed in production : END -->


<!-- Icons/Glyphs -->
<link rel="stylesheet" href="assets/css/font-awesome.min.css">

<!-- Fonts -->
<link href='http://fonts.googleapis.com/css?family=Roboto:300,400,500,700' rel='stylesheet' type='text/css'>

<!-- Favicon -->
<link rel="shortcut icon" href="assets/images/favicon.ico">

<!-- HTML5 elements and media queries Support for IE8 : HTML5 shim and Respond.js -->
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body class="cnt-home">



<!-- ============================================== HEADER ============================================== -->
<header class="header-style-1">
<?php include('includes/top-header1.php'smile;?>
<?php include('includes/main-header1.php'smile;?>

</header>
<!-- ============================================== HEADER : END ============================================== -->
<div class="breadcrumb">
<div class="container">
<div class="breadcrumb-inner">
<ul class="list-inline list-unstyled">
<li><a href="home.php">Home</a></li>
<li class='active'>Avail Products</li>
</ul>
</div><!-- /.breadcrumb-inner -->
</div><!-- /.container -->
</div><!-- /.breadcrumb --><?php
require_once('auth.php'smile;
?>
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">


<link rel="shortcut icon" href="logo.jpg">
<!-- Bootstrap Core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- MetisMenu CSS -->
<link href="vendor/metisMenu/metisMenu.min.css" rel="stylesheet">

<!-- Custom CSS -->
<link href="dist/css/sb-admin-2.css" rel="stylesheet">

<!-- Custom Fonts -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">


<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="src/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="src/facebox.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel=facebox]'smile.facebosmile{
loadingImage : 'src/loading.gif',
closeImage : 'src/closelabel.png'
})
})
</script>


</head>

<body>

<?php include('navfixed.php'smile;?>

<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header"><a style = "color:green;" href="home.php"><i class="fa fa-undo fa-fw"></i></a>Payment | <?php echo $_GET['id']; ?> </h1>
</div>

<div id="maintable"><div style="margin-top: -19px; margin-bottom: 21px;">
</div>
<form action="incoming.php" method="post" class = "form-group" >
<input type="hidden" name="pt" class = "form-control" value="<?php echo $_GET['id']; ?>" />
<input type="hidden" name="invoice" class = "form-control" value="<?php echo $_GET['invoice']; ?>" />

<label>Select a Product</label><br />
<select name="product" style="width:800px;" class="chzn-select" onchange="$('#imageToSwap'smile.attr('src', this.options[this.selectedIndex].value);">
<option></option>
<?php
include('connect.php'smile;
$result = $db->prepare("SELECT
FROM products"smile;
$result->bindParam(':userid', $res);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<option value="../uploads/<?php echo $row['image_location'];?>"
<?php
if($row['qty_left'] <= 0)
{
echo'disabled';
}
?>
>
<?php echo $row['product_code'];?>
Product: <?php echo $row['product_name']; ?>
- Quantity Left: <?php echo $row['qty_left']; ?>
- Price: ₱<?php echo $row['price']; ?>


</option>
<?php
}
?>
</select>


<?php if($row['image_location'] != ""smile: ?>
<img id="imageToSwap" class="profile" src="../uploads/<?php echo $row['image_location']; ?>" value = "<?php echo $row['image_location']; ?>" width="200px" height="200px" style="border:1px solid #333333;">

<?php else: ?>
<img id="imageToSwap" class="profile" src="../images/default.png" value = "<?php echo $row['image_location']; ?>"width="200px" height="200px" style="border:1px solid #333333;">
<?php endif; ?>
<br /><p> <?php echo $row['price']; ?> </p>
<label>Number of Item</label>
<input type="number" name="qty" value="1" min = "1" class = "form-control" autocomplete="off" style="width: 100px; padding-top: 6px; padding-bottom: 6px; margin-right: 4px;" />
<label>Discount</label>
<input type="text" name="discount" value="0" class = "form-control" autocomplete="off" style="width: 100px; padding-top: 6px; padding-bottom: 6px; margin-right: 4px;" readonly/>
<label>Value Add Tax:</label>
<input type="text" name="vat" value="0" class = "form-control" autocomplete="off" style="width: 100px; padding-top: 6px; padding-bottom: 6px; margin-right: 4px;" readonly/>
<br>
<input type="submit" name = "Submit" style = "background-color:green;"class="btn btn-primary" value="Add to Cart" class = "form-control" style="width: 123px;" />
</form>
<table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th> Product Code </th>
<th> Brand Name </th>
<th> Description Name </th>
<th> Category </th>
<th> Quantity </th>
<th> Price </th>
<th> Discount </th>
<th> VAT </th>
<th> Amount </th>
<th> Total Amount </th>
<!-- <th> Image </th>-->
<th> Delete </th>
</tr>
</thead>
<tbody>

<?php
$id=$_GET['invoice'];
include('connect.php'smile;
$result = $db->prepare("SELECT * FROM sales_order WHERE invoice= :userid"smile;
$result->bindParam(':userid', $id);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td><?php echo $row['product']; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['dname']; ?></td>
<td><?php echo $row['category']; ?></td>
<td><?php echo $row['qty']; ?></td>
<td>
<?php
$ppp=$row['price'];
echo formatMoney($ppp, true);
?>
</td>
<td>
<?php
$ddd=$row['discount'];
echo formatMoney($ddd, true);
?>
</td>
<td>
<?php
$fff=$row['vat'];
echo formatMoney($fff, true);
?>
</td>
<td>
<?php
$ccc=$row['amount'];
echo formatMoney($ccc, true);
?>
</td>

<td>
<?php
$dfdf=$row['total_amount'];

echo formatMoney($dfdf, true);
?>
</td>
<!-- <td>
<?php


?>
<?php if($row['image_location'] != ""smile: ?>
<img src="../uploads/<?php echo $row['image_location']; ?>" width="100px" height="100px" style="border:1px solid #333333;">

<?php else: ?>
<img src="../images/default.png" width="100px" height="100px" style="border:1px solid #333333;">
<?php endif; ?>
</td>-->


<td><a href="delete.php?id=<?php echo $row['transaction_id']; ?>&invoice=<?php echo $_GET['invoice']; ?>&dle=<?php echo $_GET['id']; ?>&qty=<?php echo $row['qty'];?>&code=<?php echo $row['product'];?>"> Delete</a></td>
</tr>
<?php
}
?>
<tr>
<td colspan="9"><strong style="font-size: 12px; color: #222222;">Total:</strong></td>
<td colspan="3"><strong style="font-size: 12px; color: #222222;">
<?php
function formatMoney($number, $fractional=false) {
if ($fractional) {
$number = sprintf('%.2f', $number);
}
while (true) {
$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
$number = $replaced;
} else {
break;
}
}
return $number;
}
$sdsd=$_GET['invoice'];
$resultas = $db->prepare("SELECT sum(total_amount) FROM sales_order WHERE invoice= :a"smile;
$resultas->bindParam(':a', $sdsd);
$resultas->execute();
for($i=0; $rowas = $resultas->fetch(); $i++){
$fgfg=$rowas['sum(total_amount)'];
echo formatMoney($fgfg, true);
}
?>
</strong></td>
</tr>

</tbody>
</table><br>
<strong> <input type="checkbox" id="check" /> NOTE: Please be informed that the minimum purchase is ₱1000 worth of products. If not, your order will be void. <br><br>
<a rel="facebox" id="submit1" style = "background-color:green;"class = "btn btn-primary" href="checkout.php?pt=<?php echo $_GET['id']?>&invoice=<?php echo $_GET['invoice']?>&total=<?php echo $fgfg ?>&cashier=<?php echo $session_cashier_name?>&p_amount=<?php echo $ccc?>"
disabled>Check Out</a>

<div class="clearfix"></div>
</div>

</div>
</div><br><br>
<!-- /#page-wrapper -->

<script>

$('#check'smile.click(function() {
if ($(this).is(':checked'smile) {
$('#submit1'smile.removeAttr('disabled'smile;
} else {
$('#submit1'smile.attr('disabled', 'disabled'smile;
}
});

</script>

<!-- jQuery -->
<script src="vendor/jquery/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>

<!-- Metis Menu Plugin JavaScript -->
<script src="vendor/metisMenu/metisMenu.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="dist/js/sb-admin-2.js"></script>

<link href="vendor/chosen.min.css" rel="stylesheet" media="screen">
<script src="vendor/chosen.jquery.min.js"></script>
<script>
$(function() {
$(".chzn-select"smile.chosen();

});
</script>

</body><?php include('includes/footer.php'smile;?>

</html>


then this is the error page

<?php
session_start();
include('connect.php'smile;
$a = $_POST['invoice'];
$b = $_POST['product'];
$c = $_POST['qty'];
$w = $_POST['pt'];
$r = $_POST['vat'];
$date = date('m/d/Y'smile;
$month = date('F'smile;
$year = date('Y'smile;

$discount = $_POST['discount'];
$result = $db->prepare("SELECT * FROM products WHERE product_code= :userid"smile;
$result->bindParam(':userid', $b);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
$asasa=$row['price'];
$name=$row['product_name'];
$dname=$row['description_name'];
$categ=$row['category'];
$qtyleft=$row['qty_left'];
}

//edit qty
$sql = "UPDATE products
SET qty_left=qty_left-?
WHERE product_code=?";
$q = $db->prepare($sql);
$q->execute(array($c,$b));
$fffffff=$asasa-$discount;
$d=$fffffff$c;
$z=$qtyleft-$c;
$vat=$d
$r;
$total=$vat+$d;
// query
$sql = "INSERT INTO sales_order (invoice,product,qty,amount,name,price,discount,category,date,omonth,oyear,qtyleft,dname,vat,total_amount) VALUES (:a,:b,:c,:d,:e,:f,:g,:h,:i,:j,:k,:l,:m,:n,:o)";
$q = $db->prepare($sql);
$q->execute(array(':a'=>$a,':b'=>$b,':c'=>$c,':d'=>$d,':e'=>$name,':f'=>$asasa,':g'=>$discount,':h'=>$categ,':i'=>$date,':j'=>$month,':k'=>$year,':l'=>$z,':m'=>$dname,':n'=>$vat,':o'=>$total));
header("location: sales.php?id=$w&invoice=$a"smile;

?>

130
1

Is it possible to send a notification email to the administrator when a user registers? I have enabled the "Account registrations require admin approval" option, but it seems the administrator is not notified.

What have I missed?

Another question: if I allow unverified users to create new topics, is it possible to automatically make those posts moderated, so that they only show up, after moderation?

recent by admin  ·  Jul 9 '18 at 4:33 pm
251
3

How can I add a private message button below the reply button on a post?

No-one can ever figure out how to private message on the forum I get complaints about it all the time, its kinda pointless to have it when people cant figure out how to use it.

clicking on the posters user name is not intuitive at all

the post needs to have a private message button somewhere clearly visible

EDIT: I just tried to figure out how to send a private message when using my phone and not a full laptop... in the mobile view clicking the username takes me to the list of their posts but provides zero way for me to send them a message?????

There is some sort of message bubble icon toward the bottom of the page that does nothing, giving the impression the messaging system is not working?????

I really love this forum you have spent so much time on, but I guess I should of spent more time using it on my phone other than just making sure it works...

at the bottom of each post needs to be 2 large buttons clearly visible , one saying post reply and the other saying send private message.

The super tiny icons at the top on mobile view are almost unusable and why would anyone need a stats button over a message button?

(also I had to start a new account since I can no longer log in by my username and the password reset never sent a pw to my registered address... no its not in spam)

recent by brenwa  ·  May 16 '18 at 7:53 pm
191
1

Has anyone had success getting the Search Engine Friendly URLs to work?

If I turn the 0 to a 1 in the constant file, and activate the htaccess while I have a forum setup it just endlessly refreshes until my browser stops it.

If I turn the 0 to 1 and activate the htaccess before I do the forum installation setup, the installation setup doesn't work (says it can't find any of the files.)

I've tried messing with as many settings as possible and have done multiple clean installs and have not been able to get it to work.

Thanks.

294
2
Ayie posted Feb 23 '18 at 12:57 pm

5a900ec14193e
this my table> can anyone help me how to data like this to my table

411,1,1,200 m WANITA - AKHIR,+0.6,M/S,,,,,"20:01,18.0794"
1,458,5,,NUR AISHAH ROFINA BINTI ALING,SANDAKAN,26.15,,26.144,,,"20:01,18.08",,,,26.144,26.144
2,401,8,,RUJIAH JAHAMIN,RANAU,27.13,,same time,,,"20:01,18.08",,,,0.978,0.978
3,009,7,,CAMELLIA JASTEN,BEAUFORT,27.65,,same time,,,"20:01,18.08",,,,0.520,0.520
4,464,3,,SHARIFAH AUSYAH BINTI MOHAMMAD,SANDAKAN,27.68,,same time,,,"20:01,18.08",,,,0.033,0.033
5,532,2,,MIANA MASINTA MOSUSAH,TAWAU,27.79,,same time,,,"20:01,18.08",,,,0.106,0.106
6,531,4,,JAMILAH SAPARUDDIN,TAWAU,27.88,,same time,,,"20:01,18.08",,,,0.099,0.099
7,626,6,,PETRONELLA LISONG,TUARAN,27.91,,same time,,,"20:01,18.08",,,,0.028,0.028
8,161,1,,LYVONIE HEAVENDRA DONNY,KOTA MARUDU,28.90,,same time,,,"20:01,18.08",,,,0.984,0.984

2.86k
5.92k
20
Actions
Hide topic messages
Enable infinite scrolling
Previous
Next
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft