Jump to content

Can someone tell me what i am doing wrong here


the-botman

Recommended Posts

Hi i been trying to fog this out for days now and i just cant get it rite please will 1 of you guys help me

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

}

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

We're going to need more information.  What is this script supposed to do?  What, specifically, is not working? 

 

In your TvGuide_Get function you return and _then_ echo some html.  Nothing inside a function gets executed after the return statement.

Ok see its a tv guide so when the user goes to TvGuide.php they get 5 channels to pick from (sabc1, sabc2 , sabc 3, etv, mnet) each channel is a different table, so say they pick sabc 1 it echos sabc 1 guide which is Table[1]

 

Thanks in Advance

The-Botman

i tried something like this sorry the first code was missing the form were they pick the channel

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

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.