Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
my php code wont work
Old 01-31-2008, 04:47 PM my php code wont work
Extreme Talker

Posts: 189
Trades: 0
im creating a website and i cant get my php code to work can someone tell me whats wrong or rewrite it please

PHP Code:
<?php

if ($8foot=="main"){
include (
"8foot/main.txt"); }
elseif ($
8foot=="music"){
include (
"8foot/music.txt"); }
elseif ($
8foot=="photos"){
include (
"8foot/photos.txt"); }

elseif (
$arch=="main"){
include (
"arch/main.txt"); }
elseif (
$arch=="music"){
include (
"arch/music.txt"); }
elseif (
$arch=="photos"){
include (
"arch/photos.txt"); }

elseif (
$cradle=="main"){
include (
"cradle/main.txt"); }
elseif (
$cradle=="music"){
include (
"cradle/music.txt"); }
elseif (
$cradle=="photos"){
include (
"cradle/photos.txt"); }

elseif (
$evanescence=="main"){
include (
"evanescence/main.txt"); }
elseif (
$evanescence=="music"){
include (
"evanescence/music.txt"); }
elseif (
$evanescence=="photos"){
include (
"evanescence/photos.txt"); }

elseif (
$flames=="main"){
include (
"flames/main.txt"); }
elseif (
$flames=="music"){
include (
"flames/music.txt"); }
elseif (
$flames=="photos"){
include (
"flames/photos.txt"); }

elseif (
$nightwish=="main"){
include (
"nightwish/main.txt"); }
elseif (
$nightwish=="music"){
include (
"nightwish/music.txt"); }
elseif (
$nightwish=="photos"){
include (
"nightwish/photos.txt"); }

elseif (
$system=="main"){
include (
"system/main.txt"); }
elseif (
$system=="music"){
include (
"system/music.txt"); }
elseif (
$system=="photos"){
include (
"system/photos.txt"); }

elseif (
$within=="main"){
include (
"within/main.txt"); }
elseif (
$within=="music"){
include (
"within/music.txt"); }
elseif (
$within=="photos"){
include (
"within/photos.txt"); }

else {
header("location: index.php ");
}

?>
and here is the code in full (the html and php code)

