Php Can't Include? |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Zymic Free Web Hosting Zymic Free Web Hosting - General Discussion & Help |
||
![]() |
Php Can't Include? |
||
Apr 20 2008, 06:16 PM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 9 Joined: 20-April 08 Member No.: 20,842 |
Hi,
I'm new here. I recently uploaded my site. I use the include functions to include the text (content) and menu on my site. But when I go to my site, it doesn't show the things that I normally include. My site is someone753951.zzl.org. It's like PHP isn't even enabled. I hope someone can help me out. PS: This is the code I use: to include the menu: CODE <?php include("menu.html"); ?> to include the content: CODE <?php
$pages = array("home", "about", "downloads", "trusted", "contact", "upload"); if (isset($_GET['page']) && !empty($_GET['page'])) { if(in_array($_GET['page'], $pages) && file_exists($_GET['page'].".html")) { include($_GET['page'].".html"); } else { include("404.html"); } } else { include("home.html"); } ?> |
|
|
Apr 21 2008, 02:27 AM
Post
#2
|
|
![]() Hosting Abuse Staff ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderators Posts: 2,933 Joined: 14-February 08 From: Fort Myers FL, USA Member No.: 10,089 |
Make sure your pages end with .php
php code will NOT work inside of pages with .html extension. If thats not the case, please reply. |
|
|
Apr 21 2008, 05:14 PM
Post
#3
|
|
|
Newbie ![]() Group: Members Posts: 9 Joined: 20-April 08 Member No.: 20,842 |
Ah, thanks.. They were .html... At my webserver they did work.. But i'll change it. Thanks
|
|
|
Apr 21 2008, 07:55 PM
Post
#4
|
|
![]() Hosting Abuse Staff ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderators Posts: 2,933 Joined: 14-February 08 From: Fort Myers FL, USA Member No.: 10,089 |
Yea, I don't know what web server you were using but sometimes they can allow things like that but it's always better to learn and do things the right way.
I'm just glad to see you use <?php and not <? for your tags. |
|
|
![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 20th May 2013 - 07:15 AM |