alvinchua Posted January 24, 2009 Share Posted January 24, 2009 i cant do subtraction is the following code and the area has been bold.. which is $Stoploss2 = $Ask - $StopLoss; do not provide me a value.. HELP !! <?php //$StopLoss = ''; //$TL=''; //if (isset($_POST['MaxPP'])) if (isset($HTTP_POST_VARS['Submit'])) { $MaxPP=$_POST['MaxPP']; //echo $MaxPP; } elseif (isset($HTTP_POST_VARS['Submit2'])) { $Bid = $_POST['Bid']; $Ask = $_POST['Ask']; $Ask = (int)$Ask; echo $Ask; //$Ask2 = $Ask - $StopLoss; //echo $Ask2; } /*else { $StopLoss =''; $TL=''; echo $StopLoss; echo $TL; exit; }*/ ?> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Forex Calculator</title> </head> <body> <form method ="post"> <!--webbot bot="SaveResults" U-File="C:\xampp\htdocs\forex\_private\form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --> <p> </p> <p> <input type="text" name="textfield"> </p> <p> </p> <table width="631" border="1"> <tr> <td width="241" height="37">Insert MaxPP Value: </td> <td width="120"><input type="text" name="MaxPP" size="20" id="MaxPP"></td> <td width="90"><div align="center">Buy</div></td> <td width="90"><div align="center">Sell</div></td> <td width="56"> </td> </tr> <tr> <td> </td> <td><input type="submit" value="Submit" name="Submit"> <input type="reset" value="Reset" name="B2"></td> <td><input type="text" name="Ask" size="15" id="Ask"></td> <td><input type="text" name="Bid" size="15" id="Bid"></td> <td><input type="submit" name="Submit2" value="Submit"></td> </tr> <tr> <td>Stop Loss : </td> <td> <?php $StopLoss=$MaxPP+15; $StopLoss = (int)$StopLoss; echo $StopLoss; ?></td> <td> <?php $Ask = $Ask - 2; $StopLoss = $StopLoss -2; echo $Ask; echo $StopLoss; [b]$Stoploss2 = $Ask - $StopLoss; [/b] print ($StopLoss2); ?></td> <td> </td> <td> </td> </tr> <tr> <td>Profit Target : </td> <td> <?php $PT = $StopLoss * 2; echo $PT;?> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td>Trailing Loss : </td> <td> <?php $TL = $StopLoss *0.75; echo $TL;?> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <p> </p> <p> </p> <p> </p> <?php print $StopLoss; ?> </form> </body> </html> $StopLoss2 does not print any value ??? please advice .. thanks you Link to comment https://forums.phpfreaks.com/topic/142219-cant-do-substract-help/ Share on other sites More sharing options...
9three Posted January 24, 2009 Share Posted January 24, 2009 1. Do not use HTTP_POST_VARS 2. Remove the: [b] [/b] Link to comment https://forums.phpfreaks.com/topic/142219-cant-do-substract-help/#findComment-745088 Share on other sites More sharing options...
uniflare Posted January 24, 2009 Share Posted January 24, 2009 replace $HTTP_POST_VARS with $_POST. also u made a case-sensitive mistake: $Stoploss2 = $Ask - $StopLoss; should be $StopLoss2 = $Ask - $StopLoss; Link to comment https://forums.phpfreaks.com/topic/142219-cant-do-substract-help/#findComment-745092 Share on other sites More sharing options...
9three Posted January 24, 2009 Share Posted January 24, 2009 replace $HTTP_POST_VARS with $_POST. also u made a case-sensitive mistake: $Stoploss2 = $Ask - $StopLoss; should be $StopLoss2 = $Ask - $StopLoss; good looking out Link to comment https://forums.phpfreaks.com/topic/142219-cant-do-substract-help/#findComment-745093 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.