Current location: Hot Scripts Forums » Programming Languages » PHP » A little issue


A little issue

Reply
  #1 (permalink)  
Old 03-20-09, 11:12 AM
Nik00117 Nik00117 is offline
Newbie Coder
 
Join Date: Mar 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
A little issue

Ok let me describe to you what i'm trying to do.

I'm trying to create some basic PHP code which will change the commercial on my front page of my site and have a different commerical for each day of the week (site is www.niksmilitarysales.com )

Now I had a code to do this for days of the week, and heres the days of the week I used.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<p>
<!-- PHP CODE DAY CODE -->
<?php
$d=gmdate("D",time()+3600); // GMT+1 --> 3600 seconds
if ($d=="Fri")
  echo "Enjoy your weekend!"; 
elseif ($d=="Sat")
  echo "Enjoy your Saturday!"; 
elseif ($d=="Sun")
  echo "Enjoy your Sunday!"; 
  elseif ($d=="Mon")
  echo "Enjoy your Monday!";
  elseif ($d=="Tue")
  echo "Enjoy your Tuesday!"; 
  elseif ($d=="Wed")
  echo "Enjoy your Wednesday!";
  elseif ($d=="Thu")
  echo "Enjoy your Thursday!";  
?> </p>
<body>
</body>
</html>
This code is what I intended up with (I just copied the same video over several different times.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<p>
<?php $d=gmdate("D",time()+3600); // GMT+1 --> 3600 seconds
if ($d=="Fri")
  echo "<p><a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></table></p>"; 
elseif ($d=="Sat")
  echo "<p><a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></table></p>!"; 
elseif ($d=="Sun")
  echo "<p><a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></table></p>"; 
  elseif ($d=="Mon")
  echo "<p><a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></table></p>";
  elseif ($d=="Tue")
  echo "<p><a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></table></p>"; 
  elseif ($d=="Wed")
  echo "<p><a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></table></p>";
  elseif ($d=="Thu")
  echo "<p><a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></table></p>";  
?> </p>

<body>
</body>
</html>
HelP?
Reply With Quote
  #2 (permalink)  
Old 03-20-09, 03:32 PM
landing's Avatar
landing landing is offline
Coding Addict
 
Join Date: Jul 2006
Location: Scotland
Posts: 302
Thanks: 0
Thanked 0 Times in 0 Posts
Using an array would cut down a lot of redundant code

PHP Code:

<?php
// Array of week days. Replace links accordingly
$ads[0] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// Sunday
$ads[1] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// M
$ads[2] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// T
$ads[3] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// W
$ads[4] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// T
$ads[5] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// F
$ads[6] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// Saturday

$d gmdate("w"time()+3600); // This returns the numeric day of the week. 0 for Sunday and 6 for Saturday
$ad_today $ads[$d];
?>
<p><a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="<?php echo $ad_today?>"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="<?php echo $ad_today?>" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></table></p>";  
</p>
__________________
Always sanitise your data


Best regards
Reply With Quote
  #3 (permalink)  
Old 03-20-09, 06:43 PM
Nik00117 Nik00117 is offline
Newbie Coder
 
Join Date: Mar 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you for your response, but that code COMPLETELY screws up my entire page.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
   <?php include 'headerarea4.php' ?><head><title>Nik's Military Military Car Sales</title>


This is my main page code.
        
<div id="content">
       <marquee direction="left" loop="20"><a href="truckoftheyear.php" target="_blank"><font size="4" color="#0B0000">Click here to see who won Truck Of The <strong>YEAR!</strong></font></a></marquee>
            <p><h3>Welcome to Nik's Military Military Car Sales</h3> <!-- Remember this is in order to keep the names of the various site owners and their respective agents in check, in order to reduce the likely hood of a crossover --><?php include 'fullagent.php' ?> is a independent sales agents representing Exchange New Car Sales in the Balkans</p>
<p>We are on base to serve those who serve; with years of sales experience. We firmly believe in sound customer service and would like for you to experience that. Therefore stop by the office. Or if it’s easier for you just give us a call or send us an  e-mail by going to our <a href="contactus.php">contact page.</a> </p> 
<p>Exchange New Car Sales has been serving the military community since the mid 1960s when AAFES/NEXCOM program was authorized by the U.S. Congress.
We make sure you are able to purchase a US made Ford, Chrysler or Harley regardless of where you are stationed, at a fair price with choice and wonderful customer service.</p>
<p>
<!-- PHP CODE DAY CODE -->
<?php
$d=gmdate("D",time()+3600); // GMT+1 --> 3600 seconds
if ($d=="Fri")
  echo "Enjoy your weekend!"; 
elseif ($d=="Sat")
  echo "Enjoy your Saturday!"; 
elseif ($d=="Sun")
  echo "Enjoy your Sunday!"; 
  elseif ($d=="Mon")
  echo "Enjoy your Monday!";
  elseif ($d=="Tue")
  echo "Enjoy your Tuesday!"; 
  elseif ($d=="Wed")
  echo "Enjoy your Wednesday!";
  elseif ($d=="Thu")
  echo "Enjoy your Thursday!";  
?> 
<!-- END OF PHP DAY CODE -->
</p>
<?php
// Array of week days. Replace links accordingly
$ads[0] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'; // Sunday
$ads[1] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'; // M
$ads[2] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'; // T
$ads[3] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'; // W
$ads[4] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'; // T
$ads[5] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'; // F
$ads[6] = 'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'; // Saturday

$d = gmdate("w", time()+3600); // This returns the numeric day of the week. 0 for Sunday and 6 for Saturday
$ad_today = $ads[$d];
?>
<p><a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="<?php echo $ad_today; ?>"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="<?php echo $ad_today; ?>" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></table></p>";  
</p>
<p align="center"><h2 align="center">NEWS</h2></p>
<p align="center"><a href="carnews.php"><h3 align="center">Click here for the latest on up to date car news!</h3></a></p>
        <a href="www.firefox.com" target="_blank"><h3 align="center" style="color:orange">THIS SITE BEST VIEWED IN FIREFOX</h3>
<center><img src="../pics/firefox.jpg" align="middle" width="36" height="35" border="none"><p>FIREFOX</p></center></a>   
<!-- end of page content -->
     </div>
        <div id="headerbar"><span class="largeaccentbold">Nik's Military New Car Sales -  </span></div>
        <div id="footer4"><?php include 'footer.php' ?></div>
        <div id="Layer1">
      <?php include 'rightside.php' ?>
        </div>
      </div>
<div class="featurelink" id="lojackdetails"><a href="../PDFs/lojack.pdf"">LoJack™  is here! Click for more details...</a></div>
      <img src="../pics/banner/editing needed2 copy.jpg" width="932" height="214"></div></td>
  </tr>
</table>
</body>
</html>
This is the code that's live atm. (www.niksmilitarysales.com)

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
   <?php include 'headerarea4.php' ?><head><title>Nik's Military Military Car Sales</title>

        
<div id="content">
       <marquee direction="left" loop="20"><a href="truckoftheyear.php" target="_blank"><font size="4" color="#0B0000">Click here to see who won Truck Of The <strong>YEAR!</strong></font></a></marquee>
            <p><h3>Welcome to Nik's Military Military Car Sales</h3> <!-- Remember this is in order to keep the names of the various site owners and their respective agents in check, in order to reduce the likely hood of a crossover --><?php include 'fullagent.php' ?> is a independent sales agents representing Exchange New Car Sales in the Balkans</p>
<p>We are on base to serve those who serve; with years of sales experience. We firmly believe in sound customer service and would like for you to experience that. Therefore stop by the office. Or if it’s easier for you just give us a call or send us an  e-mail by going to our <a href="contactus.php">contact page.</a> </p> 
<p>Exchange New Car Sales has been serving the military community since the mid 1960s when AAFES/NEXCOM program was authorized by the U.S. Congress.
We make sure you are able to purchase a US made Ford, Chrysler or Harley regardless of where you are stationed, at a fair price with choice and wonderful customer service.</p>
<p>
<!-- PHP CODE DAY CODE -->
<?php
$d=gmdate("D",time()+3600); // GMT+1 --> 3600 seconds
if ($d=="Fri")
  echo "Enjoy your weekend!"; 
elseif ($d=="Sat")
  echo "Enjoy your Saturday!"; 
elseif ($d=="Sun")
  echo "Enjoy your Sunday!"; 
  elseif ($d=="Mon")
  echo "Enjoy your Monday!";
  elseif ($d=="Tue")
  echo "Enjoy your Tuesday!"; 
  elseif ($d=="Wed")
  echo "Enjoy your Wednesday!";
  elseif ($d=="Thu")
  echo "Enjoy your Thursday!";  
?> 
<!-- END OF PHP DAY CODE -->
</p>
<a href="mustang.php" target="_blank"><p align="center" ><h1 align="center" style="color:black"><u>Introducing the 2010 Mustang</u></h1></p></a>
<p align="center"><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object> <?php include 'videocode.php' ?></p>
<p align="center"><h2 align="center">NEWS</h2></p>
<p align="center"><a href="carnews.php"><h3 align="center">Click here for the latest on up to date car news!</h3></a></p>
        <a href="www.firefox.com" target="_blank"><h3 align="center" style="color:orange">THIS SITE BEST VIEWED IN FIREFOX</h3>
<center><img src="../pics/firefox.jpg" align="middle" width="36" height="35" border="none"><p>FIREFOX</p></center></a>        </div>
        <div id="headerbar"><span class="largeaccentbold">Nik's Military New Car Sales -  </span></div>
        <div id="footer4"><?php include 'footer.php' ?></div>
        <div id="Layer1">
      <?php include 'rightside.php' ?>
        </div>
      </div>
<div class="featurelink" id="lojackdetails"><a href="../PDFs/lojack.pdf"">LoJack™  is here! Click for more details...</a></div>
      <img src="../pics/banner/editing needed2 copy.jpg" width="932" height="214"></div></td>
  </tr>
</table>
</body>
</html>
For reference this would be my css code

Code:
body {
	padding:0;
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:11px;
	color:#191D26;
	text-align:center;
	min-width:450px;
	line-height: normal;
	font-weight: normal;
	background-attachment: scroll;
	background-repeat: repeat-x;
	background-position: left top;6
	border-bottom-width: 1px;
	width: 100%;
	margin-top: 0;
	margin-right: auto;
	margin-bottom: 0;
	margin-left: auto;
	background-color: #454545;
	background-image: url(../images/bg.jpg);
	}


#wrap {
	max-width:100%;
	position:relative;
	height: auto;
	top: 0px;
	width: auto;
	left: 0px;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: none;
	border-left-style: solid;
	border-top-color: #000000;
	border-bottom-color: #000000;
	border-left-color: #000000;
	}
