[PHP] Convert to int...?

2001-08-22 Thread Seb Frost

I didn't think php was this fussy, but the following code seems to not work
because the numbers are floats.  round() doesn't seem to help either:

$siz=(72/160)*GetImageWidth($fileID);
$offx=(8/160)*GetImageWidth($fileID);
$offy=(1/2)*GetImageHeight($fileID);

ImageTTFText ($im, $siz, 0, $offx, $offy, $red, cour.ttf,PROOF);

Works fine if I just put $siz=72; etc

- seb

-Original Message-
From: Tribun [mailto:[EMAIL PROTECTED]]
Sent: 16 August 2001 08:30
To: [EMAIL PROTECTED]
Subject: [PHP] .htaccess username


...hmmm, I would guess there is a way, but I dont know why...

Can I read out the active username, which has just logged in through a
.htaccess authentication???

Like the access data..
user: patrick
pass: linux

can PHP reads out the usersname patrick ??

(and if ,... how? ;)

10x 4 U'r time.

Patrick




--
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]




RE: [PHP] Convert to int...?

2001-08-22 Thread Michael Geier, CDM Systems Admin

(int)$siz will give you what you are looking for.  although with the math
below, you are going to end up with 0.

$siz = 72 / 160;//returns 0.45
echo round($siz);   //returns 0
echo (int)$siz; //returns 0

-Original Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 22, 2001 10:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Convert to int...?


I didn't think php was this fussy, but the following code seems to not work
because the numbers are floats.  round() doesn't seem to help either:

$siz=(72/160)*GetImageWidth($fileID);
$offx=(8/160)*GetImageWidth($fileID);
$offy=(1/2)*GetImageHeight($fileID);

ImageTTFText ($im, $siz, 0, $offx, $offy, $red, cour.ttf,PROOF);

Works fine if I just put $siz=72; etc

- seb

-Original Message-
From: Tribun [mailto:[EMAIL PROTECTED]]
Sent: 16 August 2001 08:30
To: [EMAIL PROTECTED]
Subject: [PHP] .htaccess username


...hmmm, I would guess there is a way, but I dont know why...

Can I read out the active username, which has just logged in through a
.htaccess authentication???

Like the access data..
user: patrick
pass: linux

can PHP reads out the usersname patrick ??

(and if ,... how? ;)

10x 4 U'r time.

Patrick




--
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]


-- 
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]