如何防止网站崩溃 [英] How to prevent website to crash

查看:73
本文介绍了如何防止网站崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...我正在使用php开发一个网站,并且我知道当涉及到此页面时,我只是一个新手,而有人刚刚说,当我的网站开始出现访问量时,该网站可能会崩溃...所以我想知道在创建动态网站时该做什么和不该做什么.例如,我有这2页...第一页是这样的:
action.php
->它仅包含要显示的表单(新类别表单).现在,在此表单上,我将调用一个页面,即update.php

update.php
-> update.php包含以下代码

Hi guys... i''m developing a website using php and im aware that im just a newbie when it comes to this page and someone just said that when my website start to have traffic the website could crash... so i was wondering what are the do''s and dont''s on creating a dynamic website... For example i have this 2 page... the first page is this:
action.php
-> This only contains a form to be displayed (new category form). Now on this form i''m calling a page namely update.php

update.php
-> update.php contains this code

switch($action){
case ''new_user'':
			
$values= array("action" => "insert",
	"table" => "mytable",
	"column" => "",
	"values" => "''''" . ", " .	
	quotedstr($_POST[''user_desc'']) . ", " .
	quotedstr("0") . ", " .
	quotedstr(isset($_POST[''can_post_blog'']) ? "1" : "0") . ", " .
	quotedstr(isset($_POST[''can_sell'']) ? "1" : "0") . ", " .
	quotedstr(isset($_POST[''page_misc_profile'']) ? "1" : "0") . ""
	,
        "where" => "",
	"specialStatement" => ""			
	);
			
	$output= updateQuery($values);
	break;
default:
	$output="no";
	break;
}
echo $output;



正如您在我的update.php即时消息中看到的,我不使用任何类或类的扩展或任何其他内容...这是否会增加我的网站崩溃的可能性?我不知道什么是最好的方法...



as you can see on my update.php im not using any class or extending of class or whatsoever... will this add to the possibility that my site will crash? i dont know what should be the best approach...

推荐答案

action){ 情况"new_user":
action){ case ''new_user'':


values = array("action" =>"insert", 表" => "mytable", 列" => ", 值" => "". ,". quotedstr(
values= array("action" => "insert", "table" => "mytable", "column" => "", "values" => "''''" . ", " . quotedstr(


_POST [''user_desc'']). ,". quotedstr("0"). ,". quotedstr(isset(
_POST[''user_desc'']) . ", " . quotedstr("0") . ", " . quotedstr(isset(


这篇关于如何防止网站崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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