Jump to content

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


the-botman

Recommended Posts

i have 5 pages that make up my tv guide it works 100% but i want to make it 1 page if i can or 2, i want it to have diff pages for each guide but all the code on 1 page i just dont know how to do it,  i will post page each page here

 

main page

<?php $ShowBookmark = "False"; include 'Include/Header.php'; ?>
<div class="hd2"><font color=#666666><strong><center>Tv Guide</center></strong></font></div>
<? 
  // Prints something like: 10th 2009f November 2009
$thedate = date('l dS F Y');
  echo '<br><center><font face="Verdana" size="2" color="blue"><u>' .$thedate. '</center></u></font>';
?>

<table id="" border="0" style="font-size:9pt;width:100%;">
	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/tvguide/sabc1-icon.gif"></td><td>
		<font face="Verdana" size="2"><b><a href="TvGuide-sabc1.php">Sabc 1</b></font></a><br>
	</td></tr>
	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/tvguide/sabc2-icon.gif"></td><td>
		<font face="Verdana" size="2"><b><a href="TvGuide-sabc2.php">Sabc 2</b></font></a><br>

</td></tr>
	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/tvguide/sabc3-icon.gif"></td><td>
		<font face="Verdana" size="2"><b><a href="TvGuide-sabc3.php">Sabc 3</b></font></a><br>

</td></tr>
	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/tvguide/etv-icon.jpg"></td><td>
		<font face="Verdana" size="2"><b><a href="TvGuide-etv.php">Etv</b></font></a><br>		
	</td></tr>
<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/tvguide/mnet-icon.jpg"></td><td>
		<font face="Verdana" size="2"><b><a href="TvGuide-Mnet.php">Mnet</b></font></a><br>		
	</td></tr>


</table>
<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="index.php?cmd=100">Back</b></font></a><br>
	</td></tr>
</table>
<hr>
<?php include 'Include/Footer.php'; Log_Hit("TvGuide"); ?>

 

this is sabc 1

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

function GetGuide() {
$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 = $Table[2];

$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-sabc1"); ?>

 

this is sabc 2

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

function GetGuide() {
$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 = $Table[3];
$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/sabc2.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-sabc2"); ?>

this is sabc 3

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

function GetGuide() {
$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 = $Table[4];
$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/sabc3.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-sabc3"); ?>

 

this is etv

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

function GetGuide() {
$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 = $Table[5];

$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/etv.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-etv"); ?>

and this is mnet

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

function GetGuide() {
$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 = $Table[1];
$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/mnet.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("Fortune_Cookie"); ?>

 

now i want to make all this pages 1 or 2 coz as it stands i feel my code is not neat thanks in advance

Zainul

 

 

 

Link to comment
Share on other sites

And what exactly do you want us to do?

 

ok see i pull this info from the same site but the only way i can make this work is to have 1 main page and 5 different pages for the guide, i want to have 1 page with a neat code and say the user clicks Sabc 1 it must display the sabc 1 tv guide only, each guide reads from a different table so i dont see need to pull the info 5 times over i feel it can pull it 1 time and check what guide they wana view and display it , i am sorry if i explain all wrong i am realy new to this and this but thanks for all your help

Link to comment
Share on other sites

Twice now you've said what you want to do but you haven't yet asked a question. Do you want us to do it for you? Were not really here to write code for people.

 

Do you have an actual question? Where are you stuck?

 

i have made this pages and i am stuck with how to join them i tried alot of different ways but it seems notting i tried works so i tought of asking you guys for help with this, maybe give me an idea of how to do it or write a code to join 2 pages or something i will fig out how to do the rest thanks again for all your help

Link to comment
Share on other sites

i dont know were to start :( i know this will sort the tables out

 

$FGuide-ment = $Table[1];
        $FGuide-sabc1 = $Table[2];
        $FGuide-sabc2 = $Table[3];
        $FGuide-sabc3 = $Table[4];
        $FGuide-etv = $Table[5];

but i dont know how to add it to the page so the users can view them, anyways i am sorry for asking such a silly question i realy need to learn php and was told this would be the rite place to start :( thanks again cheers

Link to comment
Share on other sites

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

if (Get_QString('Post') == "True") {
	$Channel = GetPost('Channel');
	TvGuide_Get($Channel);
} else {
	Show_Form("");
}

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

function TvGuide_Get($Channel) {
$url = "http://mysite.com".$ChannelS[0];
$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 = $Channel

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

}
      echo '      <div class="hd2"><center><font color=#666666><strong><img src="Images/tvguide/sabc1.jpg"></strong></font></center></div><br>'."\n";
      $thedate = date('l dS F Y');
      echo '       <center><font face="Verdana" size="2" color="blue"><u>' .$thedate. '</center></u></font>'."\n";
      echo '   	<br><font face="Verdana" size="2"><?php echo GetGuide(); ?></font><br>'."\n";
echo '	<center><font face="Verdana" size="2"><?php echo $GLOBALS["Advert03"]; ?></font></center>'."\n";
echo '	<table id="" border="0" style="font-size:9pt;width:100%;">'."\n";
echo '	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>'."\n";
echo '	<font face="Verdana" size="2"><b><a href="TvGuide.php">Back</b></font></a><br>'."\n";
echo '	</td></tr>'."\n";
echo '	</table>'."\n";
echo '	<hr>'."\n";
Show_Buttons("False", "index.php?Cmd=100");

function Show_Form($Error) {
echo '<div class="hd2"><center><font color=#666666><strong>Tv Guide</strong></font></center></div><br>'."\n";
echo '<center>'."\n";
echo '<form method="post" action="TvGuide.php?Post=True">'."\n";
echo '	<table border="0" cellpadding="0" cellspacing="0" style="font-size:9pt;width:100px;">'."\n";
echo '		<tr><td align=left>Channel:</td></tr>'."\n";
echo '		<tr><td>'."\n";
echo '			<select name="Channel">'."\n";
echo '			<option value="--">Select A Channel</option>
        echo '<option value="Table[0]">Sabc 1</option>'."\n";
        echo '<option value="Table[1]">Sabc 2</option>'."\n";
        echo '<option value="Table[2]">Sabc 3</option>'."\n";
        echo '<option value="Table[3]">Mnet</option>'."\n";
        echo '<option value="Table[4]">Etv</option>'."\n";
echo '			</select>';
echo '		</td></tr>'."\n";
echo '		<tr><td colspan="2" align=center><br><input type="submit" value="Get It!" name="Submit"></td></tr>'."\n";
echo '	</table>'."\n";
echo '</form>'."\n";
       Show_Buttons("True", "index.php?Cmd=100");
}

function Show_Buttons($Link) {
echo '<center>'.$GLOBALS["Advert03"].'</center>'."\n";
echo '<table id="" border="0" style="font-size:9pt;width:100%;">'."\n";
echo '	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>'."\n";
echo '		<font face="Verdana" size="2"><b><a href="'.$Link.'">Back</b></font></a><br>'."\n";
echo '	</td></tr>'."\n";
echo '</table>'."\n";
echo '<hr>'."\n";
}
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;  
}
?>

 

ok i tried this but i just cant get it rite please show me what i am doing wrong

Link to comment
Share on other sites

I would recommend more reading and following along with other tutorials until that has given you enough insight to code your own things.  Don't take this as me saying you can't do it, but rather you just need more experience with other commands before you can code your own work.  Read about if statements and while loops and you can fix your current problem easily.

Link to comment
Share on other sites

this is the only code i could come up with ay i am begging for help  :'(

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

if (Get_QString('Post') == "True") {
	$Channel = GetPost('Channel');
	TvGuide_Get($Channel);
} else {
	Show_Form($get-channel);
}

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

function TvGuide_Get($Channel) {
$url = "http://mysite.com".$ChannelS[0];
$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 = $Channel

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


      echo '      <div class="hd2"><center><font color=#666666><strong><img src="Images/tvguide/sabc1.jpg"></strong></font></center></div><br>'."\n";
      $thedate = date('l dS F Y');
      echo '       <center><font face="Verdana" size="2" color="blue"><u>' .$thedate. '</center></u></font>'."\n";
      echo '   	<br><font face="Verdana" size="2"><?php echo GetGuide(); ?></font><br>'."\n";
echo '	<center><font face="Verdana" size="2"><?php echo $GLOBALS["Advert03"]; ?></font></center>'."\n";
echo '	<table id="" border="0" style="font-size:9pt;width:100%;">'."\n";
echo '	<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>'."\n";
echo '	<font face="Verdana" size="2"><b><a href="TvGuide.php">Back</b></font></a><br>'."\n";
echo '	</td></tr>'."\n";
echo '	</table>'."\n";
echo '	<hr>'."\n";
}

function Show_Form($get-channel) {
echo '<div class="hd2"><center><font color=#666666><strong>Tv Guide</strong></font></center></div><br>'."\n";
echo '<center>'."\n";
echo '<form method="post" action="test/Tvguide.php?Post=True">'."\n";
echo '	<table border="0" cellpadding="0" cellspacing="0" style="font-size:9pt;width:100px;">'."\n";
echo '		<tr><td align=left>Channel:</td></tr>'."\n";
echo '		<tr><td>'."\n";
echo '			<select name="Channel">'."\n";
echo '			<option value="--">Select A Channel</option>
        echo '<option value="Table[0]">Sabc 1</option>'."\n";
        echo '<option value="Table[1]">Sabc 2</option>'."\n";
        echo '<option value="Table[2]">Sabc 3</option>'."\n";
        echo '<option value="Table[3]">Mnet</option>'."\n";
        echo '<option value="Table[4]">Etv</option>'."\n";
echo '			</select>';
echo '		</td></tr>'."\n";
echo '		<tr><td colspan="2" align=center><br><input type="submit" value="Get It!" name="Submit"></td></tr>'."\n";
echo '	</table>'."\n";
echo '</form>'."\n";
}

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;  
}
?>code]

Link to comment
Share on other sites

Your need to explain the problem, no one is going to read thought all your code and debug it, its one of the things you need to learn..

 

first question is always "what is the problem" this has still not be answered.

yes theirs bugs in your code but until you learn to identify them you will not be able to resolved them..

Link to comment
Share on other sites

When you get the error, undo the last thing you added and tested again..

until you identify what part if causing the problem!

 

also don't change the code until you identify a problem, as you this cause the last problem you had

 

I could highlight all the error but that's not going to help you in the long run,

 

Link to comment
Share on other sites

can u help me with the form and i can try from there coz i have a feeling my form is 1 of the reasons this is not working i have tried so many things that my brain feels like its friend and maybe if u highlight the errors will help me coz i can learn from my mistake hehe

Link to comment
Share on other sites

ok i tried this and still get the same error :( 

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

if (Get_QString('Post') == "True") {
	$Channel = GetPost('Channel');
	TvGuide_Get();
} else {
	Show_Form();
}


function Show_Form() {
echo '<div class="hd2"><center><font color=#666666><strong>Tv Guide</strong></font></center></div><br>'."\n";
echo '<center>'."\n";	echo '<form method="post" action="test/Tvguide.php?Post=True">'."\n";
        echo '	<table border="0" cellpadding="0" cellspacing="0" style="font-size:9pt;width:100px;">'."\n";	
        echo '		<tr><td align=left>Channel:</td></tr>'."\n";	 
        echo '		<tr><td>'."\n";
echo '			<select name="Channel">'."\n";	
        echo '			<option value="--">Select A Channel</option>       
        echo '<option value="Table[0]">Sabc 1</option>'."\n";        
        echo '<option value="Table[1]">Sabc 2</option>'."\n";        
        echo '<option value="Table[2]">Sabc 3</option>'."\n";        
        echo '<option value="Table[3]">Mnet</option>'."\n";       
        echo '<option value="Table[4]">Etv</option>'."\n";	
        echo '			</select>';	
        echo '		</td></tr>'."\n";	
        echo '		<tr><td colspan="2" align=center><br><input type="submit" value="Get It!" name="Submit"></td></tr>'."\n";	echo '	</table>'."\n";	echo '</form>'."\n";

}

function TvGuide_Get() {
    $url = "http://m.theguide.co.za/tv.php".$ChannelS[0];
    $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 = $Channel

    $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/sabc3.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.