Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-10-2006, 02:09 AM   #1
Fully Optimized
 
Join Date: Jun 2005
Posts: 3,275
Send a message via ICQ to DJ Stephen Send a message via AIM to DJ Stephen Send a message via MSN to DJ Stephen Send a message via Yahoo to DJ Stephen
Default Help with php

Hi can anyone find anything wrong with this code, becuase everything is coming out more than once here:http://www.srcomputers.info/X6%20Cor...1%5D/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">&nbsp; </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">&nbsp;<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>
__________________

DJ Stephen is offline   Reply With Quote
Old 03-10-2006, 02:10 AM   #2
Fully Optimized
 
Join Date: Jun 2005
Posts: 3,275
Send a message via ICQ to DJ Stephen Send a message via AIM to DJ Stephen Send a message via MSN to DJ Stephen Send a message via Yahoo to DJ Stephen
Default Re: Help with php

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>
__________________

DJ Stephen is offline   Reply With Quote
Old 03-10-2006, 01:28 PM   #3
Fully Optimized
 
Join Date: Jun 2005
Posts: 3,275
Send a message via ICQ to DJ Stephen Send a message via AIM to DJ Stephen Send a message via MSN to DJ Stephen Send a message via Yahoo to DJ Stephen
Default Re: Help with php

ahh i need help.
DJ Stephen is offline   Reply With Quote
Old 03-10-2006, 03:01 PM   #4
BSOD
 
Flipper's Avatar
 
Join Date: Mar 2006
Posts: 246
Default Re: Help with php

That is EXTREMELY odd...I have no idea why its doing that. Did you code this all yourself?
Flipper is offline   Reply With Quote
Old 03-10-2006, 03:29 PM   #5
Fully Optimized
 
Join Date: Jun 2005
Posts: 3,275
Send a message via ICQ to DJ Stephen Send a message via AIM to DJ Stephen Send a message via MSN to DJ Stephen Send a message via Yahoo to DJ Stephen
Default Re: Help with php

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.
DJ Stephen is offline   Reply With Quote
Old 03-10-2006, 04:15 PM   #6
BSOD
 
Flipper's Avatar
 
Join Date: Mar 2006
Posts: 246
Default Re: Help with php

can you send me the jpg's or whatever and the php files? I will try and get it working.
Flipper is offline   Reply With Quote
Old 03-11-2006, 11:55 AM   #7
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 7,999
Default Re: Help with php

hmmm...

the page doesn't load when I view it... just loads, and loads and loads...
this link howeverhttp://www.srcomputers.info/X6%20Cor...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
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 03-11-2006, 12:20 PM   #8
BSOD
 
Flipper's Avatar
 
Join Date: Mar 2006
Posts: 246
Default Re: Help with 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.
Flipper is offline   Reply With Quote
Old 03-11-2006, 01:24 PM   #9
Fully Optimized
 
Join Date: Jun 2005
Posts: 3,275
Send a message via ICQ to DJ Stephen Send a message via AIM to DJ Stephen Send a message via MSN to DJ Stephen Send a message via Yahoo to DJ Stephen
Default Re: Help with php

ok, ill try that, thanks for your info.
DJ Stephen is offline   Reply With Quote
Old 03-18-2006, 03:27 PM   #10
Solid State Member
 
Join Date: Mar 2006
Posts: 8
Default Re: Help with php

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?
__________________

streets-of-ni is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 05:10 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0