我在PHP中收到以下错误
注意未定义的偏移1:在C:\ wamp\www\includes\imdbgrabber.php第36行
以下是导致它的PHP代码:
<?php
# ...
function get_match($regex, $content)
{
preg_match($regex,$content,$matches);
return $matches[1]; // ERROR HAPPENS HERE
}
Run Code Online (Sandbox Code Playgroud)
错误是什么意思?
我有这个代码,可以在悬停时更改div的不透明度.
$("#navigationcontainer").fadeTo("slow",0.6);
$("#navigationcontainer").hover(function(){ $("#navigationcontainer").fadeTo("slow",
1.0); // This sets the opacity to 100% on hover },function(){
$("#navigationcontainer").fadeTo("slow",
0.6); // This sets the opacity back to 60% on mouseout });
Run Code Online (Sandbox Code Playgroud)
我希望在将div设置为0.6不透明度之前有一个延迟,我将如何做到这一点
我正在使用jquery ajax从表中删除客户.在提交表格之前如何显示确认框?我最好喜欢使用jQuery的对话框.
我以前见过这样的问题,但没有一个有帮助.
这是我的代码:
$.ajax({
type: "POST",
url: "delete/process.php",
data: "delcustomerid="+ delcustomerid,
success: refreshTable
});
Run Code Online (Sandbox Code Playgroud) 使用一个很棒的脚本从imdb获取详细信息,我要感谢Fabian Beiner.
我遇到的一个错误是:
在第49行的'/ path/to/directory'中使用未定义的常量sys_get_temp_dir假定'sys_get_temp_dir'
这是完整的脚本
<?php
/**
* IMDB PHP Parser
*
* This class can be used to retrieve data from IMDB.com with PHP. This script will fail once in
* a while, when IMDB changes *anything* on their HTML. Guys, it's time to provide an API!
*
* @link http://fabian-beiner.de
* @copyright 2010 Fabian Beiner
* @author Fabian Beiner (mail [AT] fabian-beiner [DOT] de)
* @license MIT License
*
* @version 4.1 (February 1st, 2010)
*
*/ …Run Code Online (Sandbox Code Playgroud) 我收到一个错误:
注意:未定义的变量:第17行的C:\ wamp\www\includes\imdbgrabber.php中的内容
使用此代码时:
<?php
//url
$url = 'http://www.imdb.com/title/tt0367882/';
//get the page content
$imdb_content = get_data($url);
//parse for product name
$name = get_match('/<title>(.*)<\/title>/isU',$imdb_content);
$director = strip_tags(get_match('/<h5[^>]*>Director:<\/h5>(.*)<\/div>/isU',$imdb_content));
$plot = get_match('/<h5[^>]*>Plot:<\/h5>(.*)<\/div>/isU',$imdb_content);
$release_date = get_match('/<h5[^>]*>Release Date:<\/h5>(.*)<\/div>/isU',$imdb_content);
$mpaa = get_match('/<a href="\/mpaa">MPAA<\/a>:<\/h5>(.*)<\/div>/isU',$imdb_content);
$run_time = get_match('/Runtime:<\/h5>(.*)<\/div>/isU',$imdb_content);
//build content
line 17 --> $content.= '<h2>Film</h2><p>'.$name.'</p>';
$content.= '<h2>Director</h2><p>'.$director.'</p>';
$content.= '<h2>Plot</h2><p>'.substr($plot,0,strpos($plot,'<a')).'</p>';
$content.= '<h2>Release Date</h2><p>'.substr($release_date,0,strpos($release_date,'<a')).'</p>';
$content.= '<h2>MPAA</h2><p>'.$mpaa.'</p>';
$content.= '<h2>Run Time</h2><p>'.$run_time.'</p>';
$content.= '<h2>Full Details</h2><p><a href="'.$url.'" rel="nofollow">'.$url.'</a></p>';
echo $content;
//gets the match content
function get_match($regex,$content)
{
preg_match($regex,$content,$matches);
return $matches[1];
}
//gets the data …Run Code Online (Sandbox Code Playgroud)