Help with php

DJ Stephen

Fully Optimized
Messages
3,275
Hi can anyone find anything wrong with this code, becuase everything is coming out more than once here:http://www.srcomputers.info/X6 Core [V1.1]/index.php

i need to stop it and the page is php.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
<!--
a:link {
	color: 3E7B0B;
	text-decoration: none;
}
a:visited {
	color: 3E7B0B;
	text-decoration: none;
}
a:hover {
	font-weight: bold;
	color: 3E7B0B;
	text-decoration: underline;
}
-->
</style>
<title>X6 Core Reloaded [V1.1]</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
</body>
<!-- DO NOT DELETE THE MARGIN TAGS, THESE STOP WHITE GAPS ON ALL EDGES OF THE PAGE -->



<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <!-- START OF GREEN HEADER -->
	<td background="images/headerbg.gif" height="112"><img src="images/logo.gif" width="379" height="113"></td>
	<td background="images/headerbg.gif" height="112">  </td>
  </tr>
  <!-- END OF GREEN HEADER -->
 <!-- START OF GREY HEADER BAR -->
  <tr>
    <td colspan="2" background="images/headerbar.gif" height="32"></td>
  </tr>
  <!-- END OF GREY HEADER BAR -->
   <!-- START OF MAIN CONTENT AREA -->
   <tr>
    <td colspan="2"> <table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" width="220" <!-- START OF NAVIGATION --><table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="4%"><img src="images/lborder.gif" width="34" height="24"></td>
                <td width="90%" background="images/bgborder.gif"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Navigation</font></div></td>
                <td width="6%"><img src="images/rborder.gif" width="2" height="24"></td>
              </tr>
              <tr>
                <td colspan="3"><table width="191" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                    <tr>
                      <td> 
                        <!-- START OF CONTENT BOX CONTENT -->
                        <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td height="15" bgcolor="#EBEBEB"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>·</strong> 
                              <a href="#">Home</a></font></td>
                          </tr>
                          <tr> 
                            <td height="15"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>·</strong> 
                              <a href="#">News Archive</a></font></td>
                          </tr>
                           <tr> 
                            <td height="15" bgcolor="#EBEBEB"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>·</strong> 
                              <a href="#">Downloads</a></font></td>
                          </tr>
                          <tr> 
                            <td height="15"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>·</strong> 
                              <a href="#">Affiliates</a></font></td>
                          </tr>
                          <tr> 
                            <td height="15" bgcolor="#EBEBEB"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>·</strong> 
                              <a href="#">Contact Me</a></font></td>
                          </tr>
                        </table> 
                        <!-- END OF CONTENT BOX CONTENT -->
                      </td>
                    </tr>
                  </table></td>
              </tr>
            </table><!-- END OF NAVIGATION -->
			<br>
			<!-- START OF NAVIGATION --><table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="4%"><img src="images/lborder.gif" width="34" height="24"></td>
                <td width="90%" background="images/bgborder.gif"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Stats</font></div></td>
                <td width="6%"><img src="images/rborder.gif" width="2" height="24"></td>
              </tr>
              <tr>
                <td colspan="3"><table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                    <tr>
                      <td> 
                        <!-- START OF CONTENT BOX CONTENT -->
						<center>
                        <font size="1" face="Verdana, Arial, Helvetica, sans-serif">
						</font> 
						</center>
                        <!-- END OF CONTENT BOX CONTENT -->
                      </td>
                    </tr>
                  </table></td>
              </tr>
            </table><!-- END OF NAVIGATION -->
			<br>
			<!-- START OF NAVIGATION --><table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="4%"><img src="images/lborder.gif" width="34" height="24"></td>
                <td width="90%" background="images/bgborder.gif"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Monthly Poll</font></div></td>
                <td width="6%"><img src="images/rborder.gif" width="2" height="24"></td>
              </tr>
              <tr>
                <td colspan="3"><table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                    <tr>
                      <td> 
                        <!-- START OF CONTENT BOX CONTENT -->
						<table>
                          <tr> 
                            <td height="15"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>·</strong> 
                              <a href="#">Photoshop Tutorials</a></font></td>
                          </tr>
						  <tr> 
                            <td height="15"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>·</strong> 
                              <a href="#">HTML Tutorials</a></font></td>
                          </tr>
						  <tr> 
                            <td height="15"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>·</strong> 
                              <a href="#">Windows Tutorials</a></font></td>
                          </tr>
						  </table>
                        <!-- END OF CONTENT BOX CONTENT -->
                      </td>
                    </tr>
                  </table></td>
              </tr>
			 
            </table><!-- END OF NAVIGATION --></td>
    <td width="100%" valign="top">  <!--MAIN CENTER CONTENT AREA START-->
            <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td><img src="images/lborder.gif" width="34" height="24"></td>
                <td width="100%" background="images/bgborder.gif"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Latest News</font></div></td>
                <td><img src="images/rborder.gif" width="2" height="24"></td>
              </tr>
              <tr> 
                <td colspan="3"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                    <tr> 
                      <td> <div align="center"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
					  <?php

switch($_GET['id']) {

case "Home/News":
include('index.php');
break;

case "News Archive":
include('oldnews.php');
break;

case "Downloads":
include('downloads.php');
break;

case "Affiliates":
include('afil.php');
break;

case "contact":
include('contact.php');
break;

case "Sigtut1":
include('tutorial1.php');
break;

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


}

?>
</font> 
                        </div></td>
                    </tr>
                    <tr>
                      <td bgcolor="#E8E8E8"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Copyright 
                          2006 - X6 Core.com - All Rights Reserved </font></div></td>
                    </tr>
                  </table></td>
              </tr>
            </table>
:p
 
oh, i didnt all fit so the rest is here, the first line would go directly after </table> tag.

Code:
          <!--MAIN CENTER CONTENT AREA END--></td>
    <td width="220" valign="top"><!-- START OF NAVIGATION --><table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="4%"><img src="images/lborder.gif" width="34" height="24"></td>
                <td width="90%" background="images/bgborder.gif"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Our Tutorials</font></div></td>
                <td width="6%"><img src="images/rborder.gif" width="2" height="24"></td>
              </tr>
              <tr>
                <td colspan="3"><table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                    <tr>
                      <td> 
                        <!-- START OF CONTENT BOX CONTENT -->
                        <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="">Cool Signature Tutorial</a></font> 
                        <!-- END OF CONTENT BOX CONTENT -->
                      </td>
                    </tr>
                  </table></td>
              </tr>
            </table><!-- END OF NAVIGATION -->
			<br>
			<!-- START OF NAVIGATION --><table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="4%"><img src="images/lborder.gif" width="34" height="24"></td>
                <td width="90%" background="images/bgborder.gif"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Latest Reviews</font></div></td>
                <td width="6%"><img src="images/rborder.gif" width="2" height="24"></td>
              </tr>
              <tr>
                <td colspan="3"><table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                    <tr>
                      <td> 
                        <!-- START OF CONTENT BOX CONTENT -->
                        <font size="1" face="Verdana, Arial, Helvetica, sans-serif">text etc here</font> 
                        <!-- END OF CONTENT BOX CONTENT -->
                      </td>
                    </tr>
                  </table></td>
              </tr>
            </table><!-- END OF NAVIGATION -->
			<br>
			<!-- START OF NAVIGATION --><table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="4%"><img src="images/lborder.gif" width="34" height="24"></td>
                <td width="90%" background="images/bgborder.gif"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Shoutbox</font></div></td>
                <td width="6%"><img src="images/rborder.gif" width="2" height="24"></td>
              </tr>
              <tr>
                <td colspan="3"><table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                    <tr>
                      <td> 
                        <!-- START OF CONTENT BOX CONTENT -->
                        <font size="1" face="Verdana, Arial, Helvetica, sans-serif">text etc here</font> 
                        <!-- END OF CONTENT BOX CONTENT -->
                      </td>
                    </tr>
                  </table></td>
              </tr>
            </table><!-- END OF NAVIGATION --></td>
  </tr>
</table>
</td>
  </tr>
  <!-- END OF MAIN CONTENT AREA -->
</table>
</body>
</HTML>
 
yes its all done by hand except the tutorial for the switch page (index?id=)

It all worked until i put the php in, i dont know if the document has to be html or php, anyway ill keep going but doing it in html, what i wanted to avoid doing is doing each page seperately purely becuase it will take longer for the site to load and a lot of storage.
 
hmmm...

the page doesn't load when I view it... just loads, and loads and loads...
this link howeverhttp://www.srcomputers.info/X6 Core [V1.1]/index.php?id=contact loads perfectly...

(witrh the exception of the few errors caused by the fact that the contact page doesn't work and hence can't be included!

and I'll tell you why this is!!

the default for your switch statement is include index.php

so the file index.php is included and processed, inside the index.php file is the switch statement, that loads index .php which is included and processed. inside index.php is a switch statement...

I think you see where this is going...
you are loading and loading and loading the same file over and over again with your include statement...

so...

I assume you have to call the main page index.php for your server,
so change the include statements (that are include('index.php'); to include('home.php');

put the stuff you want shown in the center of the page when seeing the default view into a file called home.php
 
Ah yes, that must be the problem due to the cool PHP links, I was having that problem with a tutorial site I was coding the other day, it must be something like main.php or default.php or home.php as root said.
 
hello i am having a problem with my php. here is the php
<?php
$function = $_GET['action'];
$currentloc = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];

switch ($function)

{
case 'upload':
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of
// $_FILES. In PHP earlier then 4.0.3, use copy() and is_uploaded_file()
// instead of move_uploaded_file

$uploaddir = '/var/www/html/upload/uploads/';
$uploadfile = $uploaddir. basename($_FILES['userfile']['name']);
print $currentloc;
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";

break;
default:
print $currentloc;
echo '<html><head><title>Upload files</title></head>\n
<body bgcolor = "#78F0B4">
<Font color = "#ff0000">
<h2>Upload a file</h2>
<form enctype="multipart/form-data" action="upload.php?action=upload" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="30000000">
Send this file: <input name="userfile" type="file"><br>
<input type="submit" value="Send File">
</form>';
break;
}



can anay one help me?
 
Back
Top Bottom