<?php
if (5<10) {
include('\firstpage\Home.html');
include('\firstpage\home.css');
}else{
echo("goodbye");
}
?>
<link rel="stylesheet" href="home.css" />
@Timmy_'s method should work perfectly. Do as he said, and put:
into the head tag of home.htmlCode:<link rel="stylesheet" href="home.css" />
im just playing around, thats my first php file or script so i was just having fun familiarizing with all the aspects of it.
Oh I understand.
Also, your code won't work because your CSS needs to be inside your <head></head> tags in your HTML file OR linked in via <link type="text/css" rel="stylesheet" href="css/global.css" />
You're calling your HTML and then your CSS at separate times which means your CSS won't be included in your HTML and HTML won't parse it so it will just be echoed as standard text.
<?php
If(false) {
?>
CGI is not running!?
<?php
}
ob_start();
Require( dirname(__FILE__) . '/template/home.phtml' );
ob_end_flush();
?>
Another cool trick with php is
PHP:<?php If(false) { ?> CGI is not running!? <?php } ob_start(); Require( dirname(__FILE__) . '/template/home.phtml' ); ob_end_flush(); ?>
This checks to see if php is running it also includes the php enabled HTML file. And compresses the data :3 ... I believe I haven't programmed in awhile
Sent from my SGH-T999 using Tapatalk 2