TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

the include ability

Page: 1 2 Reply
Jul 24th 2002#60462 Report
Member since: Dec 24th 2001
Posts: 222
i know nothing about php but i wanted to put my side bar in an .htm site and call it through include so that i could update everything at once but when i go through the tutorial at this site it doesnt work? i dont know why, i cut out my sidebar and placed it in an external html document and placed this in its place

i did it like that and with the script tags and i cant get it to work i have no idea why but if you know of anything i might have forgotten or skipped please tell me
Reply with Quote Reply
Jul 24th 2002#60469 Report
Member since: Mar 27th 2001
Posts: 2237
It will only work if the page you are trying to include the html page in has a .php extension
Reply with Quote Reply
Jul 24th 2002#60470 Report
Member since: Apr 29th 2002
Posts: 425
not true tornupinside... i've done it with html extentions
Reply with Quote Reply
Jul 24th 2002#60471 Report
Member since: Mar 18th 2001
Posts: 6632
The page that is calling the include has to have a php extension. The file being imported can have any extention. But the one that you put the include code into has to be php. And you also have to have php installed on your server and/or computer for it to work. And you have to have it pointing to the right file in the right directory.
Reply with Quote Reply
Jul 24th 2002#60493 Report
Member since: Mar 27th 2001
Posts: 2237
Originally posted by Pheeble
not true tornupinside... i've done it with html extentions


You can fake it in the .htaccess file (html = php), but if you are going to run php code you have to run it from a .php file.

case closed.
Reply with Quote Reply
Jul 25th 2002#60632 Report
Member since: Dec 24th 2001
Posts: 222
ok my external page is .htm the page im calling from is .php i have done exactly what the tut at teamphotoshop sais and im using dreamweaver and so im assuming that the only way php would not work is if internet explorer 5 which is what im using i beleive doesnt support it and im pretty sure thats not the case. it is pointing to the right page too they are in the same directory but just to make sure i even added the reference starting all the way at my c: drive so that shouldnt be the problem. also i have a feeling this might be it can someone type the include tag or whatever in here and make each part that should have a space visible? because i dont know where the spaces in that tag should be or even if there should be any at all? also do you need script tags when using the include ability? or anything in the head of your document?
Reply with Quote Reply
Jul 25th 2002#60634 Report
Member since: Jun 30th 2001
Posts: 447
You can see if you have PHP installed by creating a PHP page named say phpinfo.php and then put the following in it:

[PHP][/PHP]

You should receive a long list of things related to the PHP environment, if not, PHP isn't installed.

Once you know that PHP is installed, all you have to do to include a file is put the following in your .php file:

[PHP][/PHP]
Reply with Quote Reply
Jul 25th 2002#60635 Report
Member since: Mar 18th 2001
Posts: 6632
Unless you have PHP installed on your computer, linking to your C Drive will not work. If you upload it to the web, it can't look on your hard drive to get the file.

PHP has to be installed on the server that is serving your files. It has nothing at all to do with your browser. It is all executed on the server that sends out the pages to the browser.

Also the .htm file that you are including should NOT have any body tags, < html> tags, head tags, or anything else. Just include the stuff you want to appear in place of the include tag.

Also make sure that you put the <.? code here ?.> question mark things around the include line so that the server will know to process the php, and not just display the include line in the browser.

Again, if you want good help, just post a link, and we will be able to help you 1,000 times easier.
Reply with Quote Reply
Jul 26th 2002#61033 Report
Member since: Dec 24th 2001
Posts: 222
ok i put in the tag that hunkarama gave me and nothing shows up when i view it in my browser so why is that since im not even using a host im simply creating the page on my comp? does it have something to do with the fact that php is server side? do i have to do everything php with a host?
Reply with Quote Reply
Jul 26th 2002#61037 Report
Member since: Mar 24th 2001
Posts: 3734
You don't actually NEED a host, but it is good to have. What OS are you running,...we can work around it.
Reply with Quote Reply
Page: 1 2 Back to top
Please login or register above to post in this forum