草庐IT

undefine

全部标签

php - 我该如何解决这个 undefined index 错误? Jquery Ajax 到 PHP

我正在使用Jquery、Ajax和PHP尝试发送要写入mysql数据库的变量。正在发出Ajax请求,但php.ini未获取变量。我不知道为什么会这样。使用firebug和console.log()我可以看到已经对write_results.php进行了POST如果我检查它说的Response注意:E:\write_results.php中2未定义索引:testscore这是我的PHP这是我的ajax脚本$(document).ready(function(){testscore="tryagain";//testvaluetoenterintothemysqldatabase$.aja

php - 获取 undefined variable : PHP_SELF

这是我从网站下载的应用程序代码,但它显示在错误日志中GettingUndefinedvariable:PHP_SELFonline150,inindex.php,现在第150行是"method="GET">这是表单的完整代码"method="GET">"name=p1>"name=p2> 最佳答案 它应该是$_SERVER变量中的索引:"...>当然,除非你定义它:$PHP_SELF=$_SERVER['PHP_SELF'];或者,您也可以省略它,因为您的目的是在当前页面中提交表单: 关

php - undefined offset PHP,不确定它的作用

这个问题在这里已经有了答案:"Notice:Undefinedvariable","Notice:Undefinedindex","Warning:Undefinedarraykey",and"Notice:Undefinedoffset"usingPHP(29个答案)关闭6个月前。我在PHPerror.log中有以下错误[TueDec1912:08:22.8875742017][:error][pid32196][clientxx.xx.xx.x:20560]PHPNotice:Undefinedoffset:8in/var/www/html/page.phponline55,ref

php - 在 CakePHP 2.0 中使用 Html Helper 时 undefined variable

我在第一次尝试CakePHP时收到此错误:Undefinedvariable:html[APP/View/Posts/index.ctp,line13]我有2.0-alpha版,是我弄错了版本还是又发生了什么变化。似乎找不到html助手。根据要求提供更多信息:这里是index.ctp文件link($post['Post']['title'],array('controller'=>'posts','action'=>'view',$post['Post']['id']));?>数据肯定会通过,但我得到的错误是第13行:Undefinedvariable:html[APP/View/Po

php - ftp_connect fatal error : call undefined function

出于某种原因,ftp_connect()函数不起作用,当我尝试使用它时,它以fatalerror结束,指出此函数未定义...令人惊讶的是我仍然可以使用ftp客户端或使用ftp连接通过终端。我该如何解决这个问题?我在MountainLion上运行,我有5.3php版本-我重新安装了一次,希望这能解决我的问题。 最佳答案 检查PHPFTPinstallationmanual在PHP7上,您可以通过将此行添加到php.ini文件来启用它。extension=php_ftp.dll在PHP8+上启用php.ini中的这一行:extensio

php - 数据表页脚错误 : Uncaught TypeError: Cannot set property 'nTf' of undefined

我面临与数据表相关的问题。我有大量记录(45,000+)。所以我使用带有“服务器端”编码的数据表。问题是这样的,它在下面的代码中显示以下错误是:错误:UncaughtTypeError:Cannotsetproperty'nTf'ofundefined//allowscellstobeusedformultiplecolumnsusingcolspanif(tfoot!==null){varcells=oSettings.aoFooter[0];for(i=0,ien=cells.length;i我为此使用的JavaScript代码是:$(document).ready(functio

PHP - undefined offset : 0

print_r($p->attachments)产生:Array([0]=>stdClassObject([id]=>...[url]=>http://...png[slug]=>...[title]=>...[description]=>...[caption]=>...[parent]=>...[mime_type]=>image/png[images]=>...()))我想访问url字段中的值print_r($p->attachments[0]->url)检索url,但也产生:Undefinedoffset:0现在我可以通过调用print_r(@$p->attachments[0

php - 如何在 PHP 脚本中查找 undefined variable

假设我们在PHP中有以下函数:publicfunctiontestSomething(){$name=perform_sql_query("SELECTnameFROMtableWHEREid=$entity_id;");assert($name=="some_name");}查询在语法上是正确的,但由于$entity_id未定义-查询将始终搜索“id=0”,这在语义上是不正确的。我希望这样的函数在尝试使用undefinedvariable时自动失败。PHP中有这样的机制吗?或者也许有一些工具可以用来分析PHP源代码以找到此类情况?那些undefinedvariable可以出现在项目的

php - fatal error : Call to undefined function add_action()

我有一些推特更新的代码-functiontwitit(){global$wp_query;$thePostName=$wp_query->post->post_name;echo'ID).'"title="ClicktosendthispagetoTwitter!"target="_blank">ShareonTwitter';}functionwidget_twitit($args){extract($args);echo$before_widget;echo$before_title;echo$after_title;twitit();echo$after_widget;}func

php - $_POST 不工作。 "Notice: Undefined index: username..."

这个问题在这里已经有了答案:关闭9年前。PossibleDuplicate:PHP:“Notice:Undefinedvariable”and“Notice:Undefinedindex”所以,我目前正在学习PHP,并且正在阅读一本关于密码md5函数的书,所以我决定尝试一下,看看效果如何。我还决定使用POST方法而不是GET,因为我看到有人说它更安全并且不会让变量出现在URL上。对于我的测试项目,我制作了一个非常简单的表格,如下所示:Username:Password:问题是,当我在两个字段中输入值并单击“登录”时,我在另一个PHP文件中得到以下输出。Notice:Undefinedi