PDA

View Full Version : *simple* PHP print html only for IE



JAB Creations
Sun 23rd May '04, 5:55am
Hello everyone!

This code will just print out HTML only *IF* it detects IE.
<if condition="is_browser('ie')">
<div class="div-content">
<else />
</if>


This code is to counter that by adjusting the site if it does not detect IE.

<if condition="is_browser('ie')">
<else />
<table border="0" cellpadding="0" cellspacing="0" class="table-content-forum"><tr><td>
</if>


This is found in my admin in the common templets in the header box. These codes allow all browsers to scroll correctly instead of having to click and drag the scrollbar which requires effort, and we don't like having to make an effort!! :D

Alas we aren't in the right place if we don't want to make an effort :mad: IoI....

Anyway I want to stick this code into a regular PHP file but I keep getting all sorts of funky stuff messing up the php file at server side.

So how do I correct the syntex? Am I correct in assuming that the header box is just the content for the $header string? I'm sure it's something blatantly simple. :rolleyes:

Zachery
Sun 23rd May '04, 6:01am
The if template conditionals only work with templates, and is_browser function will only work if your connecting to global.php or you copy the function into your own file :)

JAB Creations
Sun 23rd May '04, 8:36am
<?php include("http://www.jabcreations.com/community/global.php")?>

It seems that is correct but I get a parse error on the next line...

this is in another includes.php file...

<?php if condition="is_browser('ie')" ?>
<else />
<table border=0 cellpadding=0 cellspacing=0 class=table-content-forum><tr><td></if>';

So how do I take out the carrots? I have unsuccessfully taken the carrots out and the code never has worked or at least gotten past the line it recieves a parse error from, meaning I figure at least you have to do something else when you're not using carrots...peas? :confused:

qxh
Sun 30th May '04, 7:13am
Don't include the URL, include the path.

<?php include('./community/global.php'); ?>

(you may need to adjust the path though)

Zachery
Sun 30th May '04, 10:41am
Also if your going to use it in php, you need to use the real ifs

If ( condition here ){
some php here
}