a 
{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #058FCD;
	font-size: 11px;
	font-weight: normal;
	text-decoration: none;
}
a:link {
	text-decoration: none;
	color: #058FCD;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: normal;
}
a:visited {
	text-decoration: none;
	color: #058FCD;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: normal;
}
a:hover {
	text-decoration: underline;
	color: #058FCD;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: normal;
}
a:active {
	text-decoration: none;
	color: #058FCD;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: normal;
}.featurelink a 
{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #FFFFFF;
	font-size: 11px;
	font-weight: normal;
	text-decoration: none;
}
 .featurelink a:link {
	text-decoration: none;
	color: #FFFFFF;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: normal;
}
 .featurelink a:visited {
	text-decoration: none;
	color: #FFFFFF;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: normal;
}
.featurelink a:hover {
	text-decoration: underline;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: normal;
	color: #EDEEEF;
}
 .featurelink a:active {
	text-decoration: none;
	color: #FFFFFF;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: normal;
	}
.mainmenu a 
{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #222A35;
	font-size: 11px;
	font-weight: bold;
}
.mainmenu a:link {
	text-decoration: none;
	color: #222A35;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.mainmenu a:visited {
	text-decoration: none;
	color: #222A35;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.mainmenu a:hover {
	text-decoration: none;
	color: #4A4A4A;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.mainmenu a:active {
	text-decoration: none;
	color: #222A35;
	font-size: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	}
