I want to organise my code better, and was wondering if i could create a script file with all the code in under calling commands and then in my html file i want to use whenever i want that code i can call it in from my sript file.
so it would be something like the following...
Script file:
tester()
<p>Test</>
My html page file:
<body>
call tester()
</body>
... and this would display 'Test'
Is it possible to do this with html, i've looked everywhere and cant seem to find it, i thought it would have been possible, please help
<?php
function tester()
{
echo <<<END
<h1>This Is a Test</h1>
<p>It is only a test.</p>
END;
}
function tester2()
{
echo <<<END
<p>This has been a test.</p>
<p>The End</p>
END;
}
?>
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
I want to organise my code better, and was wondering if i could create a script file with all the code in under calling commands and then in my html file i want to use whenever i want that code i can call it in from my sript file.
I had the same thought with my webpage as well and thanks to the people here I was able to make it work. Here is the problem solution and in case you are interested, here my webpage with the implemented code (it's not done yet).
Bookmarks