Using php to call am html file
I have some files I am trying to get to communicate with my main file default.php. So what have is menu.css (takes care of my sidebar), menu.htm (contains JS for all the submnmenus and such), topmenu.htm (has JS for the top menu), and footer.htm (same as the other 2 but obviously footer) , default.css (takes care of all other css info). So what I am trying to do is call the .html files from default.php so that I don't have a .html file with all this excess JS everywhere. so here is what I have in default.php
Code:
//this is the very top lines// hopefully this is clear enough. |
Just try it.
If it does not work, you can do the following rename topmenu.htm to topmenu.php; if your server parses htm files as php, this step is not necessary but I consider it neater. edit topmenu.php Code:
<?php You can now include topmenu.php in your other php files and call topmenu(). Repeat this step for the other files. |
did try it...doesn't display anything.
|
Still nothing, do I need to remove the <html> tags at the beginning and the end of the menu.php, topmenu.php, footer.php? Also do I still include them like did above in default.html?
and lastly should I do anything special with the JS inside what I just made into a .php script? or are the included html tags surrounding them work just fine? |
Sorry, the existing html should only be the stuff that's inside the body tags (so excluding the body tags.
Code:
<?php Below is how I use it page.inc.php Code:
<?php Code:
<?php Code:
<?php |
Thank you I will try that. I am unable to edit right now so I will let you know in the next day or so if it works
|
ok so I have everything KINDA working, the site finds all the image stuff I need. Now my question is how to get the Java Script working for the menu's submenus. I have tried including the exported .htm and what I just converted to .php The only issue is in the side menu not showing the submenu on mouseover like it does if I just run that HTML. I have the pages included correctly cause all of the images are called with the .htm and .php pages that I mentioned above. it is just not using the javascript.
|
never mind, i forgot a file.
|
Great. Please mark your thread as solved using the thread tools just above the first post on the page.
|
All times are GMT -5. The time now is 02:43 PM. |