Jump to content

Looping issue in Display


Leviatasvf

Recommended Posts

Hello, I am having an issue with one or more of my pages for a site.

 

This site is being worked on by myself and a friend, now, he is doing the coding, which I am a little better at then he, but never-the-less. I have run across a coding issue that needs fixing. Now, this site is designed to load each page, within the index.php page, using includes. All of the files work fine, save for the "Cars for Sale" page include. When this is clicked from the index.php page, cars for sale, loops the header all the way down the page.

 

I have loaded both index.php and cars.php into dreamweaver, and it does not display like this, so I am a bit lost. If you dont mind going to:

 

http://www.foytt.com

 

and clicking on "Cars for Sale" can you please let me in on some ideas of where to look for this problem. I have other things I need to do with this site, and I am running out of time, and I am stumped. If you should need the code for the pages, it is listed below:

 

index.php

 

<?php $page = $_GET['page']; ?>

 

    <style type="text/css">

<!--

.style19 {font-size: 10pt;

font-weight: bold;

color: #FFFFFF;

}

.style12 { font-size: 6pt;

color: #FFFFFF;

}

.style14 {color: #FFFFFF}

-->

        </style>

        <script type="text/JavaScript">

<!--

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}

}

 

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;

}

 

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

  if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

<title>Foytt.com</title>

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

</head>

 

<body bgcolor="#ffffff" background="images/homepage-images/background.jpg" link="#fff1c5" vlink="#fff1c5" alink="#fff1c5" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('Images/home2.gif','Images/ins2.gif','Images/book2.gif','Images/contact2.gif','Images/book.gif','Images/cars2.gif')">

<div align="center">

  <table width="959" border="0">

              <tr>

                <TD width="15"

    background="dirimages//l-fade.gif"><IMG

      src="dirimages//l-fade.gif"

      width=15></TD>

                <td width="915"><table width="915" border="0" cellspacing="0" cellpadding="0" bgcolor="#fff6ea">

                  <tr height="159">

                    <td width="269" height="159"><img src="Images/logo.jpg" alt="Foytt.com" width="269" height="200"></td>

                    <td width="698"><script type="text/javascript">

AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','646','height','200','src','Images/main','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','Images/main' ); //end AC code

</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="646" height="200">

                      <param name="movie" value="Images/main.swf">

                      <param name="quality" value="high">

                      <embed src="Images/main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="646" height="200"></embed>

                    </object></noscript></td>

                  </tr>

                  <tr>

                    <td colspan="2"><a href="http://www.foytt.com/index.php?page=home" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','Images/home2.gif',1)"><img src="Images/home.gif" name="Image11" width="144" height="34" border="0"></a><a href="http://www.foytt.com/index.php?page=home" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','Images/home2.gif',1)"></a><a href="http://www.foytt.com/index.php?page=inspect" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','Images/ins2.gif',1)"><img src="Images/ins.gif" name="Image12" width="215" height="34" border="0"></a><a href="http://www.foytt.com/index.php?page=cars" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','Images/cars2.gif',1)"><img src="Images/cars.gif" name="Image14" width="250" height="34" border="0"></a><a href="http://www.foytt.com/index.php?page=inspect" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','Images/ins2.gif',1)"></a><a href="http://www.foytt.com/index.php?page=book" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','Images/book2.gif',1)"><img src="Images/book.gif" name="Image13" width="203" height="34" border="0"></a><a href="http://www.foytt.com/index.php?page=book" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','Images/book.gif',1)"></a><a href="http://www.foytt.com/index.php?page=book" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','Images/book2.gif',1)"></a><a href="http://www.foytt.com/index.php?page=contact" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','Images/contact2.gif',1)"><img src="Images/contact.gif" name="Image10" width="154" height="34" border="0"></a><a href="http://www.foytt.com/index.php?page=home" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Index','','Images/home2.gif',1)"></a></td>

                  </tr>

                  <tr>

                    <td colspan="2"

    background="images//bar.gif"><IMG

      src="images//bar.gif"

      width=15></TD>

                  </tr>

                  <tr>

                    <td colspan="2"><?php

if($page == ""){$page = "home";}

if($page == "home"){include "home.php";}

else if($page == "services"){include "services.php";}

else if($page == "inspect"){include "inspect.php";}

else if($page == "book"){include "book.php";}

else if($page == "contact"){include "contact.php";}

else if($page == "cars"){include "cars.php";}

