Jump to content

messed up.


grlayouts

Recommended Posts

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;
}

?>

Link to comment
https://forums.phpfreaks.com/topic/75625-messed-up/
Share on other sites

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">

Link to comment
https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382673
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382678
Share on other sites

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?>

 

Link to comment
https://forums.phpfreaks.com/topic/75625-messed-up/#findComment-382703
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.