.largeaccentbold {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	color: #FFFFFF;
}
#mainmenublock {
	position:absolute;
	left:0px;
	top:66px;
	width:932px;
	height:auto;
	z-index:1;
	padding-top: 10px;
	padding-bottom: 10px;
	text-align: center;
	word-spacing: 90px;
}
#toptag {
	position:absolute;
	left:599px;
	top:39px;
	width:317px;
	height:17px;
	z-index:2;
	text-align: right;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	color: #F3F3F1;
}
#maincontentcontainer {
	position:absolute;
	left:-1px;
	top:214px;
	width:932px;
	height:638px;
	z-index:3;
	background-color: #FFFFFF;
	border-top-width: 3px;
	border-top-style: solid;
	border-top-color: #171717;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #000000;
	border-left-color: #000000;
}
#maincontentcontainer2 {
	position:absolute;
	left:-1px;
	top:221px;
	width:932px;
	height:767px;
	z-index:3;
	background-color: #FFFFFF;
	border-top-width: 3px;
	border-top-style: solid;
	border-top-color: #171717;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #000000;
	border-left-color: #000000;
}
#maincontentcontainer3 {
	position:absolute;
	left:-1px;
	top:221px;
	width:932px;
	height:934px;
	z-index:3;
	background-color: #FFFFFF;
	border-top-width: 3px;
	border-top-style: solid;
	border-top-color: #171717;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #000000;
	border-left-color: #000000;
}
#maincontentcontainer4 {
	position:absolute;
	left:-1px;
	top:221px;
	width:932px;
	height:1035px;
	z-index:3;
	background-color: #FFFFFF;
	border-top-width: 3px;
	border-top-style: solid;
	border-top-color: #171717;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #000000;
	border-left-color: #000000;
}
#maincontentcontainer5 {
	position:absolute;
	left:-1px;
	top:221px;
	width:932px;
	height:1291px;f
	z-index:3;
	background-color: #FFFFFF;
	border-top-width: 3px;
	border-top-style: solid;
	border-top-color: #171717;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #000000;
	border-left-color: #000000;
}
#maincontentcontainer6 {
	position:absolute;
	left:-1px;
	top:221px;
	width:932px;
	height:1450px;
	z-index:3;
	background-color: #FFFFFF;
	border-top-width: 3px;
	border-top-style: solid;
	border-top-color: #171717;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #000000;
	border-left-color: #000000;
}

