By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,170 Members | 1,679 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,170 IT Pros & Developers. It's quick & easy.

Working with php on a new site but after a few clicks site loads only on a mac not pc

P: 14
Hey everyone,

I am working on a new site, ForceFedTV.com and I have gotten reports that the site runs great on mac, but once loaded on a pc, after clicking a few links then going back to the home button, they claim they get all black and nothing else.

I am working with an index script that incorporates php to create something like frames.

If someone can access the site and maybe even try and speculate on this, that would be great,

My script is below,
Tim

<?php


$channels=$_GET['channels']; if (empty($channels)) { $channels='blank'; } changechannels($channels);
$theatre=$_GET['theatre']; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre);
$info=$_GET['info']; if (empty($info)) { $info='noinfo'; } changeinfo($info);



function changechannels($channels) {

echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="770">';
echo '<tr>';
echo '<td width="130" align="center" valign="top">';
echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="130">';
echo '<tr>';
echo '<td width="130" align="center" valign="top">';
include ('main.php');
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td width="130" align="center" valign="top">';

switch ($channels)
{
case 'blank':
include ('blank.php'); break;

case 'tv':
include ('/home/forcefed/public_html/tvfiles/tv.php'); break;

case 'movies':
include ('/home/forcefed/public_html/moviefiles/movies.php'); break;

case 'musicvideos':
include ('/home/forcefed/public_html/musicvideofiles/musicvideos.php'); break;

case 'animation':
include ('/home/forcefed/public_html/animationfiles/animation.php'); break;
}}

function changetheatre($theatre) {
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '<td width="640" align="center" valign="top">';
echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="640">';
echo '<tr>';
echo '<td width="640" align="center" valign="top">';

switch ($theatre)
{
case 'splash':
include ('splash.php'); break;

case 'movie':
include ('movie.php'); break;

case 'tv':
include ('tv.php'); break;

case 'musicvideos':
include ('musicvideos.php'); break;

case 'animation':
include ('animation.php'); break;

case 'detroit':
include ('detroit.php'); break;

case 'info':
include ('info.php'); break;

case 'bowlingfortrophies':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep1/bftpilotep1.php'); break;

case 'bftpilotep1':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep1/bftpilotep1.php'); break;

case 'bftpilotep2':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep2/bftpilotep2.php'); break;

case 'buriedman':
include ('/home/forcefed/public_html/moviefiles/buriedman/buriedman.php'); break;

case 'selitoya':
include ('/home/forcefed/public_html/moviefiles/selitoya/selitoya.php'); break;

case 'selitoyatrailer':
include ('/home/forcefed/public_html/moviefiles/selitoyatrailer/selitoyatrailer.php'); break;

case 'endcall':
include ('/home/forcefed/public_html/moviefiles/endcall/endcall.php'); break;

case 'thepaperboy':
include ('/home/forcefed/public_html/moviefiles/thepaperboy/thepaperboy.php'); break;
}}



function changeinfo($info) {
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td width="640" align="center" valign="top">';

switch ($info)
{
case 'noinfo':
include ('noinfo.php'); break;

case 'bowlingfortrophies':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftinfo.php'); break;

case 'bftpilotep1':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep1/bftpilotep1info.php'); break;

case 'bftpilotep2':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep2/bftpilotep2info.php'); break;

case 'buriedman':
include ('/home/forcefed/public_html/moviefiles/buriedman/buriedmaninfo.php'); break;

case 'selitoya':
include ('/home/forcefed/public_html/moviefiles/selitoya/selitoyainfo.php'); break;

case 'selitoyatrailerinfo':
include ('/home/forcefed/public_html/moviefiles/selitoyatrailer/selitoyatrailerinfo.php'); break;

case 'endcall':
include ('/home/forcefed/public_html/moviefiles/endcall/endcallinfo.php'); break;

case 'thepaperboy':
include ('/home/forcefed/public_html/moviefiles/thepaperboy/thepaperboyinfo.php'); break;

}}

echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '</tr>';
echo '</table>';

include ('footer.php');
?>
Oct 1 '07 #1
Share this Question
Share on Google+
10 Replies


Motoma
Expert 2.5K+
P: 3,235
The most likely cause is that an unexpected value is coming through your switch statements (likely the variable has not been set). You should always have a default statement to handle the case of bad data coming through.
Oct 1 '07 #2

P: 14
The most likely cause is that an unexpected value is coming through your switch statements (likely the variable has not been set). You should always have a default statement to handle the case of bad data coming through.
Whats weird though is if you click the home button (which is set to go directly to forcefedtv.com, meaning there is no variables being sent at all) it comes up black on my bosses two computers. Meaning, the background of the page is black, with nothing on it.


