14862875 Posted March 31, 2009 Share Posted March 31, 2009 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.. Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted March 31, 2009 Share Posted March 31, 2009 Ooohhh. If we show you how to do this you won't really learn will you. A pointer for you: URL Parameters index.php?layout=1 index.php?layout=2 index.php?layout=3 $_GET Quote Link to comment Share on other sites More sharing options...
14862875 Posted March 31, 2009 Author Share Posted March 31, 2009 Can you elaborate please..this is due for tomorrow, PLEASE Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.