Jump to content

Include function problems


14862875

Recommended Posts

Hey guys i'm struggling with a practical i have to do...here is the instructions...

 

For this prac you must develop a page that illustrates three possible layouts using PHP’s

include function. The page must contain three links (Layout 1, Layout 2 and Layout 3). When

the user clicks on one of these options the page layout should adjust accordingly. You can

send the user’s option as a variable via the URL (see chapter 3). Each layout must cater for a

page title, a navigation bar and a footnote containing the date.

 

here is my code...first is my index.php

 

<?php include ('includes 1/head1.php'); ?>

Please select a layout:

<?php

print"<p/>

<a href='index.php'>Layout 1 $page1</a><br/>
<a href='index.php'>Layout 2 $page2</a><br/>
<a href='index.php'>Layout 3 $page3</a><br/>"


?>

<?php include ('includes 1/foot1.php'); ?>

 

second my head1.php and foot1.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>Practical 7</title>
<style type="text/css">

	body
	{
	font-family:arial;
	font-size:10pt;
	margin-top:80px;
	background-color:#000000;
	color:white;
	}

	td
	{
	padding:10px;
	}

</style>
</head>

</head>

<body>
<center>

<table width="750" border="1">
<tr height="100">
<td colspan="3">HEAD</td>
</tr>
<tr height="400">
		<td width="150">Navigation</td>
		<td width="450">

 

</td>
<td width="150">Right</td>
</tr>
<tr height="20">
<td colspan="3">

<?php 
date_default_timezone_set('Africa/Johannesburg');

print '<p/>'.date('g:i a l F j ');


?></b></td>
</tr>
</table>

</center>
</body>
</html>

 

thirdly my head2.php and foot2.php code

 

<!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></title>
<style type="text/css">

	body
	{
	font-family:verdana;
	font-size:10pt;
	margin-top:80px;
	background-color:red;
	font-style:italic;
	}

	td
	{
	padding:10px;
	}

</style>
</head>

</head>

<body>
<center>

<table width="750" border="1">
<tr height="100">
<td>HEAD</td>
</tr>
<tr height="40">
		<td width="150">Navigation</td>
    </tr>
    <td>

 

</td>
</tr>
<tr height="20">
<td></td>
</tr>
</table>

</center>
</body>
</html>

 

lastly my head3.php and foot3.php code

 

<!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></title>
<style type="text/css">

	body
	{
	font-family:cambria;
	font-size:10pt;
	margin-top:80px;
	background-color:yellow;
	font-style:normal;
	}

	td
	{
	padding:10px;
	}

</style>
</head>

</head>

<body>
<center>

<table width="750" border="1">
<tr height="100">
<td>HEAD</td>
</tr>
    <td style='text-align:center';>

 

</td>
</tr>
    <tr height="40">
		<td width="150">Navigation</td>
    </tr>
<tr height="20">
<td>
    5:27 pm Tuesday March 31    </td>
</tr>
</table>

</center>
</body>
</html>

 

when i click on the links on my index.php i should be able to view the different layouts..i have no idea how to do this.. your help will be much appreciated guys..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.