#maincontentcontainer7 {
	position:absolute;
	left:-1px;
	top:221px;
	width:932px;
	height:1686px;
	z-index:3;
	background-color: #FFFFFF;
	border-top-width: 3px;
	border-top-style: solid;
	border-top-color: #171717;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #000000;
	border-left-color: #000000;
}
#leftlinksbox {
	position:absolute;
	left:0px;
	top:0px;
	width:160px;
	height:450px;
	z-index:2;
	padding: 10px;
	border-bottom-width: 3px;
	border-bottom-style: solid;
	border-bottom-color: #AFB0AB;
	background-color: #212121;
}
#leftlinksboxtitle {
	position:absolute;
	left:0px;
	top:0px;
	width:174px;
	height:24px;
	z-index:2;
	text-align: left;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	color: #FFFFFF;
	padding-left: 5px;
	border-bottom-width: 1px;
	border-bottom-style: solid;
	border-bottom-color: #BDBAB1;
	visibility: visible;
	border-right-width: 1px;
	border-right-style: dotted;
	border-right-color: #393939;
	background-color: #000000;
}
#leftlinkset {
	position:absolute;
	left:10px;
	top:34px;
	width:157px;
	height:332px;
	z-index:2;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	color: #EDEEEF;
	padding: 5px;
	line-height: 25px;
	font-weight: bold;
	text-align: left;
}
#adtitle {
	position:absolute;
	left:762px;
	top:4px;
	width:150px;
	height:auto;
	z-index:6;
	background-color: #191D26;
	text-align: center;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #FFFFFF;
	font-weight: bold;
	padding-left: 10px;
}
#adslot {
	position:absolute;
	left:762px;
	top:28px;
	width:150px;
	height:222px;
	z-index:1;
	padding: 10px;
	background-color: #000000;
	border-bottom-width: 4px;
	border-bottom-style: solid;
	border-bottom-color: #191D26;
}
#content {
	position:absolute;
	left:189px;
	top:36px;
	width:518px;
	height:1501px;
	z-index:4;
	padding: 10px;
	text-align: left;
}
#headerbar {
	position:absolute;
	left:-1px;
	top:-3px;
	width:732px;
	height:auto;
	z-index:1;
	background-color: #000000;
	text-align: left;
	padding-top: 5px;
	padding-right: 5px;
	padding-bottom: 5px;
	padding-left: 197px;
	border-top-width: thin;
	border-top-style: solid;
	border-top-color: #171717;
}
#footer {
	position:absolute;
	left:-1px;
	top:600px;
	width:907px;
	height:auto;
	z-index:6;
	background-color: #FFFFFF;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: normal;
	color: #C1C1C1;
	text-align: center;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-color: #F5F5F5;
	border-bottom-color: #191D26;
	padding-top: 10px;
	padding-right: 15px;
	padding-bottom: 10px;
	padding-left: 15px;
	background-image: url(../images/footerbg.jpg);
	background-repeat: repeat-x;
	background-position: left bottom;
}
#footer2 {
	position:absolute;
	left: -1px;
	top:761px;
	width:905px;
	height:auto;
	z-index:6;
	background-color: #FFFFFF;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: normal;
	color: #C1C1C1;
	text-align: center;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-color: #F5F5F5;
	border-bottom-color: #191D26;
	padding-top: 10px;
	padding-right: 15px;
	padding-bottom: 10px;
	padding-left: 15px;
	background-image: url(../images/footerbg.jpg);
	background-repeat: repeat-x;
	background-position: left bottom;
}
#footer3 {
	position:absolute;
	left: -3px;
	top:898px;
	width:905px;
	height:auto;
	z-index:6;
	background-color: #FFFFFF;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: normal;
	color: #C1C1C1;
	text-align: center;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-color: #F5F5F5;
	border-bottom-color: #191D26;
	padding-top: 10px;
	padding-right: 15px;
	padding-bottom: 10px;
	padding-left: 15px;
	background-image: url(../images/footerbg.jpg);
	background-repeat: repeat-x;
	background-position: left bottom;
}
#footer4 {
	position:absolute;
	left: -1px;
	top:1027px;
	width:905px;
	height:auto;
	z-index:6;
	background-color: #FFFFFF;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: normal;
	color: #C1C1C1;
	text-align: center;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-color: #F5F5F5;
	border-bottom-color: #191D26;
	padding-top: 10px;
	padding-right: 15px;
	padding-bottom: 10px;
	padding-left: 15px;
	background-image: url(../images/footerbg.jpg);
	background-repeat: repeat-x;
	background-position: left bottom;
}
#footer5 {
	position:absolute;
	left: -2px;
	top:1285px;
	width:905px;
	height:auto;
	z-index:6;
	background-color: #FFFFFF;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: normal;
	color: #C1C1C1;
	text-align: center;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-color: #F5F5F5;
	border-bottom-color: #191D26;
	padding-top: 10px;
	padding-right: 15px;
	padding-bottom: 10px;
	padding-left: 15px;
	background-image: url(../images/footerbg.jpg);
	background-repeat: repeat-x;
	background-position: left bottom;
}
#footer6 {
	position:absolute;
	left: 0px;
	top:1438px;
	width:905px;
	height:auto;
	z-index:6;
	background-color: #FFFFFF;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: normal;
	color: #C1C1C1;
	text-align: center;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-color: #F5F5F5;
	border-bottom-color: #191D26;
	padding-top: 10px;
	padding-right: 15px;
	padding-bottom: 10px;
	padding-left: 15px;
	background-image: url(../images/footerbg.jpg);
	background-repeat: repeat-x;
	background-position: left bottom;
}
#footer7 {
	position:absolute;
	left:0px;
	top:1637px;
	width:907px;
	height:auto;
	z-index:6;
	background-color: #FFFFFF;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: normal;
	color: #C1C1C1;
	text-align: center;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-color: #F5F5F5;
	border-bottom-color: #191D26;
	padding-top: 10px;
	padding-right: 15px;
	padding-bottom: 10px;
	padding-left: 15px;
	background-image: url(../images/footerbg.jpg);
	background-repeat: repeat-x;
	background-position: left bottom;
}
.bgtable1 {
	background-color: #212121;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	color: #FFFFFF;
	border-bottom-width: 1px;
	border-bottom-style: solid;
	border-bottom-color: #474747;
}
.bgtable2 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #212121;
	background-color: #F5F5F5;
}
#chat {
	position:absolute;
	left:708px;
	top:211px;
	width:208px;
	height:29px;
	z-index:4;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #FFFFFF;
	text-align: right;
	padding: 5px;
}
#lojackdetails {
	position:absolute;
	left:777px;
	top:163px;
	width:147px;
	height:37px;
	z-index:5;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #E0E0E0;
	text-align: left;
}
#Layer1 {
	position:absolute;
	left:746px;
	top:21px;
	width:179px;
	height:auto;
	z-index:7;
	padding: 5px;
}
.reasons {
color: red;
text-align: center;
size: inherit;
font-size: 15px;
/*Table on contactus.php CSS area */
}
label.fixedwidth2 {
display: black;
width: 500px;
float: left;
}
label.fixedwidth {
display: black;
width: 180px;
float: left;
}
Reply With Quote
  #4 (permalink)  