I thought at the beginning of the script when I define my variables, that if there is lack of a variable, then it defaults to what I chose in the line

$channels=$_GET['channels']; if (empty($channels)) { $channels='blank'; } changechannels($channels);

Meaning it defaults to case "blank" for this variable.

I have gone through the entire site and have not found any links with incorrect syntax in the url as an example, like this

http://www.forcefedtv.com/index.php?channels=movies&theatre=selitoya&info=se litoya

Maybe my syntax is wrong when using &s? I am not a php programmer so after a few trys, this gave me the result of sending multiple variables to the script.

Could you elaborate on how to implement if bad info is sent along to have a default case for the switch?

Thanks for the reply, any other thoughts?
Oct 1 '07 #3

Motoma
Expert 2.5K+
P: 3,235
Could you elaborate on how to implement if bad info is sent along to have a default case for the switch?
Expand|Select|Wrap|Line Numbers
  1. switch($a)
  2. {
  3.   case 1:
  4.     echo "one!";
  5.     break;
  6.   case 2:
  7.     echo "two!";
  8.     break;
  9.   default:
  10.     echo "Pick one or two!";
  11.     break;
  12. }
  13.  
Oct 1 '07 #4

P: 14
Much obliged, I am testing it out right now.

Are you sure the syntax should not look like this?

default:
include ('blank.php');
break;

I thought thought you use include (''); for each case. Also, I dont need to put case before default?

Tim
Oct 1 '07 #5

P: 14
I put in the default script and I am still getting the same issue. I have a friend of mine online and he ha confirmed that this issue is only with IE6. He has not seen the black screen issue on IE7.

Should I try it with your syntax?

Any thoughts?
Oct 1 '07 #6

P: 14
My friend also recommended it could be a cashe issue but I dumped the cash on my bosses pc in ie6 and it still gave me the same issue.

What I dont understand is I have used this same script on 3 sites and now it is giving me issues. The only explanation is on this one I am using 3 variables, not just one, so maybe it is to much work for my server?

Aehhh, this is frustrating, spent 2 weeks on this and now problems.

Thanks!
Oct 1 '07 #7

Motoma
Expert 2.5K+
P: 3,235
You should turn on error messages as I have delineated in this thread.

Most likely what is happening is that a parse error in one of your included files is causing an error. Turn on debugging messages and tell me what errors you get back.
Oct 1 '07 #8

P: 14
I get an error of:

Notice: Undefined index: channels in /home/forcefed/public_html/index.php on line 5

When I put your error listing code in. I did notice this only showed up on the hom page, but nothing else.

<?php
error_reporting(E_ALL);
ini_set('display_errors', True);

$channels=$_GET['channels']; if (empty($channels)) { $channels='blank'; } changechannels($channels);
$theatre=$_GET['theatre']; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre);
$info=$_GET['info']; if (empty($info)) { $info='noinfo'; } changeinfo($info);



function changechannels($channels) {

echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="770">';
echo '<tr>';
echo '<td width="130" align="center" valign="top">';
echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="130">';
echo '<tr>';
echo '<td width="130" align="center" valign="top">';
include ('main.php');
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td width="130" align="center" valign="top">';

switch ($channels)
{
case 'blank':
include ('blank.php'); break;

case 'tv':
include ('/home/forcefed/public_html/tvfiles/tv.php'); break;

case 'movies':
include ('/home/forcefed/public_html/moviefiles/movies.php'); break;

case 'musicvideos':
include ('/home/forcefed/public_html/musicvideofiles/musicvideos.php'); break;

case 'animation':
include ('/home/forcefed/public_html/animationfiles/animation.php'); break;

default:
include ('blank.php');
break;

}}

function changetheatre($theatre) {
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '<td width="640" align="center" valign="top">';
echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="640">';
echo '<tr>';
echo '<td width="640" align="center" valign="top">';

switch ($theatre)
{
case 'splash':
include ('splash.php'); break;

case 'movie':
include ('movie.php'); break;

case 'tv':
include ('tv.php'); break;

case 'musicvideos':
include ('musicvideos.php'); break;

case 'animation':
include ('animation.php'); break;

case 'detroit':
include ('detroit.php'); break;

case 'info':
include ('info.php'); break;

case 'bowlingfortrophies':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep1/bftpilotep1.php'); break;

case 'bftpilotep1':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep1/bftpilotep1.php'); break;

case 'bftpilotep2':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep2/bftpilotep2.php'); break;

case 'buriedman':
include ('/home/forcefed/public_html/moviefiles/buriedman/buriedman.php'); break;

case 'selitoya':
include ('/home/forcefed/public_html/moviefiles/selitoya/selitoya.php'); break;

case 'selitoyatrailer':
include ('/home/forcefed/public_html/moviefiles/selitoyatrailer/selitoyatrailer.php'); break;

case 'endcall':
include ('/home/forcefed/public_html/moviefiles/endcall/endcall.php'); break;

case 'thepaperboy':
include ('/home/forcefed/public_html/moviefiles/thepaperboy/thepaperboy.php'); break;

default:
include ('splash.php');
break;
}}



