PDA

View Full Version : PHP code not working?



fedor
01-24-2007, 05:59 PM
Why doesn't this code work
When I code this out:
$ip = $_SERVER['REMOTE_ADDR'];

echo "Your IP address is: $ip";
It comes out:
$ip = $_SERVER['REMOTE_ADDR'];

echo "Your IP address is: $ip";
Why does it do that?:( I used notepad to code it saved it in a .php extension...
PHP version: 4

seven
01-24-2007, 06:08 PM
<? $ip = $_SERVER['REMOTE_ADDR'];

echo "Your IP address is: $ip"; ?>

fedor
01-24-2007, 06:11 PM
Thanks but why does it do that? (My problem)

seven
01-24-2007, 06:20 PM
I'm assuming the code you shown in your first post is all you used.
the code is not enclosed <? ?>

fedor
01-24-2007, 06:27 PM
how very very very stupid of me:(
I just started learning PHP really...