HTML Code:
<html>
<head>
<title>Magic dan</title>
<meta http-equiv="Content-Type" content="text/html;">
<!--Fireworks MX 2004 Dreamweaver MX 2004 target.  Created Fri Feb 01 09:30:15 GMT+1300 (New Zealand Daylight Time) 2008-->
<script language="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[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
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[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function mmLoadMenus() {
  if (window.mm_menu_0201085802_0) return;
  window.mm_menu_0201085802_0 = new Menu("root",60,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0201085802_0.addMenuItem("Main","location='index.php?cradle=main'");
  mm_menu_0201085802_0.addMenuItem("Music","location='index.php?cradle=music'");
  mm_menu_0201085802_0.addMenuItem("Photos","location='index.php?cradle=photos'");
   mm_menu_0201085802_0.bgImageUp="mmmenu6_60x20_up.gif";
   mm_menu_0201085802_0.bgImageOver="mmmenu6_60x20_over.gif";
   mm_menu_0201085802_0.hideOnMouseOut=true;
   mm_menu_0201085802_0.bgColor='#555555';
  window.mm_menu_0201085647_1 = new Menu("root",60,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0201085647_1.addMenuItem("Main","location='index.php?arch=main'");
  mm_menu_0201085647_1.addMenuItem("Music","location='index.php?arch=music'");
  mm_menu_0201085647_1.addMenuItem("Photos","location='index.php?arch=photos'");
   mm_menu_0201085647_1.bgImageUp="mmmenu7_60x20_up.gif";
   mm_menu_0201085647_1.bgImageOver="mmmenu7_60x20_over.gif";
   mm_menu_0201085647_1.hideOnMouseOut=true;
   mm_menu_0201085647_1.bgColor='#555555';
  window.mm_menu_0201085338_2 = new Menu("root",60,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0201085338_2.addMenuItem("Main","location='index.php?8foot=main'");
  mm_menu_0201085338_2.addMenuItem("Music","location='index.php?8foot=music'");
  mm_menu_0201085338_2.addMenuItem("Photos","location='index.php?8foot=photos'");
   mm_menu_0201085338_2.bgImageUp="mmmenu8_60x20_up.gif";
   mm_menu_0201085338_2.bgImageOver="mmmenu8_60x20_over.gif";
   mm_menu_0201085338_2.hideOnMouseOut=true;
   mm_menu_0201085338_2.bgColor='#555555';
  window.mm_menu_0201090301_3 = new Menu("root",60,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0201090301_3.addMenuItem("Main","location='index.php?flames=main'");
  mm_menu_0201090301_3.addMenuItem("Music","location='index.php?flames=music'");
  mm_menu_0201090301_3.addMenuItem("Photos","location='index.php?flames=photos'");
   mm_menu_0201090301_3.bgImageUp="mmmenu4_60x20_up.gif";
   mm_menu_0201090301_3.bgImageOver="mmmenu4_60x20_over.gif";
   mm_menu_0201090301_3.hideOnMouseOut=true;
   mm_menu_0201090301_3.bgColor='#555555';
  window.mm_menu_0201090145_4 = new Menu("root",60,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0201090145_4.addMenuItem("Main","location='index.php?evanescence=main'");
  mm_menu_0201090145_4.addMenuItem("Music","location='index.php?evanescence=music'");
  mm_menu_0201090145_4.addMenuItem("Photos","location='index.php?evanescence=photos'");
   mm_menu_0201090145_4.bgImageUp="mmmenu5_60x20_up.gif";
   mm_menu_0201090145_4.bgImageOver="mmmenu5_60x20_over.gif";
   mm_menu_0201090145_4.hideOnMouseOut=true;
   mm_menu_0201090145_4.bgColor='#555555';
  window.mm_menu_0201090727_0 = new Menu("root",60,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0201090727_0.addMenuItem("Main","location='index.php?within=main'");
  mm_menu_0201090727_0.addMenuItem("Music","location='index.php?within=music'");
  mm_menu_0201090727_0.addMenuItem("Photos","location='index.php?within=photos'");
   mm_menu_0201090727_0.bgImageUp="mmmenu1_60x20_up.gif";
   mm_menu_0201090727_0.bgImageOver="mmmenu1_60x20_over.gif";
   mm_menu_0201090727_0.hideOnMouseOut=true;
   mm_menu_0201090727_0.bgColor='#555555';
  window.mm_menu_0201090629_1 = new Menu("root",60,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0201090629_1.addMenuItem("Main","location='index.php?system=main'");
  mm_menu_0201090629_1.addMenuItem("Music","location='index.php?system=music'");
  mm_menu_0201090629_1.addMenuItem("Photos","location='index.php?system=photos'");
   mm_menu_0201090629_1.bgImageUp="mmmenu2_60x20_up.gif";
   mm_menu_0201090629_1.bgImageOver="mmmenu2_60x20_over.gif";
   mm_menu_0201090629_1.hideOnMouseOut=true;
   mm_menu_0201090629_1.bgColor='#555555';
  window.mm_menu_0201090448_2 = new Menu("root",60,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#000084","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0201090448_2.addMenuItem("Main","location='index.php?nightwish=main'");
  mm_menu_0201090448_2.addMenuItem("Music","location='index.php?nightwish=music'");
  mm_menu_0201090448_2.addMenuItem("Photos","location='index.php?nightwish=photos'");
   mm_menu_0201090448_2.bgImageUp="mmmenu3_60x20_up.gif";
   mm_menu_0201090448_2.bgImageOver="mmmenu3_60x20_over.gif";
   mm_menu_0201090448_2.hideOnMouseOut=true;
   mm_menu_0201090448_2.bgColor='#555555';

  mm_menu_0201090448_2.writeMenus();
} // mmLoadMenus()

//-->
</script>
<script language="JavaScript1.2" src="mm_menu.js"></script>
</head>
<body bgcolor="#000000" onLoad="MM_preloadImages('dan.png','index_r2_c4_f2.png');">
<script language="JavaScript1.2">mmLoadMenus();</script>
<table border="0" cellpadding="0" cellspacing="0" width="800">
<!-- fwtable fwsrc="baner.png" fwbase="index.png" fwstyle="Dreamweaver" fwdocid = "1974601047" fwnested="0" -->
  <tr>
   <td><img src="spacer.gif" width="225" height="1" border="0" alt=""></td>
   <td><img src="spacer.gif" width="76" height="1" border="0" alt=""></td>
   <td><img src="spacer.gif" width="196" height="1" border="0" alt=""></td>
   <td><img src="spacer.gif" width="76" height="1" border="0" alt=""></td>
   <td><img src="spacer.gif" width="227" height="1" border="0" alt=""></td>
   <td><img src="spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>

  <tr>
   <td colspan="5"><img name="index_r1_c1" src="index_r1_c1.png" width="800" height="20" border="0" alt=""></td>
   <td><img src="spacer.gif" width="1" height="20" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="2"><img name="index_r2_c1" src="index_r2_c1.png" width="225" height="180" border="0" usemap="#m_index_r2_c1" alt=""></td>
   <td><a href="#" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('index_r2_c2','','dan.png',1);"><img name="index_r2_c2" src="index_r2_c2.png" width="76" height="70" border="0" alt=""></a></td>
   <td rowspan="2"><img name="index_r2_c3" src="index_r2_c3.png" width="196" height="180" border="0" usemap="#m_index_r2_c3" alt=""></td>
   <td><a href="#" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('index_r2_c4','','index_r2_c4_f2.png','index_r2_c4','','dan.png',1);"><img name="index_r2_c4" src="index_r2_c4.png" width="76" height="70" border="0" alt=""></a></td>
   <td rowspan="2"><img name="index_r2_c5" src="index_r2_c5.png" width="227" height="180" border="0" usemap="#m_index_r2_c5" alt=""></td>
   <td><img src="spacer.gif" width="1" height="70" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img name="index_r3_c2" src="index_r3_c2.png" width="76" height="110" border="0" usemap="#m_index_r3_c2" alt=""></td>
   <td><img name="index_r3_c4" src="index_r3_c4.png" width="76" height="110" border="0" usemap="#m_index_r3_c4" alt=""></td>
   <td><img src="spacer.gif" width="1" height="110" border="0" alt=""></td>
  </tr>
<map name="m_index_r2_c1">
<area shape="rect" coords="200,80,300,170" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201085802_0,202,169,null,'index_r2_c1');"  >
<area shape="rect" coords="100,80,200,170" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201085647_1,102,169,null,'index_r2_c1');"  >
<area shape="rect" coords="10,80,101,170" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201085338_2,11,168,null,'index_r2_c1');"  >
</map>
<map name="m_index_r2_c3">
<area shape="rect" coords="98,80,198,170" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201090301_3,99,169,null,'index_r2_c3');"  >
<area shape="rect" coords="-1,80,99,170" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201090145_4,0,169,null,'index_r2_c3');"  >
</map>
<map name="m_index_r2_c5">
<area shape="rect" coords="126,80,217,170" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201090727_0,127,168,null,'index_r2_c5');"  >
<area shape="rect" coords="26,80,126,170" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201090629_1,27,168,null,'index_r2_c5');"  >
<area shape="rect" coords="-74,80,26,170" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201090448_2,-73,169,null,'index_r2_c5');"  >
</map>
<map name="m_index_r3_c2">
<area shape="rect" coords="75,10,175,100" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201090145_4,76,99,null,'index_r3_c2');"  >
<area shape="rect" coords="-25,10,75,100" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201085802_0,-23,99,null,'index_r3_c2');"  >
</map>
<map name="m_index_r3_c4">
<area shape="rect" coords="2,10,102,100" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201090448_2,3,99,null,'index_r3_c4');"  >
<area shape="rect" coords="-98,10,2,100" href="#" alt="" onMouseOut="MM_startTimeout();"  onMouseOver="MM_showMenu(window.mm_menu_0201090301_3,-97,99,null,'index_r3_c4');"  >
</map>
</table>

