PDA

View Full Version : Am i doing it wrong?


trickygaming
04-06-2011, 09:37 PM
ok, so, i have been told to use PHP includes for a previous problem. SO i have followed the tutorial on the homepage of this site.

But, on the frontpage, the guy is only putting in like, for different lines. I am putting in quite alot (around 180)

Im not sure if im putting in lines i shouldn't or if im missing some out.
im am trying to fit the whole menu system from This site (http://www.trickygaming.com) into menu.php so i can just update the php file to update everything that is in the latest headlines and so on links.

But when i try to test what i have in the menu.php file alone, i get nothing, sorry if im being to vague. Been trying this for ages now :/

DWcourse
04-06-2011, 09:42 PM
Can you post a sample page and give us a link?

And, are you using .php for your file extension?

trickygaming
04-06-2011, 09:50 PM
ok, here is the sample page > http://www.trickygaming.com/test.html

And i am using a .php extension yes.

DWcourse
04-06-2011, 09:58 PM
The php extension is required on the page that contains the call to the include file (not necessarily on the included file itself). Try changing the file name to test.php.

DWcourse
04-06-2011, 10:00 PM
Also the include file should include only the html that you want to add to the original page this stuff:

<html>
<head><title>Error 404 - Site not published</title>
<meta name="robots" content="noarchive" />
</head>
<body style="background: #BFDFFF none repeat scroll 0%;">

And the related closing page shouldn't be in there.

trickygaming
04-06-2011, 10:07 PM
ok, so i have took out the part you told me too, and the stuff at the end.
It now starts and ends with DIV tags in there.

It just seems like its not going into the .php file and getting the code.

i have reupped the sample site, with how it is now - http://www.trickygaming.com/test.html

DWcourse
04-06-2011, 10:10 PM
The php extension is required on the page that contains the call to the include file (not necessarily on the included file itself). Try changing the file name to test.php.

CHANGE THE FILE NAME

trickygaming
04-06-2011, 10:16 PM
i thought you meant change the filename of the .php?
I have a test.HTML
and a test.PHP

DWcourse
04-06-2011, 10:20 PM
you need to have a www.trickygaming.com/test.php as your main page and inside that file:

<?php include("someotherfile.php"); ?>

trickygaming
04-06-2011, 10:24 PM
oh, so to use a .php, the page its in needs to be .php?

DWcourse
04-06-2011, 10:29 PM
oh, so to use a .php, the page its in needs to be .php?
Basically yes. PHP is a scripting language. The .php extension tells the server that there is code in there to process.

trickygaming
04-06-2011, 10:59 PM
fixed all, thanks so much for your help :D

DWcourse
04-06-2011, 11:27 PM
no problem