Help - Search - Members - Calendar
Full Version: Help With Php!
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
GamesFan
My website's link is: http://www.somethinghere.com/ngwf/index.php
Here's my index code:

CODE
<HTML>
<HEAD>
<TITLE>New Glory Wrestling</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: xx-small;
}
-->
</style>
<style type="text/css">
<!--
body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: xx-small;
}
a:link {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: xx-small;
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    text-decoration: none;
    color: #FFFFFF;
}
a:hover {
    font-weight: bold;
    color: #8ED045;
}
.over {background-image: url(images/rolloverbg.gif);; cursor: crosshair }
.out { }
}
input {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: xx-small;
    font-weight: bold;
    color: #FFFFFF;
    background-color: #5B5B5B;
    border: 1px solid #000000;
}

-->
</style>
</HEAD>
<BODY BGCOLOR=#404040 LEFTMARGIN=0 TOPMARGIN=3 MARGINWIDTH=0 MARGINHEIGHT=0 text="#FFFFFF">
<table width="75" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><TABLE WIDTH=750 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
        <TR>
          <TD ROWSPAN=3> <IMG SRC="http://www.powerslamwrestling.com/ngwf/images/header001.jpg" ALT="" WIDTH=750 HEIGHT=150 border="0"></TD>
        </TR>
      </TABLE></td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr><marquee><font size="2"><b>NGW News:</b> Our website is temporarily under construction.</font></marquee>
          <td width="17%" valign="top"><table width="100" border="0" cellspacing="0" cellpadding="3">
              <tr>
                <td><table width="140" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td background="images/sideboxtop1.gif" width="140" height="17"><div align="center"><font color="#FFFFFF" size="1"><strong>Main
                          Navigation </strong></font></div></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxtop2.gif" width="140" height="11"></td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                          <tr>
                            <td><table width="100%" border="0" cellspacing="1" cellpadding="1">
  <tr>
                                  <td bgcolor="#6F6F6F"><div align="center"><font size="1"><strong>::[
                                      Main ]::</strong></font></div></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="index.php?">Home</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="about.htm">About</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Rules
                                </a></font></td>
                                </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">F.A.Q</a></font></td>
                                </tr>
                            <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Forum
                                </a></font></td>
                                </tr>
<td bgcolor="#6F6F6F"><div align="center"><font size="1"><strong>::[ Information ]::</strong></font></div></td>  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Roster</a></font></td>
  </tr>
  <tr>
                                       <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Staff</a></font><td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Champions</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Title History</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Calendar</a></font></td>
  </tr>
  <tr>
    
<td bgcolor="#6F6F6F"><div align="center"><font size="1"><strong>::[ Program Info
                                      ]::</strong></font></div></td>   </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Onslaught Card</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Onslaught Results</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Pay-Per-View Card</a></font></td>
  </tr>
  <tr>
  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Pay-Per-View Results</a></font></td>
  </tr>
  <tr>
</table>
</td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxbottom.gif" width="140" height="29"></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td><table width="140" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td background="images/sideboxtop1.gif" width="140" height="17"><div align="center"><font color="#FFFFFF" size="1"><strong>Affiliates</strong></font></div></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxtop2.gif" width="140" height="11"></td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                          <tr>
                            <td><table width="100%" border="0" cellpadding="3" cellspacing="0">
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.powerslamwrestling.com"><img border="0" alt="PowerSlam Wrestling.com" src="http://www.powerslamwrestling.com/images/links/PSW.jpg" width="88" height="31"></a></font></div></td>
                                </tr>
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="#"><img src="images/ysh.gif" alt="your site here?" width="88" height="31" border="0"></a></font></div></td>
                                </tr>
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="#"><img border="0" alt="your site here?" src="images/ysh.gif" width="88" height="31"></a></font></div></td>
                                </tr>
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="#"><img border="0" alt="your site here?" src="images/ysh.gif" width="88" height="31"></a></font></div></td>
                                </tr>
                              </table></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxbottom.gif" width="140" height="29"></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td><table width="140" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td background="images/sideboxtop1.gif" width="140" height="17"><div align="center"><font color="#FFFFFF" size="1"><strong>Link
                          Me </strong></font></div></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxtop2.gif" width="140" height="11"></td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                          <tr>
                            <td><table width="100%" border="0" cellpadding="7" cellspacing="0">
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="#"><img src="images/ysh.gif" alt="your site here?" width="88" height="31" border="0"></a></font></div></td>
                                </tr>
                              </table></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxbottom.gif" width="140" height="29"></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
          <td width="63%" valign="top"><img src="images/spacer.gif" height="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="3%"><img src="images/leftmaincontent.gif" width="21" height="17"></td>
                      <td width="93%"height="17" background="images/middlemaincontent.gif"><center>
                          <font size="1"><strong>Main Content</strong></font>
                        </center></td>
                      <td width="4%"><img src="images/rightmaincontent.gif" width="20" height="17"></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="2%"><img src="images/leftmaincontent2.gif" width="12" height="12"></td>
                      <td width="96%" height="12" background="images/middlemaincontent2.gif"></td>
                      <td width="2%"><img src="images/rightmaincontent2.gif" width="12" height="12"></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td><table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" style="border-collapse: collapse">
                    <tr>
                      <td><table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td><?PHP switch ($module){CASE "home":include "docs/home.htm";
break;
CASE "Home":include "http://www.powerslamwrestling.com/ngwf/index.php";
break;
CASE "About":include "http://www.powerslamwrestling.com/ngwf/about.htm";
break;
CASE "Page 3":include "docs/nextpage3.htm";
break;
default :include "docs/home.htm";
break;
}
?>
                            

                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr></div>
              <tr>
                <td><img src="images/cr.gif" width="458" height="29" border="0" usemap="#Map2"></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          <td width="20%"><table width="100" border="0" align="right" cellpadding="3" cellspacing="0">
              <tr>
                <td valign="top"><div id="shoutbox" class="switchcontent">
                    <table width="140" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td background="images/sideboxtop1.gif" width="140" height="17"><div align="center"><font color="#FFFFFF" size="1"><strong>Main Navigation</strong></font></div></td>
                      </tr>
                      <tr>
                        <td><img src="images/sideboxtop2.gif" width="140" height="11"></td>
                      </tr>
                      <tr>
                        <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                            <tr>
                              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    
                  
                            <td><table width="100%" border="0" cellspacing="1" cellpadding="1">
  <tr>
                                  <td bgcolor="#6F6F6F"><div align="center"><font size="1"><strong>::[
                                      Archives ]::</strong></font></div></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">House Shows</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Onslaught
                                   </a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Special Shows
                                </a></font></td>
                                </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Pay-Per-View</a></font></td>
                                </tr>
                                <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Program Themes</a></font></td>
                                </tr>
                                <td bgcolor="#6F6F6F"><div align="center"><font size="1"><strong>::[ Other
                                      ]::</strong></font></div></td>   </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Banners</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Affiliates</a></font></td>
  </tr>
  <tr>
                              <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Top Sites</a></font></td>
  </tr>
  <tr>
                                
                            