<?php

if ($8foot=="main"){
include ("8foot/main.txt"); }
elseif ($8foot=="music"){
include ("8foot/music.txt"); }
elseif ($8foot=="photos"){
include ("8foot/photos.txt"); }

elseif ($arch=="main"){
include ("arch/main.txt"); }
elseif ($arch=="music"){
include ("arch/music.txt"); }
elseif ($arch=="photos"){
include ("arch/photos.txt"); }

elseif ($cradle=="main"){
include ("cradle/main.txt"); }
elseif ($cradle=="music"){
include ("cradle/music.txt"); }
elseif ($cradle=="photos"){
include ("cradle/photos.txt"); }

elseif ($evanescence=="main"){
include ("evanescence/main.txt"); }
elseif ($evanescence=="music"){
include ("evanescence/music.txt"); }
elseif ($evanescence=="photos"){
include ("evanescence/photos.txt"); }

elseif ($flames=="main"){
include ("flames/main.txt"); }
elseif ($flames=="music"){
include ("flames/music.txt"); }
elseif ($flames=="photos"){
include ("flames/photos.txt"); }

elseif ($nightwish=="main"){
include ("nightwish/main.txt"); }
elseif ($nightwish=="music"){
include ("nightwish/music.txt"); }
elseif ($nightwish=="photos"){
include ("nightwish/photos.txt"); }

elseif ($system=="main"){
include ("system/main.txt"); }
elseif ($system=="music"){
include ("system/music.txt"); }
elseif ($system=="photos"){
include ("system/photos.txt"); }

elseif ($within=="main"){
include ("within/main.txt"); }
elseif ($within=="music"){
include ("within/music.txt"); }
elseif ($within=="photos"){
include ("within/photos.txt"); }

else {
header("location: index.php ");
}

?>

</body>
</html>
it works fine without the php code.
simster is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-31-2008, 05:02 PM Re: my php code wont work
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
As I like to say, "All code works; just maybe not how you thought." Wanna tell us why it's not working as you thought? What did you think it would do? What did it do instead?
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-31-2008, 05:03 PM Re: my php code wont work
Extreme Talker

Posts: 189
Trades: 0
the page was blank when i loaded it with the php code (nothing on the page at all)
simster is offline
Reply With Quote
View Public Profile
 
Old 01-31-2008, 05:06 PM Re: my php code wont work
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
That happens, usually, when there's an error in your code and your server isn't configured to display it. I took a look at the code and noticed that you have a variable called $8foot which is a bad variable name. If you don't know why, then you should read http://us3.php.net/variables as that's a very elementary thing to know.

Have an awesome day!
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-31-2008, 05:09 PM Re: my php code wont work
Extreme Talker

Posts: 189
Trades: 0
thank you
simster is offline
Reply With Quote
View Public Profile
 
Old 02-01-2008, 08:23 AM Re: my php code wont work
tazmanny's Avatar
Banned

Posts: 16
Name: manuel
Trades: 0
I had a problem like that before, It took me 4 days to figure it out... never thought a site like this existed... you guys are a bless.
tazmanny is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to my php code wont work
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25626 seconds with 12 queries