Jump to content

Parse error


jeds

Recommended Posts

I think its a script, nomenclature overwhelms me:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
<?php
if ($_SERVER['SERVER_ADDR'] = 216.40.250.54) {
?>
<strong>BLUE</strong>
<?php
} else {
?>
<strong>YELLOW</strong>
<?php
}
?>
[/quote]

I just get the Parse error

Thx
Link to comment
https://forums.phpfreaks.com/topic/8737-parse-error/
Share on other sites

Thanks, Aaron, it works great. So now I can use it to define variables:
[code]
<?php

if ($_SERVER['SERVER_ADDR'] == "216.40.250.54") {
$var = 'Bob';
$var_2 = 'Sam';
} else {
$var = 'Ralph';
$var_2 = 'Joe';
}

?>


<?php
echo "$var, $var_2";
?>
[/code]

Works too :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.