Forum Moderators: coopster

Message Too Old, No Replies

Math and PHP...

My brain is hurting.

         

web_young

11:05 pm on Aug 26, 2004 (gmt 0)

10+ Year Member



What am I doing wrong in this equation?

$mothly_payment= $financing_price * $monthly_interest_rate / (1 - pow(V, $month_term));

web_young

11:10 pm on Aug 26, 2004 (gmt 0)

10+ Year Member



Oops. I forgot to mention the error (might help).

Parse error: parse error, unexpected T_VARIABLE in c:\phpWeb\auto_calculator.php on line 102

The line I posted earlier is line 102.

Thanks in advance.

dkin

12:04 am on Aug 27, 2004 (gmt 0)

10+ Year Member



$mothly_payment= $financing_price * $monthly_interest_rate / (1 - pow(V, $month_term));

Now what is pow, I am not very good at debugging but it doesnt look like that is much of anything.

coopster

12:12 am on Aug 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



pow() [php.net] is a PHP function.

This parse error usually means you are missing a terminating semicolon or closing brace, etc. somewhere *higher-up* in your code.

ergophobe

12:14 am on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



pow [php.net] is a valid function, but it's first argument must be the base, so it needs to be a number

[edited by: jatar_k at 3:25 am (utc) on Aug. 27, 2004]
[edit reason] fixed link [/edit]

Timotheos

12:18 am on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or maybe a variable?

$mothly_payment= $financing_price * $monthly_interest_rate / (1 - pow($V, $month_term));

BTW you probably want $mothly_payment to be $monthly_payment

dkin

12:44 am on Aug 27, 2004 (gmt 0)

10+ Year Member



check for a semi colon on the end of line 101.

coopster

1:13 am on Aug 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Timotheos, I assumed that was a named constant [php.net].

willybfriendly

1:57 am on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Timotheos - maybe he is paying the moths in his wallet...mothly payment :)

My bet is that V is supposed to be a variable - $V - and that there is a missing semi somewhere above it.

WBF

web_young

3:05 pm on Aug 27, 2004 (gmt 0)

10+ Year Member



I was missing a semi colon on line 101. I'm also missing the $ before the V. Thanks for all your help.