|
-
Apr 8th, 2002, 07:22 AM
#1
Thread Starter
Hyperactive Member
identifying broken links...
Hi,
Im looking at going thro' a site and identifying broken links. Any ideas on how this can be done?? Thanx a lot in advance
-
Apr 8th, 2002, 08:04 AM
#2
yeah get a program called "Xenu" a link verifier
-
Apr 8th, 2002, 08:21 AM
#3
-
Apr 8th, 2002, 11:33 PM
#4
Thread Starter
Hyperactive Member
thanx scoutt and ricmitch_uk...will check them out......
-
Apr 9th, 2002, 01:16 AM
#5
Thread Starter
Hyperactive Member
will these tools work from PHP pages? or will I have to use php functions to do my work for me?
(the function fopen can be used to check if a URL is valid, right?)
thanx again.
-
Apr 9th, 2002, 07:31 AM
#6
yeah but how are you going to tell if the site is up or not? I don't think you can do what you want with php. that is why I suggested that program. using fopen will not tell you if it is alive or dead or even the if the site is valid.
-
Apr 9th, 2002, 05:03 PM
#7
Fanatic Member
is there a way to do this for Email ?? (validate email) ?
-
Apr 9th, 2002, 05:29 PM
#8
all you can do is validate the syntax of the email. same goes with it. you can't send a message and get a response back.you would never know.
-
Apr 9th, 2002, 05:35 PM
#9
Fanatic Member
how can i validate the syntax then ? (thats what i meant before )
-
Apr 9th, 2002, 05:40 PM
#10
sure validate it like this. sorry I thought you meant the other way.
PHP Code:
$email = "[email protected]"
if (!preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $email)) {
echo("<br><b>Your email doesn't seem to be valid. </b>");
exit;
}
-
Apr 9th, 2002, 05:54 PM
#11
PowerPoster
Here's a little function I wrote to verify as much as possible that an email address is valid. It checks syntax then it checks to make sure the domain of the address actually accepts email.
It's as close as you can get without actually sending mail and asking the user to send it back
PHP Code:
function valid_email($address) {
// check address is of valid format and that there is a mail server that will accept it
if (ereg("^[a-zA-Z0-9_\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $address)) {
// valid format, check mail server
$email_parts = explode("@", $address);
$email_host = $email_parts[1];
if (@getmxrr($email_host, $mxhostsarr)) {
// valid host
return true;
} else {
// Domain doesn't exist or no mail server.
return false;
}
} else {
// not valid, no point checking mail server
return false;
}
}
-
Apr 9th, 2002, 06:30 PM
#12
Fanatic Member
hmmm, thanx ppl i needed that for my signup page.
-
Apr 9th, 2002, 11:07 PM
#13
Originally posted by chrisjk
Here's a little function I wrote to verify as much as possible that an email address is valid. It checks syntax then it checks to make sure the domain of the address actually accepts email.
It's as close as you can get without actually sending mail and asking the user to send it back
PHP Code:
function valid_email($address) {
// check address is of valid format and that there is a mail server that will accept it
if (ereg("^[a-zA-Z0-9_\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $address)) {
// valid format, check mail server
$email_parts = explode("@", $address);
$email_host = $email_parts[1];
if (@getmxrr($email_host, $mxhostsarr)) {
// valid host
return true;
} else {
// Domain doesn't exist or no mail server.
return false;
}
} else {
// not valid, no point checking mail server
return false;
}
}
Chris, functions like that will go real good at my site. if you could add some of your famous recipes I would appreciate it.
-
Apr 9th, 2002, 11:49 PM
#14
Fanatic Member
lol, if i could just get a dollar for every time Scoutt asks someone to add stuff ....
-
Apr 10th, 2002, 07:31 AM
#15
me too. but how else am I going to get people to add stuff. I don't want to spam these wonderful forums.... I know, subliminal messages yeah that's it....
<Subliminal message>
add code on scoutts site, add code on scoutts site, add code on scoutts site, add code on scoutts site, add code on scoutts site, add code on scoutts site, add code on scoutts site, add code on scouts site
</Subliminal message>
-
Apr 10th, 2002, 08:29 AM
#16
PowerPoster
sure, i'll add a few when I get an opportunity
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|