伙计们。请帮我找出问题所在。我有一个剧本我ftvgirlsbay.com网站:卡住file_get_contents
<?php
define('C', 16); // NUMBER OF ROWS
define('D', 6); // NUMBER OF CELLS
$file = @file_get_contents('http://ftvgirlsbay.com/design/tables/gals.txt');
if($file === FALSE) {
echo "<h2>Make file gals.txt with data!</h2>";
return FALSE;
}
$file = explode("\r\n", $file);
$thumbs = array();
while(list(,$el) = each($file)) {
$el = explode('|', $el);
if(isset($el[0]) && isset($el[1]))
$thumbs[] = array($el[0], $el[1]);
}
//print_r($thumbs);
$size = sizeof($thumbs);
if($size < C*D) {
echo "<h2>More data needed. You have $size, you need ".C*D."!</h2>";
return FALSE;
}
$range = range(0, $size - 1);
shuffle($range);
//print_r($range);
?>
<table align=center>
<?php
$num = 0;
for($i = 0; $i < C; $i++) {
echo '<tr align=center>'."\r\n";
for($k = 0; $k < D; $k++) {
echo '<td><a href="'.$thumbs[$range[$num]][1].'">FTV '.$thumbs[$range[$num]][0].' Gallery</a> </td>'."\r\n";
$num++;
}
echo '</tr>'."\r\n";
}
?>
</table>
这个脚本的结果:“!更多的数据需要你有1个,则需要96” (http://ftvgirlsbay.com/random_scripts/test.php)
如果这部分
$file = @file_get_contents('http://ftvgirlsbay.com/design/tables/gals.txt');
变化
$file = @file_get_contents('http://sexsticker.info/ftvgirlsbay.com/pictable/gals.txt');
它工作得很好
(http://ftvgirlsbay.com/random_scripts/test2.php)
所以,如果我链接到.TXT我的服务器端脚本文件只读取1行。 如果我链接到远程服务器上的.txt - 脚本在所有行中均可用
你自己做了什么基本的调试吗?你有没有检查'$ file','$ el'等......是否包含你认为它们包含的内容? –