Gene Gene PimentelTop Member VIP Large Portfolio ★ 20 ★ Impact 485 May 31, 2009 903 views 2 replies #1 Here's what I need to do... I just need someone to translate it into PHP: If file 12345.txt exists, <?php include 'aaaaa.html'; ?> If file 12345.txt does not exist, <?php include 'bbbbb.html'; ?> What is the correct PHP syntax for this? Thanks!
Here's what I need to do... I just need someone to translate it into PHP: If file 12345.txt exists, <?php include 'aaaaa.html'; ?> If file 12345.txt does not exist, <?php include 'bbbbb.html'; ?> What is the correct PHP syntax for this? Thanks!
S samuelhr Account Closed Impact 21 May 31, 2009 #2 Code: <?php $filename = '/path/to/foo.txt'; if (file_exists($filename)) { include("aaaaa.html") } else { include("bbbb.html"); } ?>
Code: <?php $filename = '/path/to/foo.txt'; if (file_exists($filename)) { include("aaaaa.html") } else { include("bbbb.html"); } ?>
Gene Gene PimentelTop Member VIP Large Portfolio ★ 20 ★ Impact 485 May 31, 2009 #3 That was quick! Thanks Samuel! Rep added