Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 11th, 2008, 1:25 PM   #1
zanatos
Newbie
 
Join Date: Dec 2007
Posts: 11
Rep Power: 0 zanatos is on a distinguished road
PHP problem

Hello I am trying to make a dynamic php template. However for some odd reason when i run my php program (with xampp) it loads the homepage fine, but my other pages are not working! when i click the other page it seems like it just loads the default template.php file (home page). I will post the code for the following: template.php, navbar.html (for the links), home.php (home page) and about.php( the second page that does not work)

Here is the code:
Template.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
	background-image: url(images/BG.gif);
}
-->
</style></head>

<body>

<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>  
		<?php 
			include("Head.html");
		?>
    </td>
  </tr>
  <tr>
    <td>
		<?php 
			include("navbar.html");
	 	?>
    </td>
  </tr>
  <tr>
    <td>
    	<?php
			include("navwrapper.html");
		?>
    </td>
  </tr>
  <tr>
    <td>
	<?php
	
		if($_GET["file"]=="abt"){
			include("about.php");
		}else if($_GET["file"]=="serv"){
			include("services.php");
		}else{
		
		include("home.php");
		}
	?>    
	</td>
  </tr>
  <tr>
    <td>
    	<?php
			include("footer.html");
		?>
    </td>
  </tr>
</table
>
</body>
</html>

Code for the links (navbar.html)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
    	<img src="images/home.gif" width="83" height="82"
         onmouseover="this.src='images/home_roll.gif'"
         onmouseout="this.src='images/home.gif'"
         onmouseup="document.location='Template.php?'"/>
    </td>
 	<td>
    	<img src="images/about.gif" width="84" height="82"
         onmouseover="this.src='images/about_roll.gif'"
         onmouseout="this.src='images/about.gif'"
         onmouseup="document.location='Template.php?file=about'"/>
    </td>
    <td>
   		 <img src="images/services.gif" width="84" height="82"
         onmouseover="this.src='images/services_roll.gif'"
         onmouseout="this.src='images/services.gif'"
         onmouseup="document.location='Template.php?file=services'"/>
    </td>
    <td>
    	<img src="images/clients.gif" width="83" height="82"
         onmouseover="this.src='images/clients_roll.gif'"
         onmouseout="this.src='images/clients.gif'"/>
    </td>
    <td>  
    	 <img src="images/contact.gif" width="84" height="82"
         onmouseover="this.src='images/contact_roll.gif'"
         onmouseout="this.src='images/contact.gif'"/>
    </td>
    <td><img src="images/navwrapper.gif" width="381" height="82"/></td>
  </tr>
</table>
</body>
</html>

Code for home.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<script type="text/javascript">

function Intro(){
	window.alert("Welcome to Scale up")
	var na = prompt("What is your name?")
	window.alert("Hello " + na)
	confirm("Please click ok if you which to learn more about Scale up!")
}

</script>

</head>
<body onload="Intro()">

<table width="800" height="494" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td background="images/content.gif">
    <table border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td>
        	<?php
				print "Welcome to Scale up!";	
			?>
        </td>
      </tr>
    </table></td>
  </tr>
</table>

</body>
</html>

Code for about.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

</head>

<body>
<table width="800" height="494" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td background="images/content.gif"></td>
    
    <table width="800" border="0" cellspacing="0" cellpadding="0">
     	 <tr>
        	<td>
        		<?php
					print "ABOUT PAGE";	
				?>
        	</td>
      	</tr>
    </table>
        
  </tr>
</table>


</body>
</html>

note: the background image loaded in home.php and about.php is where I would want my content to go.

Thank you and I would apreciate any help, as this problem is very frustrating lol keep in mind this is my first time doing php.
zanatos is offline   Reply With Quote
Old Apr 11th, 2008, 3:06 PM   #2
zanatos
Newbie
 
Join Date: Dec 2007
Posts: 11
Rep Power: 0 zanatos is on a distinguished road
Re: PHP problem

ok well I found one of the problems. in the navbar.html i have file="about" it should be file="abt" lol. still having some problems i will take another look, and if i still can't find the problem i will be back!

update: well its working fine now(lol dumb mistakes), the only thing that I don't know how to solve is positioning the txt. when I print some text it doesn't show up at the top but near the bottom. is there any way I can solve this without throwing a div in and using css to absolute position it?
zanatos is offline   Reply With Quote
Old Apr 11th, 2008, 8:56 PM   #3
zanatos
Newbie
 
Join Date: Dec 2007
Posts: 11
Rep Power: 0 zanatos is on a distinguished road
Re: PHP problem

Any ideas on how to position the text? I don't want to absolute postion it, since it will look different on different monitors.
zanatos is offline   Reply With Quote
Old Apr 12th, 2008, 12:09 AM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Re: PHP problem

Is there any chance you could put this up on a server? It's hard to visualise as code.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem solving ReggaetonKing Software Design and Algorithms 7 Jan 4th, 2008 1:49 PM
php and mysql problem.. teishu PHP 9 Sep 2nd, 2007 2:46 AM
Php Tutorial 3 bulio PHP 4 Jul 16th, 2006 4:00 AM
Php Tutorial 1 bulio PHP 17 May 29th, 2006 4:54 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:44 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC