草庐IT

undefined-index

全部标签

php - 我在使用 Index.php 加载主页时收到 404,但 index.php 在直接链接上工作,为什么?

我似乎无法理解为什么我的Homepage突然拒绝直接加载,即:www.mysite.com/但加载仅当您键入www.mysite.com/index.php时这是网站:比较:http://www.propasiarealty.com//Sendsyoutothe404page鉴于:http://www.propasiarealty.com/index.php//Loadsthehomepage.无法弄清楚到底哪里出了问题,请帮忙。下面是Filezilla的截图:编辑01请看我的HTACCESS...快照更新02我修改了HTACCESS还是没有成功,现在看起来是这样的:Directory

php - 处理 undefined variable

我有这个索引函数,其中包含变量$product、$categories、$most_views、$show,$check,$checkforid。publicfunctionindex(){$products=Product::where(['status'=>'1'])->orderBy('most_viewed','desc')->with('category')->get();$categories=Category::all();$mostviews=Product::where(['status'=>'Onsale'])->orderBy('most_viewed','des

PHP_SELF 返回/index.php/index.php

为什么$_SERVER['PHP_SELF']返回/index.php/index.php??请求http://example.com输出/index.php/index.php索引.phpnginx.confserver{listen80;server_namedomain.com;root/var/www/public/www;#Addtrailingslashrewrite^([^.\?]*[^/])$$1/permanent;location/{try_files$uri$uri//index.php?$query_string;}location~\.php${include

PHP:从父级调用静态方法时出现 "Call to undefined method"错误

如果两者都是静态的,从父类调用子类方法的正确方法是什么?当我使用静态类时它返回错误“调用未定义的方法A::multi()”,但是当我使用非静态方法时没有问题,例如://--------------STATIC------------------classA{publicstaticfunctioncalc($a,$b){returnself::multi($a,$b);}}classBextendsA{publicstaticfunctionmulti($a,$b){return$a*$b;}}echoB::calc(3,4);//ERROR!!//--------------NON-

php - XMLHttpRequest 在 IE9 中总是返回 undefined

我想知道为什么这段代码适用于firefox、chrome和IE10,但不适用于IE9varajaxReq=newXMLHttpRequest();varparams="name="+$('#name').val()varurl="register.php";ajaxReq.open("POST",url,true);ajaxReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");ajaxReq.setRequestHeader("Content-length",params.length);aja

PHP 将 url 传递给 index.php

这应该非常简单,但我希望能够像php框架那样将url用作变量。mywebsite.com/hello-world我希望我的index.php将“hello-world”视为一个变量,并且我希望加载index.php。这是通过php完成的还是我必须使用htaccess文件?许多php框架使用url向索引文件发送消息...例如...mysite.com/controller/view我自己如何通过php路由它们?一点帮助? 最佳答案 有两个步骤:使用.htaccess文件重写url(在linux上)。您需要确保所有请求都转到您的php文

php - Codeigniter 3.1.6 - 如何从 url 中删除 index.php

我正在开发codeigniter3.1.6。我添加了.htaccess文件。我还将base_url路径更改为我的项目路径,从index_page中删除了index.php并更改了url_protocol到REQUEST_URI。仍然,当我将url重定向到任何Controller方法时,它会抛出错误,如“找不到您请求的页面。”我还搜索并应用了不同的.htaccess,但它不起作用。如果我在base_url末尾添加/index.php那么它可以工作但它是错误的。它应该在没有index.php的情况下工作。只有3.1.6给出了这个问题。注意:codeigniter-3.1.4工作正常,只是这

PHP 错误 : Undefined offset: 1

这似乎是处理数组的错误,但我无法弄清楚。我真的刚刚开始使用PHP,这有点令人生畏。任何帮助将不胜感激!这是我的代码:ChooseaPoll!";$read=file('poll_topics.txt');$data=array();foreach($readas$lines){list($key,$v)=explode("|","$lines");$data[$key]=$v;}foreach($dataas$k=>$desc){echo"$k-$desc";}?>这是文本文件中的内容:Instruments|Whatkindofinstrumentsdoyoulike?Music|W

php - 为什么我收到此错误通知 : Undefined index: host

我的示例代码在这里include'simple_html_dom.php';functionget_all_links($url){global$host;$html=newsimple_html_dom();$html->load(file_get_contents($url));foreach($html->find('a')as$a){$host1=parse_url($a->href);$host=parse_url($url);if($host1['host']==$host['host']){$data[]=$a->href;}}return$data;}$links=ge

php - Symfony2 - 通知 : Undefined offset: 0 due to a custom Query

我有这个错误:"Notice:Undefinedoffset:0inC:\wamp\www\Videotheque\vendor\doctrine\lib\Doctrine\ORM\QueryBuilder.phpline240"我正在创建一个在线视频集。有2个实体:电影和流派。在我的GenRepository方法中,我尝试将函数findAll()重新定义为与某个流派相关联的电影数量。这是函数:publicfunctionmyFindAll(){$genres=$this->_em->createQueryBuilder('g')//leftJoinbecauseIneedallthe