小编use*_*899的帖子

undefined offset PHP错误

我在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)

错误是什么意思?

php undefined offset

42
推荐指数
3
解决办法
30万
查看次数

Jquery延迟淡出

我有这个代码,可以在悬停时更改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 delay fadeout

12
推荐指数
1
解决办法
4万
查看次数

在使用jQuery ajax方法提交表单之前,如何显示确认对话框?

我正在使用jquery ajax从表中删除客户.在提交表格之前如何显示确认框?我最好喜欢使用jQuery的对话框.

我以前见过这样的问题,但没有一个有帮助.

这是我的代码:

    $.ajax({
        type: "POST",
        url: "delete/process.php",
        data: "delcustomerid="+ delcustomerid,
        success: refreshTable
    });
Run Code Online (Sandbox Code Playgroud)

forms ajax jquery submit confirmation

6
推荐指数
1
解决办法
1万
查看次数

PHP使用未定义的常量错误

使用一个很棒的脚本从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)

php constants undefined

2
推荐指数
1
解决办法
1万
查看次数

IMDB Grabber PHP

我收到一个错误:

注意:未定义的变量:第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)

php variables curl imdb undefined

1
推荐指数
1
解决办法
3305
查看次数

如何筛选网站并获取div中的数据?

如何使用cURL屏幕抓取网站并在特定div中显示数据?

php curl screen-scraping

0
推荐指数
1
解决办法
3145
查看次数