function changeinfo($info) {
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td width="640" align="center" valign="top">';

switch ($info)
{
case 'noinfo':
include ('noinfo.php'); break;

case 'bowlingfortrophies':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftinfo.php'); break;

case 'bftpilotep1':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep1/bftpilotep1info.php'); break;

case 'bftpilotep2':
include ('/home/forcefed/public_html/tvfiles/bowlingfortrophies/bftpilotep2/bftpilotep2info.php'); break;

case 'buriedman':
include ('/home/forcefed/public_html/moviefiles/buriedman/buriedmaninfo.php'); break;

case 'selitoya':
include ('/home/forcefed/public_html/moviefiles/selitoya/selitoyainfo.php'); break;

case 'selitoyatrailerinfo':
include ('/home/forcefed/public_html/moviefiles/selitoyatrailer/selitoyatrailerinfo.php'); break;

case 'endcall':
include ('/home/forcefed/public_html/moviefiles/endcall/endcallinfo.php'); break;

case 'thepaperboy':
include ('/home/forcefed/public_html/moviefiles/thepaperboy/thepaperboyinfo.php'); break;

default:
include ('noinfo.php');
break;

}}

echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '</tr>';
echo '</table>';

include ('footer.php');
?>
Oct 1 '07 #9

Motoma
Expert 2.5K+
P: 3,235
When you view the source of your rendered page, is the proper HTML there?
Oct 1 '07 #10

P: 14
When you view the source of your rendered page, is the proper HTML there?
As far as I can tell. I have a friend who tested this on his pc with ie6 and thinks it has something to do with the javascript I am running. On my site, I have quite a few videos that use a javascript to run the flash video. Either there is a glitch with that or I am going to have to go with the Flash provided html to run them.

I will post this in the javascript forum, but any thoughts would be great,


<script type="text/javascript" src="http://www.forcefedtv.com/swfobject.js"></script>
</script><div id="fp1" class="flowplayerlp">Flash</div>
<script type="text/javascript">
// <![CDATA[
var fo = new SWFObject("http://www.forcefedtv.com/FlowPlayerLP.swf", "FlowPlayer", "640", "398", "9", "#ffffff", true);
fo.addParam("AllowScriptAccess", "always");
fo.addParam("allowFullScreen", "true");
fo.addVariable("config", "{ progressBarColor1: 0x3333CC, progressBarColor2: 0xFF0000, thumbs: [ { thumbNail: 'http://www.forcefedtv.com/thumbs/1.jpg', time: 12}, { thumbNail: 'http://www.forcefedtv.com/thumbs/2.jpg', time: 45}, { thumbNail: 'http://www.forcefedtv.com/thumbs/3.jpg', time: 79}, { thumbNail: 'http://www.forcefedtv.com/thumbs/4.jpg', time: 145}, { thumbNail: 'http://www.forcefedtv.com/thumbs/5.jpg', time: 228},{ thumbNail: 'http://www.forcefedtv.com/thumbs/6.jpg', time: 363}, { thumbNail: 'http://www.forcefedtv.com/thumbs/7.jpg', time: 447}, { thumbNail: 'http://www.forcefedtv.com/thumbs/8.jpg', time: 466}, { thumbNail: 'http://www.forcefedtv.com/thumbs/9.jpg', time: 593}, { thumbNail: 'http://www.forcefedtv.com/thumbs/10.jpg', time: 908}, { thumbNail: 'http://www.forcefedtv.com/thumbs/11.jpg', time: 1047}, { thumbNail: 'http://www.forcefedtv.com/thumbs/12.jpg', time: 1110}, { thumbNail: 'http://www.forcefedtv.com/thumbs/13.jpg', time: 1124}], showPlayListButtons: false, playList: [ { overlayId: 'play' }, { url: 'http://www.forcefedtv.com/moviefiles/selitoya/selitoya.flv' }], autoBuffering: true, loop: false, initialScale: 'orig', useNativeFullScreen: true }");
fo.write("fp1");
// ]]>
</script>


Thanks!
Tim
Oct 2 '07 #11

Post your reply

Sign in to post your reply or Sign up for a free account.