Organising Code better
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...
My html page file:
... 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
how would i do it with php?
or will i need to post this question in there??
your page has to be like index.php. then inside it you can have something like
and say have the a-file.html contain your nav bar. and just place that on everypage where you navbar is suppose to go.
<?php include("a-file.html"); ?>
yeah i knew how to do that in the first place - but i want one page with all my code in it - but you are able to select certain code within your page
<p>put your name here</>
then in my html file if i want both i can call both ...
or if i just wanted one i could say
is this possible even if i use php as a solution?
<h1>This Is a Test</h1>
<p>It is only a test.</p>
<p>This has been a test.</p>
"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 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).
Originally Posted by essjay_d12
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)