Endoscient Posted April 30, 2003 Share Posted April 30, 2003 i want aif statement like this: (because one of pagesi need to cahnge code to work in IE, and fix makes it looks badin other browsers if (using-ie){ $page = page-ie.html; } else { $page=page.html; } Link to comment Share on other sites More sharing options...
0 NeoMayhem Posted April 30, 2003 Share Posted April 30, 2003 Why not just use a page that works in all browsers? Who uses IE anymore anyway? Link to comment Share on other sites More sharing options...
0 jesusOmar Posted April 30, 2003 Share Posted April 30, 2003 (edited) Not sure if this will work since I have no way of testing it at the momment but try something like this... <?php $user_browser = get_browser (); if ( ( $user_browser->browser == "MSIE" ) ) { ? ?// code to redirect to IE page ? ?$page = page-ie.html; } else { ? // Everything else goes to page.html ? $page=page.html; } ?> Note user if is MSIE exactly but the function you should be looking for is get_browser IMO. Hope that helps you. Edited April 30, 2003 by MAsKrA Link to comment Share on other sites More sharing options...
0 Endoscient Posted April 30, 2003 Author Share Posted April 30, 2003 ok thnx the layout i want to do, IE doesnt work bc of on-compliance with CSS, so to fix the problem ti screw up inother browsers Link to comment Share on other sites More sharing options...
0 Endoscient Posted April 30, 2003 Author Share Posted April 30, 2003 this is my code $browser = get_browser (); if ($browser->browser == "MSIE") { file = "page-ie.html"; } else { $file = "page.html"; } it doesnt work. always gies the else, im in IE 6 btw Link to comment Share on other sites More sharing options...
0 m0fo Posted April 30, 2003 Share Posted April 30, 2003 try this: <?php $browser = strpos($_SERVER['HTTP_USER_AGENT'], "MSIE"); if($browser) { header("location: index_ie.html"); } else { header("location: index.html"); } ?> Link to comment Share on other sites More sharing options...
0 Endoscient Posted April 30, 2003 Author Share Posted April 30, 2003 i changed the header ones to the variable and it worked. thanks a lot. now the pages look the same in IE and mozilla Link to comment Share on other sites More sharing options...
Question
Endoscient
i want aif statement like this: (because one of pagesi need to cahnge code to work in IE, and fix makes it looks badin other browsers
if (using-ie){
$page = page-ie.html;
}
else {
$page=page.html;
}
Link to comment
Share on other sites
6 answers to this question
Recommended Posts