A Calculator Bug

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
i just created this benefits calculator, but it doesn't work, there is
no changes happen after submitting, anyone can help in that??
<title> |||Stocks Calculator||| </title>
<style type="text/css">
body {font-size: 14pt}
.heading {font-size: 18pt; color: red}
if (!isset($_post['submit']) || $_post['submit'] != 'Calculate')
$_post['price'] = "";
$_post['sell'] = "";
$_post['pricec'] = "";
$_post['sellc'] = "";
$gain = (($_post['sell'] - $_post['sell'] * $_post['sellc']) -
($_post['price'] + $_post['price'] * $_post['pricec']));
} else {
print("Still Shit Happens");
<div align="center" id="div1" class="heading">
<b><i><u>Stocks Calculator</u></i></b></div>
<p class=blurb>Enter all the data required to get your gain calculated
by our gain calculator for stocks<br>
*Please notice: Approximatly value for commisions in the Egyptian stock
exchange is 0.005% - 0.006%.</p>

<form action="<?php echo $_server['php_self']; ?>" method="post">
<p>Buy Price:
<input type="text" size="10" name="price" value="<?php echo
$_post['price']; ?>">
<input type="text" size="5" name="pricec" value="<?php echo
$_post['pricec']; ?>">
<p>The Price you want to sell at:
<input type"text" size="10" name="sell" value="<?php echo
$_post['sell']; ?>">
<input type="text" size="5" name="sellc" value="<?php echo
$_post['sellc']; ?>">
<P><B>Net Gain :</B> <?php echo $gain; ?>
<p><input type ="submit" name="submit" value="Calculate">

Re: A Calculator Bug

Hash: SHA1

XIII wrote:

Quoted text here. Click to load it
Quoted text here. Click to load it

You have forgotten about PHP being case-sensitive. $_post is not the same as

- --  
- ----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

La documentación es el aceite de ricino de programar.
Version: GnuPG v1.4.2 (GNU/Linux)


Re: A Calculator Bug

XIII wrote:
Quoted text here. Click to load it

I stopped reading here.

      ini_set('display_errors', '1');

right before the if() line above, so that all errors, warnings and
notices are displayed in the browser.

Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
may bypass my spam filter. If it does, I may reply from another address!

Site Timeline