Ovaltine
10-27-2007, 05:08 AM
I'm trying to add some fun home projects to my site, Halloween costumes and home improvement stuff.
I've been trying for hours and hours to figure this out, and just when I thought I had it, I posted it and the page won't display because of a parsing error on line 44 (the <!DOCTYPE line). Here's the code.
Oh, and I'd also like the links NOT to be underlined, but can't figure out where to add the style code, what with the code being part php, part Java, part html, and who knows what else. It's a mess, I know, if I knew better what I was doing, I wouldn't need this help, and the code would be prettier.
<?php
/* ......... this goes at in the html document before everything ........... */
/* create array with all the image names inside it. each image should
be a separate image on the array */
$images = Array('HalPika1999.jpg','HalPo2000.jpg','HalGnomeB aby2002','HalUltraManColorBoy2006.jpg','HalUltraMa nColorBoy2006.jpg');
/*create array of all the information*/
$info = Array(
'1999 Pikachu for my son. I started the costume when he was 7 months and sitting. By the time he wore it he was 9 months and walking. He was not happy about being stuck sitting in a costume but he was cute. We got 2nd place in the SCAD costume contest.',
'2000 Teletuby Po. My son requested the character I just made it. He loved it',
'2002 Fairy and Baby Gnome. This year I was going for simple so I made a Gnome hat for my youngest son. For myself I made a bodice to which I attached a pair of fairy wings. The way it is made, I can cause the wings to flap at will.',
'2006 Ultra Man and Color Boy. My oldest son decided to be Ultra Man, my husband found the mask online and I hand stitched the outfit. I used his pjs as a template for the basic pattern. My youngest son imagined Color Boy himself and told me what he looked like so I could create his costume. Both Boys were ecstatic about their outfits.',
'2007 Madcat Mech Warrior. This costume was the result of my wanting to save money. I talked my son into being a robot so I could just use the boxes around the house. He decided he wanted to be a cool robot, and cool meant a Mech. I researched the robot, drew-up a plan in Photoshop, and built the costume using only cardboard boxes, packing tape, and glue. I did have to purchase spray paint, but only a few cans.'
);
function showImageNavigation($images) {
for($i=0; $i<count($images); $i++) {
echo '<a href="'. $_SERVER['PHP_SELF'] .'?image='. $i .'">'. ($i+1) .'</a> ';
}
} /* end of showImageNavigation function */
/*function to show the desired image if query is found*/
function showImage($images) {
$num = $_GET['image'];
$im = 'HomeProjects/'. $images[$num];
echo '<img src="'. $im .'" '. $imString[3] . ' />';
}
function showInformation($info) {
$num = $_GET['image'];
echo $info[$num];
}
function showDefaultImage($images) {
$im = 'HomeProjects/'. $images[0];
$imString = getimagesize($im);
echo '<img src="'. $im .'" '. $imString[3] . ' />';
}
/* ......... this goes at in the html document before everything ........... */
<!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" />
<meta name="generator" content="Adobe GoLive" />
<title>Jennifer Lynn Mattingly Guthrie</title><style type="text/css">
.menutitle{
cursor:pointer;
margin-bottom: 5px;
background-color:#ECECFF;
color:##000000;
width:170px;
padding:2px;
text-align:left;
font-weight:bold;
font color="#9e6af8";
/*/*/border:0px solid #000000;/* */
}
.submenu{
margin-bottom: 0.5em;
}
</style>
<script type="text/javascript">
/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
if(el.style.display != "block"){ //DynamicDrive.com change
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu") //DynamicDrive.com change
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}
function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display ="block"
}
}
function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}
if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction
if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate
</script>
</head>
<body>
<table width="850" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="170"><img src="QuiteGraphicLogo40.jpg" alt="" height="201" width="170" border="0" /></td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="201">
<tr>
<td width="5%"></td>
<td></td>
<td width="7%"></td>
</tr>
<tr valign="bottom">
<td width="5%"></td>
<td><font size="6" color="#9e6af8">Home Projects </font></td>
<td width="7%"></td>
</tr>
<tr>
<td width="5%"></td>
<td valign="top">
<div align="left">
<font size="5" color="#9e6af8">Halloween Costumes </font></div>
</td>
<td width="7%"></td>
</tr>
<tr height="35%">
<td width="5%" height="35%"></td>
<td valign="top" height="35%"><?php if(isset($_GET['image'])) showInformation($info); else echo $info[0]; ?></td>
<td width="7%" height="35%"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" width="170"><!-- Keep all menus within masterdiv-->
<div id="masterdiv">
<div class="menutitle" onclick="SwitchMenu('sub1')">
<font color="#9e6af8"><a href="../Resume/ResumeObjEduEmp.html"><font color="#9e6af8">Resume</font></a></font></div>
<span class="submenu" id="sub1"><font color="#9e6af8">- <a href="../Resume/DesignedResume2007.pdf"><font color="#9e6af8">Download PDF</font></a></span>
<div class="menutitle" onclick="SwitchMenu('sub2')">
<font color="#9e6af8">Graphic Design Portfolio</font></div>
<span class="submenu" id="sub2">
<font color="#9e6af8">- <a href="../GraphicDesign/FlyerSnowWriter.html"><font color="#9e6af8">Flyers</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/ProductPackagingLiquidBeadz.html"><font color="#9e6af8">Product Packaging</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/ProductDesignCards.html"><font color="#9e6af8">Product Design</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/ProductLabelWood.html"><font color="#9e6af8">Product Labels</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/CatalogFMI2003.html"><font color="#9e6af8">Catalog Design</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/POPSnowHeader.html"><font color="#9e6af8">P.O.P Aids</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/MagazineJansen.html"><font color="#9e6af8">Magazine Layout</a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/PresentationFMI.html"><font color="#9e6af8">Presentation Design</a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/PhotogaphyVases.html"><font color="#9e6af8">Photography</a><br>
</span>
<div class="menutitle" onclick="SwitchMenu('sub3')">
<font color="#9e6af8">Fine Art Portfolio</font></div>
<span class="submenu" id="sub3">
<font color="#9e6af8">- <a href="../FineArt/DrawingChalkSelf.html"><font color="#9e6af8">Drawing</font></a><br>
<font color="#9e6af8">- <a href="../FineArtsPaintingPage.html"><font color="#9e6af8">Painting</font></a><br>
<font color="#9e6af8">- <a href="../FineArt/SculptureFlower.html"><font color="#9e6af8">Sculpture</font></a><br>
<font color="#9e6af8">- <a href="../FineArt/PhotographyGlasses.html"><font color="#9e6af8">Photography</font></a>
</span>
<div class="menutitle" onclick="SwitchMenu('sub4')">
<a href="../GraphicDesign/VideoOverview.html"><font color="#9e6af8">Videos</font></div>
<div class="menutitle" onclick="SwitchMenu('sub5')">
<a href="../AboutMe/BioPage.html"><font color="#9e6af8">About the Artist</font></div>
<div class="menutitle" onclick="SwitchMenu('sub6')">
<a href="../Contact/ContactPage.html"><font color="#9e6af8">Contact Information</font></div>
<div class="menutitle" onclick="SwitchMenu('sub7')">
<font color="#9e6af8">Home Projects</font></div>
<span class="submenu" id="sub7">
<font color="#9e6af8">- <a href="Halloween.php"><font color="#9e6af8">Halloween Costumes</font></a><br>
<font color="#9e6af8">- <a href="HomeImprovement.php"><font color="#9e6af8">Home Improvements</font></a>
</span>
<div class="menutitle" onclick="SwitchMenu('sub8')">
<a href="<A href="http://quitegraphic.com/index.html"><font">http://quitegraphic.com/index.html"><font color="#9e6af8">Home</font></div>
</div></td>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr height="5">
<td width="60" height="5"></td>
<td height="5"></td>
<td width="25%" height="5"></td>
</tr>
<tr>
<td align="left" valign="top" width="60"><?php showImageNavigation($images); ?></td>
<td align="center" valign="middle"><?php if(isset($_GET['image'])) showImage($images); else showDefaultImage($images); ?></td>
<td width="25%"></td>
</tr>
<tr>
<td align="right" valign="top" width="60"></td>
<td></td>
<td align="left" valign="top" width="25%"></td>
</tr>
</table>
</td>
</tr>
</table>
<p></p>
</body>
</html>
I've been trying for hours and hours to figure this out, and just when I thought I had it, I posted it and the page won't display because of a parsing error on line 44 (the <!DOCTYPE line). Here's the code.
Oh, and I'd also like the links NOT to be underlined, but can't figure out where to add the style code, what with the code being part php, part Java, part html, and who knows what else. It's a mess, I know, if I knew better what I was doing, I wouldn't need this help, and the code would be prettier.
<?php
/* ......... this goes at in the html document before everything ........... */
/* create array with all the image names inside it. each image should
be a separate image on the array */
$images = Array('HalPika1999.jpg','HalPo2000.jpg','HalGnomeB aby2002','HalUltraManColorBoy2006.jpg','HalUltraMa nColorBoy2006.jpg');
/*create array of all the information*/
$info = Array(
'1999 Pikachu for my son. I started the costume when he was 7 months and sitting. By the time he wore it he was 9 months and walking. He was not happy about being stuck sitting in a costume but he was cute. We got 2nd place in the SCAD costume contest.',
'2000 Teletuby Po. My son requested the character I just made it. He loved it',
'2002 Fairy and Baby Gnome. This year I was going for simple so I made a Gnome hat for my youngest son. For myself I made a bodice to which I attached a pair of fairy wings. The way it is made, I can cause the wings to flap at will.',
'2006 Ultra Man and Color Boy. My oldest son decided to be Ultra Man, my husband found the mask online and I hand stitched the outfit. I used his pjs as a template for the basic pattern. My youngest son imagined Color Boy himself and told me what he looked like so I could create his costume. Both Boys were ecstatic about their outfits.',
'2007 Madcat Mech Warrior. This costume was the result of my wanting to save money. I talked my son into being a robot so I could just use the boxes around the house. He decided he wanted to be a cool robot, and cool meant a Mech. I researched the robot, drew-up a plan in Photoshop, and built the costume using only cardboard boxes, packing tape, and glue. I did have to purchase spray paint, but only a few cans.'
);
function showImageNavigation($images) {
for($i=0; $i<count($images); $i++) {
echo '<a href="'. $_SERVER['PHP_SELF'] .'?image='. $i .'">'. ($i+1) .'</a> ';
}
} /* end of showImageNavigation function */
/*function to show the desired image if query is found*/
function showImage($images) {
$num = $_GET['image'];
$im = 'HomeProjects/'. $images[$num];
echo '<img src="'. $im .'" '. $imString[3] . ' />';
}
function showInformation($info) {
$num = $_GET['image'];
echo $info[$num];
}
function showDefaultImage($images) {
$im = 'HomeProjects/'. $images[0];
$imString = getimagesize($im);
echo '<img src="'. $im .'" '. $imString[3] . ' />';
}
/* ......... this goes at in the html document before everything ........... */
<!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" />
<meta name="generator" content="Adobe GoLive" />
<title>Jennifer Lynn Mattingly Guthrie</title><style type="text/css">
.menutitle{
cursor:pointer;
margin-bottom: 5px;
background-color:#ECECFF;
color:##000000;
width:170px;
padding:2px;
text-align:left;
font-weight:bold;
font color="#9e6af8";
/*/*/border:0px solid #000000;/* */
}
.submenu{
margin-bottom: 0.5em;
}
</style>
<script type="text/javascript">
/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
if(el.style.display != "block"){ //DynamicDrive.com change
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu") //DynamicDrive.com change
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}
function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display ="block"
}
}
function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}
if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction
if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate
</script>
</head>
<body>
<table width="850" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="170"><img src="QuiteGraphicLogo40.jpg" alt="" height="201" width="170" border="0" /></td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="201">
<tr>
<td width="5%"></td>
<td></td>
<td width="7%"></td>
</tr>
<tr valign="bottom">
<td width="5%"></td>
<td><font size="6" color="#9e6af8">Home Projects </font></td>
<td width="7%"></td>
</tr>
<tr>
<td width="5%"></td>
<td valign="top">
<div align="left">
<font size="5" color="#9e6af8">Halloween Costumes </font></div>
</td>
<td width="7%"></td>
</tr>
<tr height="35%">
<td width="5%" height="35%"></td>
<td valign="top" height="35%"><?php if(isset($_GET['image'])) showInformation($info); else echo $info[0]; ?></td>
<td width="7%" height="35%"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" width="170"><!-- Keep all menus within masterdiv-->
<div id="masterdiv">
<div class="menutitle" onclick="SwitchMenu('sub1')">
<font color="#9e6af8"><a href="../Resume/ResumeObjEduEmp.html"><font color="#9e6af8">Resume</font></a></font></div>
<span class="submenu" id="sub1"><font color="#9e6af8">- <a href="../Resume/DesignedResume2007.pdf"><font color="#9e6af8">Download PDF</font></a></span>
<div class="menutitle" onclick="SwitchMenu('sub2')">
<font color="#9e6af8">Graphic Design Portfolio</font></div>
<span class="submenu" id="sub2">
<font color="#9e6af8">- <a href="../GraphicDesign/FlyerSnowWriter.html"><font color="#9e6af8">Flyers</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/ProductPackagingLiquidBeadz.html"><font color="#9e6af8">Product Packaging</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/ProductDesignCards.html"><font color="#9e6af8">Product Design</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/ProductLabelWood.html"><font color="#9e6af8">Product Labels</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/CatalogFMI2003.html"><font color="#9e6af8">Catalog Design</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/POPSnowHeader.html"><font color="#9e6af8">P.O.P Aids</font></a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/MagazineJansen.html"><font color="#9e6af8">Magazine Layout</a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/PresentationFMI.html"><font color="#9e6af8">Presentation Design</a><br>
<font color="#9e6af8">- <a href="../GraphicDesign/PhotogaphyVases.html"><font color="#9e6af8">Photography</a><br>
</span>
<div class="menutitle" onclick="SwitchMenu('sub3')">
<font color="#9e6af8">Fine Art Portfolio</font></div>
<span class="submenu" id="sub3">
<font color="#9e6af8">- <a href="../FineArt/DrawingChalkSelf.html"><font color="#9e6af8">Drawing</font></a><br>
<font color="#9e6af8">- <a href="../FineArtsPaintingPage.html"><font color="#9e6af8">Painting</font></a><br>
<font color="#9e6af8">- <a href="../FineArt/SculptureFlower.html"><font color="#9e6af8">Sculpture</font></a><br>
<font color="#9e6af8">- <a href="../FineArt/PhotographyGlasses.html"><font color="#9e6af8">Photography</font></a>
</span>
<div class="menutitle" onclick="SwitchMenu('sub4')">
<a href="../GraphicDesign/VideoOverview.html"><font color="#9e6af8">Videos</font></div>
<div class="menutitle" onclick="SwitchMenu('sub5')">
<a href="../AboutMe/BioPage.html"><font color="#9e6af8">About the Artist</font></div>
<div class="menutitle" onclick="SwitchMenu('sub6')">
<a href="../Contact/ContactPage.html"><font color="#9e6af8">Contact Information</font></div>
<div class="menutitle" onclick="SwitchMenu('sub7')">
<font color="#9e6af8">Home Projects</font></div>
<span class="submenu" id="sub7">
<font color="#9e6af8">- <a href="Halloween.php"><font color="#9e6af8">Halloween Costumes</font></a><br>
<font color="#9e6af8">- <a href="HomeImprovement.php"><font color="#9e6af8">Home Improvements</font></a>
</span>
<div class="menutitle" onclick="SwitchMenu('sub8')">
<a href="<A href="http://quitegraphic.com/index.html"><font">http://quitegraphic.com/index.html"><font color="#9e6af8">Home</font></div>
</div></td>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr height="5">
<td width="60" height="5"></td>
<td height="5"></td>
<td width="25%" height="5"></td>
</tr>
<tr>
<td align="left" valign="top" width="60"><?php showImageNavigation($images); ?></td>
<td align="center" valign="middle"><?php if(isset($_GET['image'])) showImage($images); else showDefaultImage($images); ?></td>
<td width="25%"></td>
</tr>
<tr>
<td align="right" valign="top" width="60"></td>
<td></td>
<td align="left" valign="top" width="25%"></td>
</tr>
</table>
</td>
</tr>
</table>
<p></p>
</body>
</html>