?></td>

                  </tr>

                  <tr>

                    <td colspan="2" bgcolor="#0D0D46"><div align="center">

                        <table width="760" border="0" cellspacing="4" cellpadding="0">

                          <tr>

                            <td colspan="7" align="center" valign="middle"><p class="link"><span class="style19"> PO Box 1406. Hermosa Beach, CA. 90254  . Phone: 310-683-9141 . Fax: 424-206-1197</span></p></td>

                          </tr>

                          <tr>

                            <td width="126" align="center" valign="middle"><font

            face="Arial, Helvetica, sans-serif"><span class="style12"><a href="index.php"><img src="dirimages/sh.gif" alt="2" name="Home" width="40" height="20" border="0" id="Home"></a><a href="contact.php"><img src="dirimages/sc.gif" alt="1" name="ContactUs" width="40" height="20" border="0" id="ContactUs"></a></span><a href="sitemap.xml"><img src="dirimages/sm.gif" alt="3" name="SiteMap" width="40" height="20" border="0" id="SiteMap"></a></font></td>

                            <td width="338" align="center" valign="middle"><span class="style14">

                              </span>

                            <div align="center"><span class="style14"><font

            face="Arial, Helvetica, sans-serif">© 2008 WWW.FOYTT.COM </font></span></div>

                            <span class="style14"></span></td>

                            <td width="11" align="center" valign="middle"> </td>

                            <td width="35" align="center" valign="middle"><a href="http://www.titanship.eu"></a></td>

                            <td width="47" align="center" valign="middle"><a href="http://www.titanship.eu"></a></td>

                            <td width="45" align="center" valign="middle"><a href="http://www.titanship.eu"></a></td>

                            <td width="126" align="center" valign="middle"><span class="style14">

                              <div align="right"><a href="http://tracking.titanship.com"></a></div>

                            </span></td>

                          </tr>

                        </table>

                    </div></td>

                  </tr>

                </table></td>

                <TD width="10"

    background="dirimages//r-fade.gif"><IMG

      src="dirimages//r-fade.gif"

      width=15></td>

              </tr>

      </table>

</div>

</body>

 

</html>

 

---cars.php---

 

<?php $page = $_GET['page']; ?>

 

    <style type="text/css">

<!--

.style19 {font-size: 10pt;

font-weight: bold;

color: #FFFFFF;

}

.style12 { font-size: 6pt;

color: #FFFFFF;

}

.style14 {color: #FFFFFF}

.style10 {color: #000000}

.style16 {font-size: 8.5pt}

.style17 {color: #000000; font-size: 8.5pt; }

-->

        </style>

        <script type="text/JavaScript">

<!--

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}

}

 

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;

}

 

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

  if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

<title>Foytt.com</title>

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

</head>

 

<body bgcolor="#ffffff" background="images/homepage-images/background.jpg" link="#fff1c5" vlink="#fff1c5" alink="#fff1c5" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('Images/home2.gif','Images/ins2.gif','Images/book2.gif','Images/book.gif')">

<div align="center">

  <table width="959" border="0">

              <tr>

                <TD width="15"

    background="dirimages//l-fade.gif"><IMG

      src="dirimages//l-fade.gif"

      width=15></TD>

                <td width="915"><table width="915" border="0" cellspacing="0" cellpadding="0" bgcolor="#fff6ea">

                  <tr height="159">

                    <td width="269" height="159"><img src="Images/logo.jpg" alt="Foytt.com" width="269" height="200"></td>

                    <td width="698"><script type="text/javascript">

AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','646','height','200','src','Images/main','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','Images/main' ); //end AC code

</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="646" height="200">

                      <param name="movie" value="Images/main.swf">

                      <param name="quality" value="high">

                      <embed src="Images/main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="646" height="200"></embed>

                    </object></noscript></td>

                  </tr>

                  <tr>

                    <td colspan="2"><a href="index.html"><img src="Images/home.gif" name="Image11" width="137" height="34" border="0"></a><a href="http://www.foytt.com/index.php?page=home" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','Images/home2.gif',1)"></a><a href="inspect.php"><img src="Images/ins.gif" name="Image12" width="191" height="34" border="0"></a><a href="cars.php"><img src="Images/cars.gif" name="Image14" width="227" height="34" border="0"></a><a href="http://www.foytt.com/index.php?page=inspect" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','Images/ins2.gif',1)"></a><a href="book.php"><img src="Images/book.gif" name="Image13" width="203" height="34" border="0"></a><a href="http://www.foytt.com/index.php?page=book" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','Images/book.gif',1)"></a><a href="http://www.foytt.com/index.php?page=book" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','Images/book2.gif',1)"></a><a href="contact.php"><img src="Images/contact.gif" name="Image10" width="154" height="34" border="0"></a><a href="http://www.foytt.com/index.php?page=home" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Index','','Images/home2.gif',1)"></a></td>

                  </tr>

                  <tr>

                    <td colspan="2"

    background="images//bar.gif"><IMG

      src="images//bar.gif"

      width=15></TD>

                  </tr>

                  <tr>

                    <td colspan="2"><?php

