Here is footer.php file and I guess it is not coded right by the developer. Can anyone see if it is ok and where is the errors in it? <?php // Footer ?> <div id="footer"> <p>© <?php echo $LovelyToys.com; ?> , © lovelytoys.com 2008<br/> All rights reserved | <a href="sitepolicy.html">Site policy</a> | <a href="resources.html">Resources</a> |<a href="aboutus.html">AboutUs</a> | <a href="contact.html">Contact</a> |<a href="sitemap.html">Site map</a> |</p> </div> </body> </html> <?php <a href="wodden_toys.html">Wooden Toys</a>| <a href="safe_toys.html">Safe Toys</a>| <a href="indoor_toys.html">Indoor Toys</a>| <a href="outdoor_toys.html">Outdoor Toys</a>| ?>
just view it on dreamweaver and u can see the error. actually, what u want to display here? dis will show nothing in ur browser. what declaration u made here? comment used need to be started like dis :
actually, comments can be // in php. I use them in my code. I've also seen comments like <!-- but i can't remember the closig bit of it.
<?php <a href="wodden_toys.html">Wooden Toys</a>| <a href="safe_toys.html">Safe Toys</a>| <a href="indoor_toys.html">Indoor Toys</a>| <a href="outdoor_toys.html">Outdoor Toys</a>| ?> These are the footer links. You mean this can't be shown like this. How do I write them?
You've got that in PHP tags... you need to put <?PHP echo ' LINK1 stuff <BR> LINK 2 STUFF<BR> ...etc etc '; ?> just replace LINk1 stuff up to etc with your links, and PHP will then echo that out. Just clean up that code a lil bit ^^
Alright, I made some corrections here and see if this is all ok? OR where else is the mistake? <?php // Footer ?> <div id="footer"> <p> <?php echo $LovelyToys; ?> , © lovelytoys.com 2008<br/> All rights reserved | <a href="sitepolicy.html">Site policy</a> | <a href="resources.html">Resources</a> |<a href="aboutus.html">AboutUs</a> | <a href="contact.html">Contact</a> |<a href="sitemap.html">Site map</a> <p> <a href="wodden_toys.html">Wooden Toys</a>| <a href="safe_toys.html">Safe Toys</a>| <a href="indoor_toys.html">Indoor Toys</a>| <a href="outdoor_toys.html">Outdoor Toys</a>| </p> </div> </body> </html>
Looks good. Though i've only skimmed it. Do you have a testing server on your PC? i'd advise XAMPP if you're on a windows machine, if not, just test it on your hosting to ensure, and if there's an error, it'll narrow down where the error is if there is one
How about this top portion of footer.php, is all ok here? <?php // Footer ?> <div id="footer"> <p> <?php echo $LovelyToys; ?> , © lovelytoys.com 2008<br/>
yeah, i'm guessing $LovelyToys has been defined previously in the document, and the rest of the code looks sound to me ^^.
Unless the text to the left of © lovelytoys.com 2008 changes, then theres no real reason why you would want the php there. something like <a href="http://www.lovelytoys.com/">Lovely Toys ©Copyright lovelytoys.com 2008</a><br /> HTML: will work fine, and will then have a link to the home page too at the bottom of each page. Theres really no need for the <?php // FOOTER ?> PHP: If you do want something there, have <!-- Footer --> PHP: so that you can clearly see the divide in the HTML source Jay
footer.php O boy! its still giving me error after all this. <div id="footer"> <p> <a href="http://www.lovelytoys.com/">Lovely Toys ©Copyright lovelytoys.com 2008</a><br /> All rights reserved | |<a href="aboutus.html">AboutUs</a> | <a href="contact.html">Contact</a> | </p> <p> <a href="indoor_toys.html">Indoor Toys</a>| <a href="outdoor_toys.html">Outdoor Toys</a>| </p> </div> </body> </html>
In the index.php when I place this footer includes as follows and its giving me error Line 154 or Line 150 <div id="footer"/> <p> <? include('footer.php'); ?> </p> </div> </body> </html>
It could be that you are using the <? ?> short tags, but not very likely. try changing the <? to <?php. can you post your whole script?
Well I tried this also the full tags. <div id="footer"/> <?php include("footer.php"); ?> </div> </body> </html> AND I still get following error in index.php Warning: main(footer.php) [function.main]: failed to open stream: No such file or directory in /home/pri/public_html/lovelytoys/index.php on line 155 Warning: main() [function.include]: Failed opening 'footer.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php')