Jump to content


Photo

Is this right


  • Please log in to reply
4 replies to this topic

#1 .-INSANE-.

.-INSANE-.
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 21 March 2006 - 03:35 AM

<?php 
$get = $REMOTE_ADDR
echo Your IP is "$REMOTE_ADDR" !!!
?>

ok i was jus trying to see if i can sum of this stuff i kno its prolly wrong but what am i missing dont flame me im new to PHP

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 21 March 2006 - 04:30 AM

No, REMOTE_ADDR is stored in the superglobal array $_SERVER and you don't have your quotes correct.

Try:
<?php echo 'Your IP is ' . $_SERVER['REMOTE_ADDR'] .' !!!'; ?>

Ken

#3 .-INSANE-.

.-INSANE-.
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 21 March 2006 - 04:38 AM

ok so this is how its supposed to be now

<?php
$get = $REMOTE_ADDR
echo 'Your IP is ' . $_SERVER['REMOTE_ADDR'] .' !!!';
?>

cuz for sum reason the $get = $remote-addr part doesnt seem right is it?

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 21 March 2006 - 04:40 AM

You don't need that line at all.

Ken

#5 .-INSANE-.

.-INSANE-.
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 22 March 2006 - 04:17 AM

ok i dont need the get part
i thought i needed it




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users