how would i put javascripts and css into php files?
would i just type include(filename) or echo "<script type=blah blah blah src=...>"; or is there a different way?
how would i put javascripts and css into php files?
would i just type include(filename) or echo "<script type=blah blah blah src=...>"; or is there a different way?
The second option (echoing) is more practical. I use it anyway and it works fine with me.
Well you could use this it might make things clearer.
<?php
$java = 'YOURSCRIPT';
echo '$java';
?>
thanks! imma tell u guys how it goes.
I would use the php include function
so somethinglike this:
<?php include("http://www.yoursite.com/script.js"); ?>
My mate uses it and I use it in my sites and it seems to work easy.
Its more pactical as you only have to modify one file and it changes on all pages.
But it is your choice if you want to use the other ways that the other guys mentioned ealier in the thread.
Interesting. So how do you include the CSS in a PHP file than?
I was actually wondering that also.
Well just place it before the <?php tag.
Are you able to have an external CSS file and call it in?
if you wanted an external js file or something you could do:
<script src="blah.js"></script>
<?php include("blah.js"); ?>
If it was to be css
<?php include("blah.css"); ?>
I think that is what you mean, however I could be wrong!!
Last edited by randomize; 03-22-2006 at 10:33 AM.
Randomize? Do you know what your talking about those examples would not work.