Forum Moderators: coopster

Message Too Old, No Replies

Check if page exists.

If page exists, then it make $string a link.

         

phidentity

10:50 am on Jan 22, 2004 (gmt 0)

10+ Year Member



Hi,

How can I check to see if a page exists within pgp, and make a link to it, if so?

It's for a databases of sites i'm doing, with information on each one, and I havn't done every page yet, so I don't want dead links, yet I want visitors to see that I havn't forgotten there site.

Jon

phidentity

10:51 am on Jan 22, 2004 (gmt 0)

10+ Year Member



PHP, even.

Cheers

Jon

coopster

12:13 pm on Jan 22, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Will this work for you?

[webmasterworld.com...]

phidentity

12:16 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



Cheers, i'm using (file_exists), is this wrong/worse than his code?

Jon

coopster

12:31 pm on Jan 22, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



file_exists [php.net] checks whether a file or directory exists,
is_file [php.net] tells whether the filename is a regular file.

I've never ran a time comparison. Give it a shot -- you can tell us your results ;)

PHP code performance testing [webmasterworld.com]