Jump to content

XHTML 1.0: php include doesn't work. simple command \= someone help.


Minimeallolla

Recommended Posts

I'm using XHTML 1.0 Transitional and in a line of my code I have used:

 

"<?php

include ("drop_down_menu.php");

?>"

 

I've tried changing the file type to .html but it doesn't work either, unless I actually copy and paste the content in the index file. \=

 

Is it XHTML 1.0 Transitional that doesn't allow this?

I've previously worked with HTML 4.01 Transitional and it worked.

Well I currently don't have a server/ftp nor is the site hosted atm. I'm wanting to store abit of html code in another file and then use php in my index to call on that file but it's not working.

 

I havn't used php in a very long time and have forgotten most of it.

 

<?php

include ("Drop_Down_Menu.php");

?>

 

It's not a problem with the file path.

<?php

include ("Drop_Down_Menu.php");

?>

 

and the index is .html ?

 

I'm trying to put html code into a php file and then on my index.html call on that php file so my index.html isn't jammed with codes. Sorry to sound like such a noob lol \=

 

So I can't use the include function without hosting it as a proper website?

Oh. I'm on a DET laptop which is highly restricted -.- wamp and xammp cannot be installed \=

 

My main laptop recently broke and  use this because it's small, portable and easy to code on.

 

You are aware that PHP is used to extend servers functionality? Without a server there is no PHP unless your are writting simple cli scripts.

Without a webserver running php, how do expect a php function would work? Why not sign up for a free webhosting account that supports php until you can get something set up locally?

Long story, lets just say I very limited internet access, for now anyways.

 

I only wanted the include function, it's not like that function along requires a whole server. I guess I can go without php for a while lol. Thanks anyway though :D

Yes, actually that function does require a whole server. Since it's a part of php, which requires a webserver be running and configured to pass the code through the php interpreter, it will not work without it.

 

The browser interprets and renders HTML, the php interpreter interprets php code, and sends the resulting html markup to the browser. Without it, raw php is sent to the browser, which has no idea what to do with it. I hope that makes sense, because you really need to understand how php works or you're doomed to a life of frustration.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.