PDA

View Full Version : iPhone Roadmap problem


rick178787
03-05-2010, 10:29 AM
the Road Map has this code:

<?php if(strpos($_SERVER['HTTP_USER_AGENT'], ‘iPhone’) !== false) { ?>
<link media="all" href="../iPhone_css/iPhone.css" type= "text/css" rel="stylesheet">
<?php } else { ?>
<link media="all" href="../CSSSculptor/1ColumnLiquidCenteredHeaderandFooter_Pacifica0_css/screen.css" type= "text/css" rel="stylesheet">
<?php } ?>

(adjusted for my directory structure). The iPhone_css code is actually the css file from the bottom of the Road Map

The code produces this error:


Notice: Use of undefined constant ‘iPhone’ - assumed '‘iPhone’' in /vservers/xxxxxx/htdocs/index.php on line 7

Line 7 is the first line of php above.

Jason Byrnes
03-05-2010, 10:34 AM
the code on line 7 should be:
<?php if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false) { ?>

rick178787
03-05-2010, 10:56 AM
Thanks!

But I don't see any change in the code. What was it?

Jason Byrnes
03-05-2010, 11:00 AM
the quotes around iPhone are wrong:

original:
‘iPhone’

fixed:
'iPhone'


yes, php is that picky

rick178787
03-05-2010, 11:02 AM
Wow...you are King!