Old 03-20-09, 07:26 PM
landing's Avatar
landing landing is offline
Coding Addict
 
Join Date: Jul 2006
Location: Scotland
Posts: 302
Thanks: 0
Thanked 0 Times in 0 Posts
Completely screws up your page? It looks fine to be, in FF and IE8.

Any screw ups are likely to be caused by the myriad of HTML errors on your page.

All I done was copy and paste the video object part of your markup and replaced the source URL with PHP.
__________________
Always sanitise your data


Best regards
Reply With Quote
  #5 (permalink)  
Old 03-20-09, 11:09 PM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
landing is on the right track.
It's just that when the PHP echo statement was converted to HTML, some of the syntax formatting was not removed.
And using an array to store the different links is the best idea because it is very fast.
The only thing that was left out was the ability to also change the title.
You could use a multidimensional array for this task or two different arrays.

I chose to use two arrays, to keep it simple.

And another thing that landing may be right about is HTML errors.

I don't understand why you have a closing table tag nested amongst the <p> tags.

PHP Code:

<?php
// Array of titles. Replace titles accordingly
$ads_text = array('Introducing the 2010 Mustang'// Sunday
                  
'Introducing the 2010 Mustang'// M
                  
'Introducing the 2010 Mustang'// T
                  
'Introducing the 2010 Mustang'// W
                  
'Introducing the 2010 Mustang'// Th
                  
'Introducing the 2010 Mustang'// F
                  
'Introducing the 2010 Mustang'); // Saturday