<td bgcolor="#6F6F6F"><div align="center"><font size="1"><strong>::[ Help ]::</strong></font></div></td>  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">What's An E-Fed?</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Roleplay Guide</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Roleplay Tips</a></font></td>
  </tr>
  <tr>
                                  <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Becoming A Face</a></font></td>
  </tr>
  <tr>
                                 <td bgcolor="#5b5b5b" onMouseOver="this.className='over'" onMouseOut="this.className='out'"><font size="1"><img src="images/bulletarrow.gif" width="11" height="5"><a href="#">Becoming A Heel</a></font></td>
  </tr>
  <tr>

</table>
</td>
              
                                
                                  </tr>
                                </table></td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr>
                        <td><img src="images/sideboxbottom.gif" width="140" height="29"></td>
                      </tr>
                    </table>
                  </div></td>
              </tr>
  
                    
         <tr>
                <td><table width="140" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td background="images/sideboxtop1.gif" width="140" height="17"><div align="center"><font color="#FFFFFF" size="1"><strong>Affiliates</strong></font></div></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxtop2.gif" width="140" height="11"></td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                          <tr>
                            <td><table width="100%" border="0" cellpadding="3" cellspacing="0">
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.powerslamwrestling.com"><img border="0" alt="PowerSlam Wrestling.com" src="http://www.powerslamwrestling.com/images/links/PSW.jpg" width="88" height="31"></a></font></div></td>
                                </tr>
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="#"><img src="images/ysh.gif" alt="your site here?" width="88" height="31" border="0"></a></font></div></td>
                                </tr>
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="#"><img border="0" alt="your site here?" src="images/ysh.gif" width="88" height="31"></a></font></div></td>
                                </tr>
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="#"><img border="0" alt="your site here?" src="images/ysh.gif" width="88" height="31"></a></font></div></td>
                                </tr>
                              </table></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxbottom.gif" width="140" height="29"></td>
                    </tr>
                  </table></td>
              </tr>
             <tr>
                <td><table width="140" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td background="images/sideboxtop1.gif" width="140" height="17"><div align="center"><font color="#FFFFFF" size="1"><strong>Link
                          Me </strong></font></div></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxtop2.gif" width="140" height="11"></td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                          <tr>
                            <td><table width="100%" border="0" cellpadding="7" cellspacing="0">
                                <tr>
                                  <td><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="#"><img src="images/ysh.gif" alt="your site here?" width="88" height="31" border="0"></a></font></div></td>
                                </tr>
                              </table></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td><img src="images/sideboxbottom.gif" width="140" height="29"></td>
                    </tr>
                  </table></td>

</BODY>
</HTML>


I am trying to set up php so that when people view my page and they click on a link down the navigation menu.. it doesn't reload the ENTIRE page just the middle content area. Can someone help me figure this out?
Jetteh22
I've never used the switch before.

Try putting the top half of your document (including the menu) in a file called header.php and the bottom half called footer.php

and then in index.php have this code

CODE
<?php
include 'header.php';
?>
ALL MAIN CONTENT GOES HERE

<?php include 'footer.php'; ?>


And go back into the header.php andfor the menu just do <a href="index.php">Home</a> | <a href="about.php">About Us</a>

and it will automatically load the header and the footer onto both pages.

This makes it nice because if you ever change the layout, ect you'll only have to change two files (instead of every page)
Eldorik
If you want just the middle content to change, you can use frames.

I'll post an example in a few minutes.
NDBoost
Just use switch();

IE:
CODE
<?php
SWITCH($_GET['n']){
case 'pics':
include pics.php;
break;
default:
include def.php;
break;
}
?>

IE: all your CSS styling and main page styling will take place on index.php and you will paste that switch(); where you want the content to change when they clink the link. Then all your header/footer/everything else will not change. To link to the switch it would be yoursite.com/index.php?n=pics
IM me on AIM or MSN and i can help you out alot more.

AIM: thirdgensup
msn: m.devita@gmail.com
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.