Check if a folder/directory exists then display html1, if not display html2 (PHP
-
I am trying to add custom html to a 404 page in wordpress.
<?php $filename = "/find"; if (!file_exists($filename)) echo $filename, " display html2 "; elseif (!is_dir($filename)) echo $filename, " display html1 "; ?>
If someone visits https://www.demosite.com/about/whatever = Display HTML 1
If someone visits https://www.demosite.com/find/whatever = Display HTML 2
Is this even possible with PHP and HTML?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Check if a folder/directory exists then display html1, if not display html2 (PHP’ is closed to new replies.