Another way of displaying PHP?

Soldato
Joined
16 Oct 2007
Posts
7,480
Location
UK
Hello all,

I've got a bit of PHP code i'm trying to insert into a HTML page

But the HTML page for some reason won't display it as it's a HTML within a PHP page already

Any way

I'm trying to think of other ways of displaying this PHP output

At the moment, i'm using an iframe to show the PHP file which outputs the 1 sentance i need to show

But it looks rubbish in older browsers.

Any other way that i can use to show it?

http://www.workingaway.co.uk (job count at the top)

thanks!
 
Can you not just make the index page a PHP page and insert the code in there?

Also tables shouldn't be used to create a page layout.
 
the main page calls upon the html template to layout the homepage - but i need to put the php code in the html bit (it works in the main page, but obviously in completely the wrong place!)
 
Most of my site's use Smarty, all the page suffixes remain as .html but you can insert any php code that isn't covered by a Smarty function by using {!php}whatever{!/php}
 
If your hosting solution isn't parsing .html and .htm files then you can never get it to run PHP code within it. It must use a .php extension in order for the server to execute it unless using a solution like Cuchulain is.
 
rename the file to something like index.php keeping the html within it.
so something like
Code:
<?php include('any mysql_conn ,  etc');?>

<html>
<head>
</head>
<body>
</body>
</html>
 
Back
Top Bottom