if($page == ""){$page = "home";}

if($page == "home"){include "home.php";}

else if($page == "services"){include "services.php";}

else if($page == "inspect"){include "inspect.php";}

else if($page == "book"){include "book.php";}

else if($page == "contact"){include "contact.php";}

else if($page == "cars"){include "cars.php";}

?>

                      <TABLE cellSpacing=0 cellPadding=0 width=899 border=0>

                        <TBODY>

                          <TR>

                            <TD width=143 rowspan="2" vAlign=top bgColor=#ffffff></center>

                                <img src="dirimages/blue_space.gif" alt="4" width="128" height="6">

                                <P></P></TD>

                            <TD width="544" height="22" rowspan="2" vAlign=top bgColor=#ffffff><p class="bottomNav"> </p></TD>

                            <TD width=212 vAlign=top bgColor=#ffffff><table width="187" border="0" align="right" cellpadding="2" cellspacing="0">

                                <form method="post" action="http://fp1.formmail.com/cgi-bin/fm192">

                                  <input type="hidden" name="_pid" value="101911" />

                                  <input type="hidden" name="_fid" value="EC4WX36B" />

                                  <input type="hidden" name="recipient" value="1" />

                                  <input type="hidden" name="required" value="name2,phone2,email2">

                                  <tr>

                                    <td height="4" colspan="3" bgcolor="#FFFFFF"><p align="center">FREE QUOTE </p></td>

                                  </tr>

                                  <tr>

                                    <td height="5" bgcolor="#FFFFFF"> </td>

                                    <td height="5" bgcolor="#FFFFFF"> </td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td height="10" rowspan="2" bgcolor="#FFFFFF"> </td>

                                    <td height="5" bgcolor="#FFFFFF"><span class="style16">Select Service:</span> </td>

                                    <td height="10" rowspan="2" bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td height="5" bgcolor="#FFFFFF"><select id="select" name="select">

                                        <option value="default"

              selected="selected">Shipment Type:</option>

                                        <option

              value="Automobile">Automobile</option>

                                        <option

              value="Truck">Truck</option>

                                        <option value="Van - Passenger">Van - Passenger</option>

                                        <option value="Van - Utility">Van - Utility</option>

                                        <option value="Motorcycle">Motorcycle</option>

                                        <option value="Multiple Vehicles">Multiple Vehicles</option>

                                        <option value="Vehicle Parts only">Vehicle Parts only</option>

                                        <option value="Boat">Boat</option>

                                        <option value="Boxes Only">Boxes Only</option>

                                        <option value="Commercial Cargo">Commercial Cargo</option>

                                    </select></td>

                                  </tr>

                                  <tr>

                                    <td height="19" bgcolor="#FFFFFF"> </td>

                                    <td height="19" bgcolor="#FFFFFF"><span class="style17">Vehicle Make: </span></td>

                                    <td height="19" bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td bgcolor="#FFFFFF"> </td>

                                    <td bgcolor="#FFFFFF"><span class="frmFlds style10">

                                      <input id="City-From2" maxlength="50" size="23" name="select2" />

                                    </span></td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td rowspan="2" bgcolor="#FFFFFF"> </td>

                                    <td bgcolor="#FFFFFF"><span class="style17">Shipping From: </span></td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td bgcolor="#FFFFFF"><span class="style10">

                                      <input id="City-From" maxlength="50" size="10" name="City-From2" />

                                      <span class="style16"><em> City, State</em></span></span></td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td rowspan="2" bgcolor="#FFFFFF"> </td>

                                    <td bgcolor="#FFFFFF"><span class="style17">Destination</span></td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td bgcolor="#FFFFFF"><span class="style10">

                                      <input id="Country-To" maxlength="50" size="10" name="Country-To2" />

                                      <span class="style16"><em>Country</em></span></span></td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td rowspan="2" bgcolor="#FFFFFF"> </td>

                                    <td bgcolor="#FFFFFF"><span class="style17">Name:*</span></td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td bgcolor="#FFFFFF"><input name="name2" id="name" size="23" maxlength="50" /></td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td rowspan="2" bgcolor="#FFFFFF"> </td>

                                    <td bgcolor="#FFFFFF"><span class="bodyHomeTD style10 style16">Telephone Number:* </span></td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td bgcolor="#FFFFFF"><input name="phone2" id="phone" size="23" maxlength="50" /></td>

                                    <td bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td width="2" rowspan="4" bgcolor="#FFFFFF"> </td>

                                    <td width="161" bgcolor="#FFFFFF"><span class="style17">Email:* </span></td>

                                    <td width="12" bgcolor="#CFFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td bgcolor="#FFFFFF"><input name="email2" id="email" size="23" maxlength="50" /></td>

                                    <td rowspan="3" bgcolor="#FFFFFF"> </td>

                                  </tr>

                                  <tr>

                                    <td bgcolor="#FFFFFF"><span class="style16">Comments:</span></td>

                                  </tr>

                                  <tr>

                                    <td bgcolor="#FFFFFF"><label>

                                      <textarea name="comments" id="comments"></textarea>

                                    </label></td>

                                  </tr>

                                  <tr>

                                    <td align="right" bgcolor="#FFFFFF"> </td>

                                    <td align="right" bgcolor="#FFFFFF"><div align="center">

                                        <input name="submit" type="submit" value="Quote" />

                                    </div></td>

                                    <td align="right" bgcolor="#FFFFFF"> </td>

                                  </tr>

                                </form>

                            </table>

                                <!-- MANUFACTURERES MENU -->

                                <!-- END MANUFACTURERES MENU --></TD>

                          </TR>

                          <TR>

                            <TD vAlign=top bgColor=#ffffff><div align="right"></a></div></TD>

                          </TR>

                        </TBODY>

                      </TABLE></td>

                  </tr>

                  <tr>

                    <td colspan="2" bgcolor="#0D0D46"><div align="center">

                        <table width="760" border="0" cellspacing="4" cellpadding="0">

                          <tr>

                            <td colspan="7" align="center" valign="middle"><p class="link"><span class="style19"> PO Box 1406. Hermosa Beach, CA. 90254  . Phone: 310-683-9141 . Fax: 424-206-1197</span></p></td>

                          </tr>

                          <tr>

                            <td width="126" align="center" valign="middle"><font

            face="Arial, Helvetica, sans-serif"><span class="style12"><a href="index.php"><img src="dirimages/sh.gif" alt="2" name="Home" width="40" height="20" border="0" id="Home"></a><a href="contact.php"><img src="dirimages/sc.gif" alt="1" name="ContactUs" width="40" height="20" border="0" id="ContactUs"></a></span><a href="sitemap.xml"><img src="dirimages/sm.gif" alt="3" name="SiteMap" width="40" height="20" border="0" id="SiteMap"></a></font></td>

                            <td width="338" align="center" valign="middle"><span class="style14">

                              </span>

                            <div align="center"><span class="style14"><font

            face="Arial, Helvetica, sans-serif">© 2008 WWW.FOYTT.COM </font></span></div>

                            <span class="style14"></span></td>

                            <td width="11" align="center" valign="middle"> </td>

                            <td width="35" align="center" valign="middle"><a href="http://www.titanship.eu"></a></td>

                            <td width="47" align="center" valign="middle"><a href="http://www.titanship.eu"></a></td>

                            <td width="45" align="center" valign="middle"><a href="http://www.titanship.eu"></a></td>

                            <td width="126" align="center" valign="middle"><span class="style14">

                              <div align="right"><a href="http://tracking.titanship.com"></a></div>

                            </span></td>

                          </tr>

                        </table>

                    </div></td>

                  </tr>

                </table></td>

                <TD width="10"

    background="dirimages//r-fade.gif"><IMG

      src="dirimages//r-fade.gif"

      width=15></td>

              </tr>

      </table>

</div>

</body>

 

</html>

Link to comment
https://forums.phpfreaks.com/topic/123168-looping-issue-in-display/
Share on other sites

Well if thats the page code then your first problem is the fact that your programming 2 pages in the same page. Secondly your in the php help, your issue seems to be more on the end of javascript rather then php. Thirdly your code, no offence but it is pretty sloppy, I suggest if your going to be doing scripts in your website to not use editors such as dreamweaver/front page ect. they make the code all messy, thirdly by what it seems that your trying to get accomplished, well shouldn't need that much code anyway. you should be able to do a simple for () or do, do while loop instead of all that. Pardon me but I did not look at the most of the javascript to sloppy for me to try and diagnose.

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.