// Array of links. Replace links accordingly
$ads_link = array('http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// Sunday
                  
'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// M
                  
'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// T
                  
'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// W
                  
'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// Th
                  
'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'// F
                  
'http://www.youtube.com/v/gYqGSl4K6uE&hl=en&fs=1'); // Saturday

$d gmdate("w"time()+3600); // This returns the numeric day of the week. 0 for Sunday and 6 for Saturday

echo '<p>
       <a href="mustang.php" target="_blank">
        <p align="center" >
         <h1 align="center" style="color:black"><u>'
.$ads_text[$d].'</u></h1>
        </p>
       </a>
       <p align="center">
        <object width="480" height="295">
         <param name="movie" value="'
.$ads_link[$d].'"></param>
         <param name="allowFullScreen" value="true"></param>
         <param name="allowscriptaccess" value="always"></param>
         <embed src="'
.$ads_link[$d].'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed>
        </object>'
;
        include 
"videocode.php";
?>
        </table>
       </p>
      </p>
And to be completely honest, I don't understand why you have any closing table tags anywhere in your document because you don't seem to have any tables.
__________________
Jerry Broughton

Last edited by job0107; 03-20-09 at 11:17 PM.
Reply With Quote
  #6 (permalink)  
Old 03-21-09, 04:54 AM
Nik00117 Nik00117 is offline
Newbie Coder
 
Join Date: Mar 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
I don't understand why you have a closing table tag nested amongst the <p> tags.
bad code still improving on it.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with global Keyword spyke01 PHP 5 12-03-08 02:18 PM
[SOLVED] PHP AJAX and IE disabled option issue Dan Man PHP 1 08-26-08 02:34 PM
Interesting DataGrid Issue LittlBUGer ASP.NET 11 10-16-06 10:39 AM
Issue Tracking and Task management SlackeR Script Requests 8 10-05-05 04:29 PM
Language issue in from property, Please Help AskAR ASP 0 08-10-05 06:40 AM


All times are GMT -5. The time now is 08:31 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.