Jump to content

ok i need to join all this pages to make 1 neat code


the-botman

Recommended Posts

ok i tought of trying a different way this seems to be getting me some were now i just get a blank page

<?php

$ShowBookmark = "False";
include 'Include/Header.php';

 if($_GET['channel'] == "sabc1"){
	  GetGuide();
} else {
              Show_Form();

}


function Show_Form() {
      echo '<a href='Tvguide.php?channel=sabc1'>Sabc 1</a>';
      echo '<a href='Tvguide.php?channel=sabc2'>Sabc 2</a>';
      echo '<a href='Tvguide.php?channel=sabc3'>Sabc 3</a>';
      echo '<a href='Tvguide.php?channel=Mnet'>Mnet</a>';
      echo '<a href='Tvguide.php?channel=ETV'>Etv</a>';

}


function GetGuide() { 
     if($_GET['channel'] == "sabc1"){ 
     $getMyDataFrom = $Table[1];
}
    if($_GET['channel'] == "sabc2"){ 
    $getMyDataFrom = $Table[2];
}
    if($_GET['channel'] == "sab3"){ 
    $getMyDataFrom = $Table[3];
}

    if($_GET['channel'] == "Mnet"){ 
    $getMyDataFrom = $Table[4];
}
    if($_GET['channel'] == "ETV"){ 
    $getMyDataFrom = $Table[5];
}
$url = "http://mysite.com";
$RawData = @file_get_contents($url) or die('Could not access file: $url');
$Table = ExData($RawData,'<div style="font-size:12px; padding-top:15px; padding-left:9px">',"</div>");
$FGuide = $getMyDataFrom;

$i=2; 
$upper = 60;

while ($i <= $upper) {
    $FGuide = str_replace($i, '<font face="Verdana" color="red" size="2">' . $i . '</font>', $FGuide);
    $i++;
}
    $FGuide = str_replace('0', '<font face="Verdana" color="red" size="2">0</font>', $FGuide);
  $FGuide = str_replace(1, '<font face="Verdana" color="red" size="2">1</font>', $FGuide);
  $FGuide = str_replace(':', '<font face="Verdana" color="green" size="2">:</font>', $FGuide);

return $FGuide;

}

function ExData($text, $openingMarker, $closingMarker) {    
  $openingMarkerLength = strlen($openingMarker);    
  $closingMarkerLength = strlen($closingMarker);     
  $result = array();    
  $position = 0;    
  while (($position = strpos($text, $openingMarker, $position)) !== false) {      
     $position += $openingMarkerLength;      
     if (($closingMarkerPosition = strpos($text, $closingMarker, $position)) !== false) {       
        $result[] = substr($text, $position, $closingMarkerPosition - $position);        
        $position = $closingMarkerPosition + $closingMarkerLength;      
     }    
  }  
  return $result;  
}
?>
<div class="hd2"><center><font color=#666666><strong><img src="Images/tvguide/sabc1.jpg"></strong></font></center></div><br>
	<? 
  // Prints the date
$thedate = date('l dS F Y');
  echo '<center><font face="Verdana" size="2" color="blue"><u>' .$thedate. '</center></u></font>';
?>
<br><font face="Verdana" size="2"><?php echo GetGuide(); ?></font><br>
<center><font face="Verdana" size="2"><?php echo $GLOBALS["Advert03"]; ?></font></center>
<table id="" border="0" style="font-size:9pt;width:100%;">
	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>
		<font face="Verdana" size="2"><b><a href="TvGuide.php">Back</b></font></a><br>
	</td></tr>
</table>
<hr>

<?php include 'Include/Footer.php'; Log_Hit("TvGuide"); ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.