preg_match [help]

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

preg_match [help]

Post by spamyboy »

Did I made any mistakes here ?

Code: Select all

$url="http://www.468x60.lt/refer.php?5556";
preg_match("/^(https?:\/\/)?([^\/]*)(.*)/i", "$url", $matches);
$domain = "http://" . $matches[2];
$page = $matches[3];
$fd = fopen($domain.$page, "rb");
$code = "";
while(!feof($fd)){
$code .= fread($fd, 4096);
}
fclose($fd);
$start= strpos($code, "5556,"); 
$finish= strpos($code, "\"><img"); 
$length= $finish-$start;
$code=substr($code, $start, $length);
Couse I get this

Code: Select all

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@warez.vhost.lt and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.36 Server at www.warez.vhost.lt Port 80
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Look in your server error log for more information
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

Code: Select all

[Wed Aug 16 14:59:34 2006] [error] [client 85.206.53.168] File does not exist: /home/spamyboy/public_html/500.shtml
[Wed Aug 16 14:59:34 2006] [error] [client 85.206.53.168] Premature end of script headers: /home/spamyboy/public_html/index.php
my script doesnt request's that file, but what does this mean:

Code: Select all

[Wed Aug 16 14:59:34 2006] [error] [client 85.206.53.168] Premature end of script headers: /home/spamyboy/public_html/index.php
Post Reply