Jump to content

External .php pages


businessman332211@hotmail.com

Recommended Posts

I just have discovered something (might sound wierd) but "I" didn't know about these things yet. I always used php in my Xhtml pages, I didn't know you could use them as CSS, JavaScript files. This opens up new worlds to me, I never thought possible, but before I get all happy, and start doing all my CSS, Javascript as php pages, and start adding new functionality to my css/javascript pages, I would like to know, are there any negative sides to using .php instead of external js, or css files. I am worried that some browsers may only accept the .css for stylesheet and .js for javascript, I really like this idea, and I am really ready to start utilizing it, and would love too, but I have to make sure it's not a bad thing first, or a bad programming/coding proactice or something, I have to make sure it's a good thing, and something that won't start causing me a whole bunch of problems later on down the road.

Link to comment
Share on other sites

dynamica css, dynamic javascript. You can do 100 times more with them being powered by php, than being powered by just there native language. Styles based on specific actions, excetera, I know you can also make .js files for css, but I Don't have a point, the .php for javascript, css will make me have a whole new world of options available, and it has to be .php to use php to output the javascript or css.

Link to comment
Share on other sites

Just use the type attributes to specify what you have:<style type="text/css" src="style.php"><script type="text/javascript" src="script.php">You may also want to look into the MIME types for those files, and make sure that you send the right one. By default, I believe PHP sends text/html.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...