Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
great script

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> PHP
View previous topic :: View next topic  
Author Message
deejay
Forum Assistant
Forum Assistant


Joined: 17 May 2006
Posts: 78
Location: Netherlands

PostPosted: Thu Jul 06, 2006 3:11 pm    Post subject: great script Reply with quote

this neat little script checks to see if an url is ok, or if it gives an error message, i use this a lot. it rocks.

Code:
function is_url($value) {
    $fp = @fopen($value,"r");
    if ($fp) {
        fclose($fp);
        return true;
    } else {
        return false;
    }
}

if (is_url('http://www.ajaxtalk.com/images/ajaxtalk.gif')) {
print 'this url is valid';
} else {
print 'this url is buggy';
}


_________________
please correct me if i am wrong
seo-expertglobalwarming
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
rberbe2002
Fairly Frequent Poster
Fairly Frequent Poster


Joined: 06 Jul 2006
Posts: 10

PostPosted: Fri Jul 07, 2006 11:39 am    Post subject: good script Reply with quote

cool script mate...

i shall be using this one alot

thanks
Back to top
View user's profile Send private message
Snyke
Forum Assistant
Forum Assistant


Joined: 20 Jun 2006
Posts: 87
Location: Zurich

PostPosted: Fri Jul 07, 2006 2:04 pm    Post subject: Reply with quote

Sorry, but that's going to be soooooooooo slow...
It opens the file on the remote host for reading and if the host takes some time to respond it will slow you down incredibly. I'd prefer some sort of parsing which is faster.
_________________
[::[ Snyke.net ]::]
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
deejay
Forum Assistant
Forum Assistant


Joined: 17 May 2006
Posts: 78
Location: Netherlands

PostPosted: Mon Jul 10, 2006 8:50 am    Post subject: I am interested Reply with quote

Hi Snyke,

You are right, i had some problems before with this script. However i still use it because i don't have anything better yet.

Please post your script, i am interested a lot.

D.J. Cool
_________________
please correct me if i am wrong
seo-expertglobalwarming
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Snyke
Forum Assistant
Forum Assistant


Joined: 20 Jun 2006
Posts: 87
Location: Zurich

PostPosted: Mon Jul 10, 2006 4:36 pm    Post subject: Reply with quote

From the PHP-Reference ( http://ch2.php.net/preg_match )
Code:
<?php
// get host name from URL
preg_match('@^(?:http://)?([^/]+)@i',
   "http://www.php.net/index.html", $matches);
$host = $matches[1];

// get last two segments of host name
preg_match('/[^.]+\.[^.]+$/', $host, $matches);
echo "domain name is: {$matches[0]}\n";
?>

_________________
[::[ Snyke.net ]::]
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
deejay
Forum Assistant
Forum Assistant


Joined: 17 May 2006
Posts: 78
Location: Netherlands

PostPosted: Thu Jul 13, 2006 8:12 am    Post subject: hi Snyke Reply with quote

Eja Snyke,

this script is not the same in functionality,

my script actually verifies if this site is up or down, i use this sometimes to include a remote object (like for example an image), but before i include it i have to know if it is online, otherwise it might generate design errors.

the script you provided, just gives me the domain name with extension.

regds, dj
_________________
please correct me if i am wrong
seo-expertglobalwarming
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> PHP All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert