Computing.Net > Forums > Web Development > Need PHP help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Need PHP help

Reply to Message Icon

Name: x_kamikazez_x
Date: December 26, 2005 at 11:11:40 Pacific
OS: XP
CPU/Ram: 1.9
Comment:

I m creating the php website which have index.php. index include the header, leftnav, footer.php. i want the contents on the header or leftnav to display in an index.php when i click on the hyperlink.
please show me how to do it or give me some code or the good php tutorial website

thank you



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: December 26, 2005 at 11:40:12 Pacific
Reply:

I'm not sure I'm understanding your question. I *think* you are saying that you have separate files for the nav, header and footer and want to include those in the index file. You can include other files using the include command.


0

Response Number 2
Name: Laler
Date: December 26, 2005 at 15:36:41 Pacific
Reply:

here's a user-friendly tutorial about include() and templating:

http://www.phpfreaks.com/tutorials/8/0.php

---
Site of the Day


0

Response Number 3
Name: x_kamikazez_x
Date: December 26, 2005 at 18:17:25 Pacific
Reply:

thank for your quick reply...
my problem is not the include(). i already include those 3 file in index. now i have to work with the link. I don't know how to make the hyperlink work on PHP. for example. i have the button call "about us" when you click on that button,,,it information about us will show up in the wiew area and the header, leftnav, footer still reamain unchange.
i don't know if i clear enough...


0

Response Number 4
Name: Michael J (by mjdamato)
Date: December 27, 2005 at 00:33:53 Pacific
Reply:

Sorry, no you are not clear. When you click on the "About Us" link what are you wanting to happen on that page that is not happening now? Also, please try to use correct terminology when possible: "I don't know how to make the hyperlink work on PHP" makes no sense. Hyperlinks are still HTML, PHP is used to create the HTML. There is no such thing as a PHP link.


0

Response Number 5
Name: Laler
Date: December 27, 2005 at 16:06:30 Pacific
Reply:

Maybe I get it :D

PHP include() is not the same with frames. By using includes, even if you include a lot of files, the output is still a single HTML file.

when you click on that button,,,it information about us will show up in the wiew area and the header, leftnav, footer still reamain unchange.

Let's say this is the content of index.php:

<?php

include ("header.php");
include ("menu.php");

if ($_GET['page'] == 'about-us')
{

include ("about-us.php");

}

else

{

include ("home.php");

}

include ("footer.php");

?>


That way, when you call index.php, the "content" in home.php will shows up. But if you do index.php?page=about-us then about-us.php will shows up.

header, menu, and footer.php will remain the same.

That tutorial link above is actually telling about this, about how to make the header, menu, footer.php, and "content files", to not ruin the HTML structure.

---
Site of the Day


0

Related Posts

See More



Response Number 6
Name: x_kamikazez_x
Date: December 29, 2005 at 00:40:13 Pacific
Reply:

I got it...thank you very much guys...


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Need PHP help

PHP - Help pls! www.computing.net/answers/webdevel/php-help-pls/1987.html

SN R U out there? (PHP help) www.computing.net/answers/webdevel/sn-r-u-out-there-php-help/1381.html

Hi guys..need ur help www.computing.net/answers/webdevel/hi-guysneed-ur-help/743.html