aebstract Posted October 10, 2006 Share Posted October 10, 2006 uhm... I don't know how to explain this, but I'll post my code and sample url and see if anyone can help me get the content in to the content div.[code]<?php$page = $_GET['page'];if (isset($page)) {include ("$page.php");} else {include ("home.php");}?><!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><title>Uniquely Yours - Log Furniture</title><link href="misc/stylesheet.css" rel="stylesheet" type="text/css" title="default" /></head><body><div id="base"><div id="top"><img src="top.jpg" /></div><div id="navhold"><div id="navigation"><?phpecho '<ul id="navlist"> <li'.(($page == 'home' || empty($page)) ? ' class="active"' : '').'><a href="index.php">Home</a></li> <li'.(($page == 'about') ? ' class="active"' : '').'><a href="index.php?page=about">About</a></li> <li'.(($page == 'gallery') ? ' class="active"' : '').'><a href="index.php?page=gallery">Gallery</a></li> <li'.(($page == 'contact') ? ' class="active"' : '').'><a href="index.php?page=contact">Contact</a></li> </ul>';?></div></div><div id="contentholder"><div id="content"><?phpecho "$content";?></div></div><div id="footer"><div id="copyright">Copyright © 2006, Uniquely Yours. <br />All rights reserved.</div></div><div id="spacer"></div></div></body></html>[/code]www.carbenco.com/uy/content should go in to a white box under the nav. it is showing up at top of page? Link to comment https://forums.phpfreaks.com/topic/23603-echo-problem/ Share on other sites More sharing options...
roopurt18 Posted October 10, 2006 Share Posted October 10, 2006 What is the name of the file you posted the code for?What is inside home.php? Link to comment https://forums.phpfreaks.com/topic/23603-echo-problem/#findComment-107165 Share on other sites More sharing options...
aebstract Posted October 10, 2006 Author Share Posted October 10, 2006 the file i posted is index.php, home.php is[CODE]$content = "home page";[/CODE] Link to comment https://forums.phpfreaks.com/topic/23603-echo-problem/#findComment-107166 Share on other sites More sharing options...
roopurt18 Posted October 10, 2006 Share Posted October 10, 2006 If that is the only thing in home.php, you need to enclose it between <?php and ?>Look at the top of index.php. With the URL you gave, there is no $_GET param, so it includes home.php. home.php is just opened and dumped in place. If you want to put php into an included file, you still need to start your php with <?php and end it with ?> Link to comment https://forums.phpfreaks.com/topic/23603-echo-problem/#findComment-107170 Share on other sites More sharing options...
aebstract Posted October 10, 2006 Author Share Posted October 10, 2006 thanks. ive had a long day and a headache, stupid error :) Link to comment https://forums.phpfreaks.com/topic/23603-echo-problem/#findComment-107171 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.