自定义电子商务应用程序中的管理面板更新类别失败 [英] Updating categories failed from the admin panel in custom eCommerce application

查看:55
本文介绍了自定义电子商务应用程序中的管理面板更新类别失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我正在制作电子商务网络应用程序,我正在尝试从管理面板更新类别。



我有2页(index.php和UpdateCategory.php)在根目录中admin文件夹内的categories文件夹中。



现在,我遇到了 503的错误 - 间歇性服务每当我点击index.php文件中的更新按钮时,就不可用了。这只发生在子类别而不是父类别。



这是index.php文件:

Well, I am making the eCommerce web application and I am trying to update the categories from the admin panel.

I have 2 pages (index.php and UpdateCategory.php) in categories folder which lies inside the admin folder in the root directory.

Now, I have come across the error of 503 - Intermittent service unavailable whenever I click on the update button which is in the index.php file. This happens only with the child category and not the parent category.

Here's the index.php file:

<?php
$table = '';
require_once '../../Classes/class.Validation.php';
$validate = new Validation();
$qu = "SELECT CatId, CatName FROM categories";
$validate->Query($qu);
if ($validate->NumRows()) {
    while ( $row = $validate->FetchAllDatas() ) {
        $table .= '<tr>';
        $table .= '<td class="text-center">';
        $table .= '<input type="checkbox" name="deleteCat[]" value='.$row["CatId"].'>';
        $table .= '</td>';
        $table .= '<td>';
        $table .= $row["CatName"];
        $table .= '</td>';
        $table .= '<td>';
        $table .= '<a href="//www.example.com/nbs/Administrators/Categories/UpdateCategory.php?id='.$row["CatId"].'">UPDATE</a>';
        $table .= '</td>';
        $table .= '<tr>';
    }
}
echo $table;
?>





每当我点击更新index.php文件中的链接,请求UpdateCategory.php。浏览器仅对父类别完美地响应页面,并且不响应子类别。在根目录中添加.htaccess文件之前根本没有发生此错误,我在几天前(也许是3-4天)添加了.htaccess文件。



这是.htacccess文件:



Whenever I click on the UPDATE link in the index.php file, UpdateCategory.php is requested. The browser responses with the page perfectly only for the parent category and does not responses to the child category. This error didn't occurred at all before adding .htaccess file in the root directory and I had added .htaccess file just few days back (maybe 3-4 days).

Here's the .htacccess file:

RewriteEngine On

RewriteRule ^product/([^/.]+)/?$ product.php?code=$1 [L]

RewriteRule ^beneficiary/([^/.]+)/?$ beneficiary.php?code=$1 [L]

RewriteRule ^categories/([^/.]+)/?$ categories.php?name=$1 [L]

RewriteRule ^category/([^/.]+)/?$ category.php?name=$1 [L]





类别表总数18个类别(包括父母和孩子)



我也被告知优化PHP代码和查询。如何优化php代码和mysqli查询?



请帮我解决这个问题。



非常感谢任何帮助。



The categories table have total 18 categories (inclusive of both parent and child)

I am also told to optimize the php code and also the queries. How do I optimize the php code and the mysqli queries ?

Kindly help me in solving this.

Any help is greatly appreciated.

推荐答案

table = ' ';
require_once ' ../../ Classes / class.Validation.php';
table = ''; require_once '../../Classes/class.Validation.php';


validate = new 验证();
validate = new Validation();


qu = SELECT CatId,CatName FROM categories;


这篇关于自定义电子商务应用程序中的管理面板更新类别失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