Troy,
$REMOTE_ADDR gives you the client IP.

To convert a number to show 2 decimals use "sprintf":

$money = 5;

$money_string = sprintf("%.2f", $money); // $money_string will be 5.00

Cheers,
Kelly.

> -----Original Message-----
> From: Troy Lynch [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 14 September 2001 8:49 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Getting ip address of client and displaying a number in
> decimal format.
> 
> 
> I'm trying to find out how to do 2 things one. I'd like to get the ip
> address of the client machine so I can write it to a database. 
> And then I'd
> like to convert a number to show 2 decmials to the right like for money
> etc....
> 
> 
> Thanks
> 
> Troy
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to