Use PHP to place a css file link in the header??
# September 19, 2012 at 12:31 pm
I’m writing a small PHP script for someone who will just use a PHP include to run the script. The thing is that I need to supply some CSS for the script to use when it runs. Does anyone know how I can use PHP to automatically place the link tag with the link for the CSS file into the head section of the page that calls it because I really don’t want to have to use inline CSS as that is messy.
Cheers everyone.# September 19, 2012 at 1:27 pm
@ChristopherBurton Hey Chris thanks for a reply.
The issue is that I writing a file for the guy called calendar.php, now he can use this file anywhere he wants in any other script by using a PHP include. Now I could make the outputted html from the PHP script have a head tag etc etc so that the link for the CSS file goes inside a head tag like it should but I don’t know the page that he is going to use the script on and I don’t want to insert extra html tags into the middle of his page and make his code messy, so what I want to do is if he had a file called lets say index.php and in that file he used < ?php include(calendar.php); ?> I would want to place the link for the CSS file into the head tag of the index.php page. Clear as mud? lol
You must be logged in to reply to this topic.