Jump to content

including a PHP file in an HTML doc and accessing it's variables, functions, ect.


htmlnoobie3344

Recommended Posts

Hey, i've been trying to learn PHP lately and i want to try putting a script in it's own PHP file with out HTML tags, but then how do i include it in the HTML? i found something like:

<!--#include file="PHP scripts/trial.php" -->

but i don't know how to access the variables, i even read the PHP tutorials on w3 and still not getting it, maybe someone could explain it to me better? my friend ever tried but i'm just not getting it :-p

Link to comment
Share on other sites

You use the include statement (your snippet is SSI syntax):

<?phpinclude("file-to-be-included.php");?>

Then it is as if you've copied and pasted the included file into the main document.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...