Ajax Post php类没有加载问题?
嗨,我的问题是php扩展类未加载后的ajax帖子。 找不到命令。 发送普通(不使用ajax)表单没有问题 page.php 用户界面 comment.php Ajax贴子页面Ajax Post php类没有加载问题?,php,jquery,ajax,Php,Jquery,Ajax,嗨,我的问题是php扩展类未加载后的ajax帖子。 找不到命令。 发送普通(不使用ajax)表单没有问题 page.php 用户界面 comment.php Ajax贴子页面 inlcude_once("comment.class.php"); $new= new comment(); if(iseet($_POST)) { $cek= $new->yorumkontrol("sa","as@a.com",7,"
inlcude_once("comment.class.php");
$new= new comment();
if(iseet($_POST))
{
$cek= $new->yorumkontrol("sa","as@a.com",7,"12sdeaege","bu bir yorum");
if(isset($cek["hata"]))
{
echo $cek["hata"];
}
}
?>
Class.php
Php类文件加载函数
class dahilet
{
function autoload($gelen)
{
$dy=__DIR__."/".$gelen.".sinif.php";
if(file_exists($dy))
{
include_once($dy);
}
else
{
die("$gelen not found.");
}
}
}
$dosyaknt=new dahilet();
spl_autoload_register(array($dosyaknt,'autoload'));
comment.class.php
注释类索引
注释表单功能注释表单控制功能
注释添加数据库功能
commfuct类索引
评论类别控制功能
注释机器人控制功能
注释重力仪控制功能
注释google recaptcha控制功能
include_once("class.php");
$dh= new dahilet();
$dh->autoload("db");
class comment extends commfunct
{
function yorumkontrol($a,$b,$c,$d,$e)
{
$na= self::konumsor($a,$b);
return $na;//for example
}
}
class commfunct extends baglan
{
function konumsor($a,$b)
{
$sql="select * from linksistem where id=:idal,cid=:cidal order by sira asc limit 1";
$sor=$db->prepare($sql);
$sor->execute(array("idal"=>$a,"cidal"=>$b))
if(isset($sor->errorInfo()[2]))
{
if($sor->rowCount()>0)
{ return false;}
else {return true;}
}
else{return false;}
}
}
?>
您扩展了commfunct类。这里
类注释扩展了commfunct
但是这个commfunct
类代码在这一行下面,这就是为什么commfunct类找不到的原因
解决方案:-
将您的commfunt
类代码放在扩展行之前,您就可以开始了将您的commfunt类代码放在注释类代码之前,然后检查您的操作了吗checked@Anant检查良好,问题已解决:)很高兴帮助您:):)
include_once("class.php");
$dh= new dahilet();
$dh->autoload("db");
class comment extends commfunct
{
function yorumkontrol($a,$b,$c,$d,$e)
{
$na= self::konumsor($a,$b);
return $na;//for example
}
}
class commfunct extends baglan
{
function konumsor($a,$b)
{
$sql="select * from linksistem where id=:idal,cid=:cidal order by sira asc limit 1";
$sor=$db->prepare($sql);
$sor->execute(array("idal"=>$a,"cidal"=>$b))
if(isset($sor->errorInfo()[2]))
{
if($sor->rowCount()>0)
{ return false;}
else {return true;}
}
else{return false;}
}
}
?>