Welcome Guest, Not a member yet? Register   Sign In
file exist check failing
#10

[eluser]bhakti.thakkar[/eluser]
hi,

[quote author="TheFuzzy0ne" date="1235413877"]Is there any reason you can't use my latest creation: http://ellislab.com/forums/viewthread/106556/? If the remote server says the file can't be found, then the function returns FALSE and you can do whatever you need to do.[/quote]

as suggested i tried using :
Code:
function is_working_ur($url)
{
    if (substr($url, 0, 7) != 'http://' && substr($url, 0, 8) != 'https://')
    {
        $url = 'http://'.$url;
    }

    $header_arr = @get_headers($url);

    if (is_array($header_arr) && preg_grep('/HTTP\/\d+\.\d+ 200 OK/', $header_arr))
    {
        return TRUE;
    }
    
    return FALSE;
    
}

but it doesnt help as its anyways returning true for all the cases. i have done all required validations for clean urls

hope i get some help

ALSO TO BE NOTED THAT THE FILES ARE RESIDING ON THE SAME SERVER AS OF THE APPLICATION. I AM SORRY I DID A MISTAKE OF SPECIFYING THAT THE FILES ARE ON REMOTE SERVER.

Thanks


Messages In This Thread
file exist check failing - by El Forum - 02-23-2009, 04:13 AM
file exist check failing - by El Forum - 02-23-2009, 05:06 AM
file exist check failing - by El Forum - 02-23-2009, 05:16 AM
file exist check failing - by El Forum - 02-23-2009, 05:25 AM
file exist check failing - by El Forum - 02-23-2009, 05:28 AM
file exist check failing - by El Forum - 02-23-2009, 06:11 AM
file exist check failing - by El Forum - 02-23-2009, 06:17 AM
file exist check failing - by El Forum - 02-23-2009, 06:31 AM
file exist check failing - by El Forum - 02-23-2009, 07:00 AM
file exist check failing - by El Forum - 02-23-2009, 10:20 PM
file exist check failing - by El Forum - 02-23-2009, 10:35 PM
file exist check failing - by El Forum - 02-23-2009, 11:20 PM
file exist check failing - by El Forum - 02-24-2009, 05:36 AM
file exist check failing - by El Forum - 02-24-2009, 06:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB