Re: [PHP] Calculation assistance.. :)

2008-09-19 Thread Eugene Mah
I think you need to do pow((1+$nMonthlyInterest),($iMonths*-1))

Eugene

Stephen Johnson wrote:
 Right ... But that is producing even funkier results...
 
  doing pow( (1-(1+$nMonthlyInterest)) , ($iMonths*-1) ) ;
 
 Gives me : 
 
 4.2502451372964E-35 = 25000 * (0.00104167 / 6.1270975733019E+35);
 
 
 --
 Stephen Johnson c | eh
 The Lone Coder
 
 http://www.thelonecoder.com
 continuing the struggle against bad code
 
 http://www.fortheloveofgeeks.com
 I¹m a geek and I¹m OK!
 --
 
 
 
 
 From: Eric Gorr [EMAIL PROTECTED]

 I believe what you are looking is:

 http://us2.php.net/manual/en/function.pow.php

 number pow  ( number $base  , number $exp  )
 Returns base raised to the power of exp



 On Sep 19, 2008, at 3:34 PM, Stephen Johnson wrote:

 OK.. Math is NOT my forte ...

 I am converting a site from ASP to PHP ... And this calc is in the
 ASP Code
 :

$nMonthlyInterest = $nRate / (12 * 100)

//' Calculate monthly payment
$nPayment = $nPrincipal * ( $nMonthlyInterest / (1 - (1 +
 $nMonthlyInterest) ^ -$iMonths))

 Which then gives me in PHP
 0.00104167 = 1.25 / (12 * 100);
 -2.170138889 = 25000 * ( 0.00104167 / (1 - (1 +
 0.00104167) ^ -12)) ::

 ^  is the problem ...

 The solution SHOULD be  2,097.47 ... Not ­2.17

 Would be willing to help correct this and make it valid in PHP?
 
 
 


-- 
-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   [EMAIL PROTECTED]
Medical University of South Carolina  For I am a Bear of Very Little
Charleston, South Carolina Brain, and long words Bother
http://www.netcom.com/~eugenem/me.   Winnie the Pooh
http://radinfo.musc.edu/~eugenem/blog/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Google Chrome

2008-09-04 Thread Eugene Mah
Shawn McKenzie wrote:

 Will somebody volunteer to test on Wine or Mono?
 
 -Shawn
 
already done by this guy
http://www.myscienceisbetter.info/2008/09/install-google-chrome-on-linux-using-wine.html

eugene
-- 
-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   [EMAIL PROTECTED]
Medical University of South Carolina  For I am a Bear of Very Little
Charleston, South Carolina Brain, and long words Bother
http://www.netcom.com/~eugenem/me.   Winnie the Pooh
http://radinfo.musc.edu/~eugenem/blog/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] newbie help, pressing the submit button returns nothing

2003-04-04 Thread Eugene Mah
At 08:24 04-04-03 -0500, you wrote:
On Friday 04 April 2003 07:43 am, Petre Agenbag wrote:
 Your problem is not with PHP but with basic HTML.
 Your FORM tag needs an action=www.somepage.com in order to do
 something. With PHP, you can call the same page back onto itself.
Hi Petre, Thanks for the reply, I have actually tried this too and all the
output I get is Welcome ! but the username that was entered into the form
box should appear between the Welcome and !, Please take a look at the code
below:
First page named: jobapp.html

-HTML
!-- Jobapp.html--
BODY
H1Practice app/H1
pFill in the name and echo it back to the user./p
FORM NAME='frmJobApp' METHOD=post action=jobapp_action.php
Please enter your name:
INPUT NAME=applicant TYPE=textbr
INPUT NAME=enter TYPE=submit VALUE=Enter
/FORM
/BODY
/HTML
---
Second page: named jobapp_action.php
Welcome ?php echo $applicant; ?!
Unless your register_globals is set to on,
you should be using
?PHP echo $_POST['applicant']; ?

instead

Eugene

-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   For I am a Bear of Very Little
Medical University of South Carolina   Brain, and long words Bother
Charleston, South Carolina me.   Winnie the Pooh
http://www.netcom.com/~eugenem/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] issues with PHP 4.1.2 / solaris 2.6 / gcc 3.1

2002-06-26 Thread Eugene Mah

After replacing hard drives and reinstalling solaris 2.6 onto
my Sparc 20, I'm getting the following error when starting up
Apache 1.3.26 and PHP 4.1.2

Syntax error on line 205 of /export/home/eugenem/apache/conf/httpd.conf:
/export/home/eugenem/apache/bin/httpd: fatal: relocation error: file
/export/home/eugenem/apache/libexec/libphp4.so: symbol ap_block_alarms:
referenced symbol not found

I've also been having problems building mod_perl into Apache, but
that's a question for another list.

Aside from a new version of Apache, this combination was working
quite well on my system before having to redo everything.
I'm starting to suspect gcc (3.1), but everything (Apache, PHP, MySQL)
compiles without complaint.  that said, everything on the old system
was built using gcc 3.0.4 or 2.96.3 instead of gcc 3.1.
i may end up going back to gcc 3.0.4 to see if i can get things working
again.

when compiling php 4.2.1 on solaris 2.6/gcc 3.1, i also get an error
about not finding unix.h.

Can anybody offer any suggestions?

thanks
eugene


--
-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   For I am a Bear of Very Little
Medical University of South Carolina   Brain, and long words Bother
Charleston, South Carolina me.   Winnie the Pooh
http://home.netcom.com/~eugenem/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mysql_num_rows always returns 1?

2002-06-18 Thread Eugene Mah

At 13:00 18-06-02 +0100, Mark Colvin wrote:
The function below works when I pass in a valid username and password and
returns '1'. When I pass a username and password that is not in the database
it still returns '1'. I have put some echo statements in for debugging and
the value of $numresult is always '1'. Does mysql_num_rows retain results in
memory or something like that or am I completely going down the wrong road?

that's because when 'select count(*)' = 0 when it finds no results.
So you get a record returned to $result with a single line that tells
you count(*) was 0.

what you should probably do is instead of counting, check for a valid
username/password returned by your query.  if they're blank, then
$user/$pass are either incorrect or not in your users table.

or, as someone else suggested, check the value of count(*)
rather than the number of lines returned by the query.

Eugene

--
-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   For I am a Bear of Very Little
Medical University of South Carolina   Brain, and long words Bother
Charleston, South Carolina me.   Winnie the Pooh
http://home.netcom.com/~eugenem/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP editing environment

2002-05-03 Thread Eugene Mah



  -Original Message-
  From: Pag [mailto:[EMAIL PROTECTED]]
  Sent: Friday, May 03, 2002 4:59 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] PHP editing environment

Anyone know how i can make my work more efficient? Like install
  MySQL and
  PHP and get everything working normally when i preview the code in
  internet
  explorer, that would be perfect, is it possible? How do you guys and
girls
  work with php, what editors and/or tools you use?

Download and install the windows installers for Apache and MySQL
and you'll have a very functional server for testing your code before
uploading it to your production server.  I've got them all running under
WinXP Home quite nicely.

I have both Apache and MySQL servers set to start up manually
(don't need them running all the time, and especially don't want
them running while I'm connected to the net).

I use Emacs/html-helper-mode or HTML-Edit (www.chami.com)
depending on the mood I'm in to write my code (doesn't anybody
work with raw HTML anymore?)

I preview with Mozilla and IE 6 (HTML-Edit also offers preview
capabilities, although I haven't figured out how to make it preview
PHP pages yet).

Eugene

--
-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   For I am a Bear of Very Little
Medical University of South Carolina   Brain, and long words Bother
Charleston, South Carolina me.   Winnie the Pooh
http://home.netcom.com/~eugenem/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] checkbox doesn't pass?

2002-04-04 Thread Eugene Mah

At 18:17 04-04-02 +0300, savaidis wrote:

But IF I still want  to use $HTTP_POST_VARS, what then? What about the
warning when checkbox is not checked?
I use empty() to check the for the existence of checkbox variables.


--
-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   For I am a Bear of Very Little
Medical University of South Carolina   Brain, and long words Bother
Charleston, South Carolina me.   Winnie the Pooh
http://home.netcom.com/~eugenem/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Text Editor with Highlighting

2001-11-01 Thread Eugene Mah

At 10:02 PM 11/01/2001 +0100, TD - Sales International Holland B.V. wrote:
Hey there,

I looked on the site for this but couldn't find anything about it. I'd like a
list of your favorite text editors (preferable for Linux/XFree) with
highlighting.

emacs!
:)

Eugene


--
To put my contact info into your Palm device, click here:
http://signature.coola.com/?[EMAIL PROTECTED]
Personal Signature Coolet
-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   For I am a Bear of Very Little
Medical University of South Carolina   Brain, and long words Bother
Charleston, South Carolina me.   Winnie the Pooh
http://home.netcom.com/~eugenem/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-


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