Computing.Net > Forums > Web Development > verify domain/url

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

verify domain/url

Reply to Message Icon

Name: smbotans
Date: May 30, 2006 at 20:23:31 Pacific
OS: Windows 98se
CPU/Ram: AMD XP 2000 and 512 Megs
Comment:

hi,

i have put together an seo tool online but can't get around how to verify that a url entered into the text box is valid

i tried 'file-exists' and it worked at one stage but not now

i tried:

$handle = fopen...
if (!handle) ...

it works on what page but not on another

is there a way for me to check that a url points to an actual site/web page?

thanks in advance

serge
SEO Resource

FREE Keyword Report from Meta Keywords Advice



Sponsored Link
Ads by Google

Response Number 1
Name: Laler
Date: May 31, 2006 at 05:33:28 Pacific
Reply:

hi,

what do you mean by "it works on what page but not on another"?

Because I actually use that method to test for URLs on a shoutbox

if (@fopen ($_POST['url'], "r")){
// record the url
}

and I haven't found any problems (yet).


---
Site of the Day


0

Response Number 2
Name: smbotans
Date: May 31, 2006 at 20:15:01 Pacific
Reply:

my mistake, i have so many going on in my head at the moment ... ggrr!!

i use ERROR_REPORTING(0) on 2 pages with:

$handle = fopen...
if (!handle) ...

to test for valid urls

on the one page, the errors are not reported and the script reports an error when a non-valid url is entered as it should

on the other page, php reports that it cannot open a stream to the invalid url

i was wondering if:
$handle = fopen...
if (!handle) ...

is the correct way to check for a valid url, if it is then i can troubleshoot why one page works while the other doesn't

thanks for your time and reply :-))

serge

SEO Resources

Meta Keywords Advice


0

Response Number 3
Name: Laler
Date: June 1, 2006 at 07:38:55 Pacific
Reply:

ic :D

I'm also not sure whether it is the correct way or not, but my shoutbox is running for quite a long time and no problems comes up yet.

It'll return true if the URL exist (not 404) even if the URL is a redirect. To test for redirects, you can combine with $http_response_header or get_meta_data().

---
Site of the Day


0

Response Number 4
Name: smbotans
Date: June 1, 2006 at 20:06:06 Pacific
Reply:

thanks for that

if i am using the correct function to check for a url, i will check the code to see why it works on the one page and not on the other

serge

SEO Resources

Meta Keywords Advice


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: verify domain/url

QuickPHP web server www.computing.net/answers/webdevel/quickphp-web-server/3960.html

domain name www.computing.net/answers/webdevel/domain-name/3418.html

cant access webpage outside lan ..? www.computing.net/answers/webdevel/cant-access-webpage-outside-lan-/3045.html