grlayouts Posted November 1, 2007 Share Posted November 1, 2007 when i put in the following code to only allow access to a page on certain days is messes up my html code. (no iddea why). anyone know another way to achieve what i'm doing? <?php // get the day $d=date("D"); // if today is Thu or Friday add 4 days to today if ($d=="Thu" || $d=="Fri") { echo "Market Closed"; exit; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/ Share on other sites More sharing options...
MadTechie Posted November 1, 2007 Share Posted November 1, 2007 i assume its at the top of the page! Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382655 Share on other sites More sharing options...
grlayouts Posted November 1, 2007 Author Share Posted November 1, 2007 yes. it works fine but messes up the layout completly.. Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382657 Share on other sites More sharing options...
adam291086 Posted November 1, 2007 Share Posted November 1, 2007 What do you mean by, messes up your code??? Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382658 Share on other sites More sharing options...
grlayouts Posted November 1, 2007 Author Share Posted November 1, 2007 ?? exactly as stated the site sits fine and in line with images and text. now ive added this it doesn't Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382666 Share on other sites More sharing options...
MadTechie Posted November 1, 2007 Share Posted November 1, 2007 post how you added it in Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382670 Share on other sites More sharing options...
grlayouts Posted November 1, 2007 Author Share Posted November 1, 2007 some souronding code </strong><br> <strong>Next Payout</strong>: <?php if ($countup > 0) { $mins = floor ($countup / 60); $secs = $countup % 60; printf (" %dmin : %2.0fsecs", $mins, $secs); } ?> <br> <?php // get the day $d=date("D"); // if today is Thu or Friday add 4 days to today if ($d=="Thu" || $d=="Fri") { echo "Market Closed"; exit; } ?> <span class="style14"> </span> </small></div></td> <td rowspan="3"> <img src="hoboimages/stats_25.jpg" width="9" height="59" alt=""></td> <td> <img src="hoboimages/spacer.gif" width="1" height="48" alt=""></td> </tr> <tr> <td colspan="3" rowspan="3"> <img src="hoboimages/stats_26.jpg" width="123" height="17" alt=""></td> <td> <img src="hoboimages/spacer.gif" width="1" height="7" alt=""></td> </tr> <tr> <td colspan="6"> <img src="hoboimages/stats_27.jpg" width="340" height="4" alt=""></td> <td> <img src="hoboimages/spacer.gif" width="1" height="4" alt=""></td> </tr> <tr> <td colspan="4"> <img src="hoboimages/stats_28.jpg" width="82" height="6" alt=""></td> <td colspan="9" rowspan="5" background="hoboimages/stats_29.jpg"><div align="center"> <div align="center"> <span class="style9"> Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382673 Share on other sites More sharing options...
MadTechie Posted November 1, 2007 Share Posted November 1, 2007 i assume its at the top of the page! SO that was infact thats a NO its not at the top!! thats the problem Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382674 Share on other sites More sharing options...
grlayouts Posted November 1, 2007 Author Share Posted November 1, 2007 its still in the head of the page at the top. why would it make a difference.. how else could i do it? Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382677 Share on other sites More sharing options...
MadTechie Posted November 1, 2007 Share Posted November 1, 2007 the exit is terminating the page before its finished loading.. try something like <?php // if today is Thu or Friday add 4 days to today if ($d=="Thu" || $d=="Fri") { echo "Market Closed"; }else{?> HTML CODE <span class="style14"> </span> </small></div></td> etc etc etc <?php } //everyone forgets this one?> BUT it really depends what your trying to do when i put in the following code to only allow access to a page on certain days this is not what your trying to do.. if it really is then just move // get the day $d=date("D"); // if today is Thu or Friday add 4 days to today if ($d=="Thu" || $d=="Fri") { echo "Market Closed"; exit; } to the VERY start of the page Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382678 Share on other sites More sharing options...
grlayouts Posted November 1, 2007 Author Share Posted November 1, 2007 cant have it at start of page as then the whole page wont display. I need a code that will only allow access to that page 3 days a week. Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382687 Share on other sites More sharing options...
MadTechie Posted November 1, 2007 Share Posted November 1, 2007 see example code .. add the html you wish to hide in the else block the exit is terminating the page before its finished loading.. try something like <?php // if today is Thu or Friday add 4 days to today if ($d=="Thu" || $d=="Fri") { echo "Market Closed"; }else{?> HTML CODE <span class="style14"> </span> </small></div></td> etc etc etc <?php } //everyone forgets this one?> Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382703 Share on other sites More sharing options...
grlayouts Posted November 1, 2007 Author Share Posted November 1, 2007 doesnt work. Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382752 Share on other sites More sharing options...
MadTechie Posted November 1, 2007 Share Posted November 1, 2007 you did it wrong then.. post what you have Quote Link to comment https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382791 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.