Page 1 of 1

help needed

Posted: Sat Oct 08, 2005 1:10 pm
by SidewinderX
A friend of mine built me a little script, i cant seem to get it to work (it only displays a white screen)

here is the script source

Code: Select all

<?php
function <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>() {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'http://nw4.novaworld.net/NWBanned.dll');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies');
        $result = curl_exec($ch);
        curl_close($ch);
        return $result;
}
function getbannedcookie() {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'http://nw4.novaworld.net/NWBanned.dll?success=bhd_6_banned.htm&failure=bhd_6_main.htm&relay=bhd_6_relay.htm&msgbase=bhd_6_msg.htm&nodb=bhd_6_nodb.htm&pfid=26');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies');
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        $result = curl_exec($ch);
        curl_close($ch);
}
function parseit($file) {
        $file = explode("\n", $file);
        foreach ($file as $line) {
                if (preg_match('/<TR><TD>(.*)<\/TD><TD>(.*)<\/TD><\/TR>/', $line)) {
                        $line = preg_replace('/<TR><TD>(.*)<\/TD><TD>(.*)<\/TD><\/TR>/', 'User: \\1  Banned on:\\2', $line);
                        echo $line."\n";
                }
        }
}
getbannedcookie();
parseit(<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>());
?>

here is the actual script hosting on my server(just a white screen)
http://www.extreme-hq.com/stats/BANNED/index.php

here is my phpinfo (curl is enabled)
http://www.extreme-hq.com/stats/BANNED/phpinfo.php

it should display a bunch of names and dates but it dosnt, it works for my friend and he dosnt know why it dosnt work for me so does anyone have any idea?

Posted: Sat Oct 08, 2005 1:36 pm
by feyd
might be that curl cannot create the cookie jar files.. ?

Posted: Sat Oct 08, 2005 4:12 pm
by SidewinderX
how could i fix the script so it would work?

Posted: Sat Oct 08, 2005 4:20 pm
by feyd
can you confirm that the cookie files aren't being created? It'd likely be a permissions "issue" with the folder you are running it in...

Posted: Sat Oct 08, 2005 6:02 pm
by SidewinderX
ah yes, the folder wasnt allowing the creation of cookies because the permissions werent allowing it to write.

thanks