Jump to content

Archived

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

jeds

Parse error

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

Share this post


Link to post
Share on other sites
Hi,

[code]
<?php

if ($_SERVER['SERVER_ADDR'] == "216.40.250.54") {
    echo "<strong>Not Found</strong>";
} else {
    echo "<strong>We Got It!</strong>";
}

?>
[/code]

That should do it

Aaron

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

×

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.