Is there a way to check to see if a link goes to a valid page?
I have code that I only want displayed if the link that is surrounding it is valid.
I am in Wordpress, if that matters. And I thought is_wp_error() might be the way to go, but it's not working.
Hope I'm explaining this well enough. Here's my code:
$practice_rep_link = "$practice_link-rep/"; if (!is_wp_error($practice_rep_link)) { echo '<h3><a href="'.$practice_rep_link.'">
Representative Cases'.''; }
http://stackoverflow.com/questions/2280394/check-if-an-url-exists-in-php
Yeah, I'd tried that previously. It doesn't seem to work for me. It tells me a page exists when it definitely doesn't. Could it be because I have a custom 404 page?
@slb535 Possibly.
Is there a way to check to see if a link goes to a valid page?
I have code that I only want displayed if the link that is surrounding it is valid.
I am in Wordpress, if that matters. And I thought is_wp_error() might be the way to go, but it's not working.
Hope I'm explaining this well enough. Here's my code:
Representative Cases'.''; }
http://stackoverflow.com/questions/2280394/check-if-an-url-exists-in-php
Yeah, I'd tried that previously. It doesn't seem to work for me. It tells me a page exists when it definitely doesn't. Could it be because I have a custom 404 page?
@slb535 Possibly.