Hi liebe PP-ler,
1.
ich benutze folgendes Script und es funktioniert auch. Nur bei einer bestimmten URL macht es einfach nichts. Keine Fehlermeldung, einfach gar nichts. Woran kann sowas liegen?
PHP-Code:
<?php
$source = "http://www.b.shuttle.de/b/humboldt-os/hst/vertretungen/plan/planx.html";
$start = "<CENTER>"; //This just tells the script where to begin to get the data in the page.
$end = "</CENTER>"; //This just tells the script where to end recording the data.
//Content Retrieval
$data = fopen("$source", "r");
$get = fread($data, 20000000);
$take = eregi("$start(.*)$end", $get, $content);
$info = str_replace("--", " - ", $content);
echo $info[1];
?>
2.
ärgerlicherweise bekomme ich immer die Fehlermeldung:
Fatal error: "Maximum execution time of 30 seconds exceeded in /home/www/xxxx/html/xxxx/xxxx/index.php on line 21" bei einem Script, dass zufällige Bilder ausgeben soll
Hier der anscheinend betroffene Ausschnitt der Datei:
PHP-Code:
<?
include("config.php");
include("db_connect.php");
if($vote){
mysql_select_db($db_table,$db);
$result = mysql_query("SELECT points, votes FROM $db_table WHERE id = '$id'");
list($points,$votes) = mysql_fetch_row($result);
$points = $points + $vote;
$votes++;
mysql_query("UPDATE $db_table SET points = '$points', votes = '$votes' WHERE id = '$id'");
}
if(!$showpic){
mysql_select_db($db_table,$db);
$result = mysql_query("SELECT * FROM $db_table");
$max_num = mysql_num_rows($result);
while(true){
srand((double)microtime()*1000000);
$rand_num = rand(1,$max_num);
$img_src = "$img_folder$rand_num$img_format_info";
if(file_exists($img_src))
break;
}
}
else{
$rand_num = $showpic;
$img_src = "$img_folder$rand_num$img_format_info";
}
$get_result = mysql_query("SELECT * FROM $db_table WHERE id = '$rand_num'");
list($id,$creator,$comment,$points,$votes) = mysql_fetch_row($get_result);
$current_points = $points / $votes;
$current_points = number_format($current_points,2,",","");
include("db_close.php");
echo $header;
echo "
schlecht
";
for($i=1;$i<=$max_points;$i++)
echo " [url='index.php?id=$id&vote=$i']$i[/url]\n";
echo "
gut
</td>
</tr>
<tr>
<td colspan='2' align='center'>[img]$img_src[/img]</td>
</tr>
<tr>
<td valign='top'>
Bild von [b]$creator[/b]
$comment
</td>
<td valign='top' align='right'>
Punkte: [b]$current_points[/b] ($votes Votes)
";
echo $footer;
?>
Line 21 ist diese hier:
PHP-Code:
:
srand((double)microtime()*1000000);
Manchmal bekomme ich auch Line 25 als Fehlerquelle:
PHP-Code:
if(file_exists($img_src))
Ich seid meine letzte Hoffnung, vielleicht weiß ja jemand etwas
Achja: Ich habe (fast) gar keine Ahnung von php
