Computer Forum  

Go Back   Computer Forum > Computer Forums > Programming Forum > PHP Forum

PHP Forum PHP Forum. PHP Programming questions and answers here.


Having problems with a php conditional statement?

PHP Forum

PHP Forum. PHP Programming questions and answers here.


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-24-2008, 04:22 PM
Junior Member
 
Join Date: Aug 2008
Posts: 2
Mat@InternetPcSolutions.com RSS Feed
Having problems with a php conditional statement?

Hi I have been trying to use this code to load a module with certain contents if the browser is ie6 or lower and load other contents if the browser is anything but ie 6 or below. I cannot get this code to function correctly, it always shows the second content whether the browser is ie 6 or not. I have also tryed other browsers and code variations and nothing has helped me yet. I am posting the code below can anybody tell me what I am doing wrong?
Thank you.

<?php
$ua = get_browser ();
if ( ( $ua->browser == "IE" ) && ( $ua->version <= 6.0 ) ) {?>

<div>first content</div>

<?php } else { ?>

<div>second content</div>

<?php }?>



Please help I tried to post this before but only got a "what? seriously" response.
Please tell me what I am doing wrong im trying to get better at this.

Thank you
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I write an if statement to check if mysql is empty? project96gsr Mysql Forum 2 07-16-2008 04:13 PM
Is the below statement true ? I read it on Wikipedia.? Zach Wikipedia Forum 8 07-12-2008 01:09 AM
What am I doing wrong with this PHP mySQL INSERT statement? I can't seem to get Michael Y Mysql Forum 0 06-20-2008 12:22 AM
need in sql statement in mysql? benaya p Mysql Forum 0 06-06-2008 01:24 AM
Can anybody help me on this C++ program using switch case statement. And also... joycee C++ Forum 0 06-04-2008 02:49 AM


All times are GMT. The time now is 11:14 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93