Ziddia Posted May 22, 2011 Share Posted May 22, 2011 Hi, I am modding phpBB3 and I want to make the contents of a text documents appear in a border. This is what I have in my portal_style.html: <!-- INCLUDE overall_header.html --> <?php $a1=fopen("/port/announce/announce1.txt", "r"); $a2=fopen("/port/announce/announce2.txt", "r"); $a3=fopen("/port/announce/announce3.txt", "r"); $a4=fopen("/port/announce/announce4.txt", "r"); $a5=fopen("/port/announce/announce5.txt", "r"); ?> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a1; ?> </div> <span class="corners-bottom"><span></span></span></div></div> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a2; ?> </div> <span class="corners-bottom"><span></span></span></div> </div> <!-- INCLUDE jumpbox.html --> <!-- INCLUDE overall_footer.html --> Anyone mind showing me how to make it work? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/237154-fopen-problem/ Share on other sites More sharing options...
mgoodman Posted May 22, 2011 Share Posted May 22, 2011 Use file_get_contents instead of fopen. Quote Link to comment https://forums.phpfreaks.com/topic/237154-fopen-problem/#findComment-1218842 Share on other sites More sharing options...
fugix Posted May 22, 2011 Share Posted May 22, 2011 file_get_contents() should be what you are looking for Quote Link to comment https://forums.phpfreaks.com/topic/237154-fopen-problem/#findComment-1218843 Share on other sites More sharing options...
Ziddia Posted May 22, 2011 Author Share Posted May 22, 2011 Thanks- I have another problem. And I don't know what's causing it. Even though I have updated my document, the webpage stays exactly the same. Is this just a slow connection or what? Here's the updated code: <!-- INCLUDE overall_header.html --> <?php $a1=file_get_contents("/port/announce/announce1.txt", "r"); $a2=file_get_contents("/port/announce/announce2.txt", "r"); $a3=file_get_contents("/port/announce/announce3.txt", "r"); $a4=file_get_contents("/port/announce/announce4.txt", "r"); $a5=file_get_contents("/port/announce/announce5.txt", "r"); ?> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a1; ?> </div> <span class="corners-bottom"><span></span></span></div></div> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a2; ?> </div> <span class="corners-bottom"><span></span></span></div> </div> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a2; ?> </div> <span class="corners-bottom"><span></span></span></div></div> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a3; ?> </div> <span class="corners-bottom"><span></span></span></div></div> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a4; ?> </div> <span class="corners-bottom"><span></span></span></div></div> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a5; ?> </div> <span class="corners-bottom"><span></span></span></div></div> <!-- INCLUDE jumpbox.html --> <!-- INCLUDE overall_footer.html --> And here's the webpage: http://newportal.zidmc.x10.bz/nportal.php Mind looking and telling me why this would happen? Quote Link to comment https://forums.phpfreaks.com/topic/237154-fopen-problem/#findComment-1218846 Share on other sites More sharing options...
mgoodman Posted May 22, 2011 Share Posted May 22, 2011 Did you even look at the manual page that we both linked? You don't need 'r'. Quote Link to comment https://forums.phpfreaks.com/topic/237154-fopen-problem/#findComment-1218847 Share on other sites More sharing options...
Ziddia Posted May 22, 2011 Author Share Posted May 22, 2011 Urk... Sorry im obviously not thinking straight right now. I fixed it but the page refuses to update itself. Quote Link to comment https://forums.phpfreaks.com/topic/237154-fopen-problem/#findComment-1218848 Share on other sites More sharing options...
Ziddia Posted May 22, 2011 Author Share Posted May 22, 2011 Despite a lot of work to get it good, the page will not update. Anyone know why? The page can be found at http://newportal.zidmc.x10.bz/nportal.php Quote Link to comment https://forums.phpfreaks.com/topic/237154-fopen-problem/#findComment-1218869 Share on other sites More sharing options...
Ziddia Posted May 23, 2011 Author Share Posted May 23, 2011 Solved Quote Link to comment https://forums.phpfreaks.com/topic/237154-fopen-problem/#findComment-1218886 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.