Jump to content

deathstrike369

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

deathstrike369's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks for the replies, i tried to look for the answer i figured someone would of asked i did not find any relevant ones, all the ones asked were dealing with mySQL which i am not utilizing ill try them out and see which one works best for my use thanks again
  2. I need to know if there is anyway i can use either sessions or the form submission it self to make a combo box have the selected value from the form showing after the page reloads (its submitted to itself) if there is a way i would like to know how to do it, or if there is a site i can read up on it. <select name="defpt" value="<?php echo htmlentities($_post["defpt"]); ?>"> <option value=".9">attacker</option> <option value=".9">Economist</option> <option value="1.15">Miner</option> <option value="1.5">Explorer</option> <option value="1">Standard</option> <option value="1.1">Researcher</option> </select> <br /> Council: <select name="DefensiveCouncil"> <option value="1.2">System Commander</option> <option value="1.15">Vice System Commander</option> <option value="1.15">Fleet Admiral</option> <option value="1.12">Vice Fleet Admiral</option> <option value="1">Starship Fleet Leader</option> <option value="1.12">Fighter squadron leader</option> <option value="1">Intelligence Officer</option> <option value="1">Secretary of treasury</option> <option value="1">Nooby Advisor</option> this are part of the combo boxes i am using, as you see i tried to use the session to set a default but it did not work.
  3. You need to send: <input type="text" readonly="readonly" name="sendammount" value="<?php echo $_POST['sendammount'] ?>" /><br /> this is where the result is supposed to be posted into im gonna get some sleep and give it another go in the morning with fresh eyes, if you can help with this, then i would appreciate it very much
  4. the code has a lot of values, i tried to keep it short.... <form action="att.php" name="fighters" method="post" > <p> AH-64 Apache:<input name="python" type="text" value="<?php echo htmlentities($_POST['python']) ?>" /> <br /> UH-60 Blackhawk:<input name="lance" type="text" value="<?php echo htmlentities($_POST['lance']) ?>"/> <br /> F-14 Tomcat:<input name="phenix" type="text" value="<?php echo htmlentities($_POST['phenix']) ?>"/> <br /> F-18 Hornet:<input name="tweet" type="text" value="<?php echo htmlentities($_POST['tweet']) ?>" /> <br /> F-15E Strike Eagle:<input name="super" type="text" value="<?php echo htmlentities($_POST['super']) ?>" /> <br /> FA-22 Raptor:<input name="indie" type="text" value="<?php echo htmlentities($_POST['indie']) ?>" /> <br /> Turrets: <input name="turrets" type="text" value="<?php echo htmlentities($_POST['turrets']) ?>" /> <br /> Upgrade? <input name="upgrade" type="checkbox" value="1.34" /> </p> <br /> <strong>Bonuses</strong> <p>Defending player</p> Player Type: <select name="defpt"> <option value=".9">attacker</option> <option value=".9">Economist</option> <option value="1.15">Miner</option> <option value="1.5">Explorer</option> <option value="1">Standard</option> <option value="1.1">Researcher</option> </select> <br /> Council: <select name="DefensiveCouncil"> <option value="1.2">System Commander</option> <option value="1.15">Vice System Commander</option> <option value="1.15">Fleet Admiral</option> <option value="1.12">Vice Fleet Admiral</option> <option value="1">Starship Fleet Leader</option> <option value="1.12">Fighter squadron leader</option> <option value="1">Intelligence Officer</option> <option value="1">Secretary of treasury</option> <option value="1">Nooby Advisor</option> </select> <br /> Sector Bonus: <select name="defensivesector"> <option value="1.1">Sector Leader</option> <option value="1.05">Vice Sector Leader</option> <option value="1">None</option> </select> <br /> Private system with defensive bonus? <select name="psdef"> <option value="1">No</option> <option value="1.2">Yes</option> </select> <br /> Research: <select name="defres"> <option value="1">namele(none)</option> <option value="1.02">Lasers mark I</option> <option value="1.04">Lasers mark II</option> <option value="1.06">Lasers mark III</option> <option value="1.08">Lasers mark IV</option> <option value="1.1">Lasers mark V</option> <option value="1.2">Dual Lasers</option> </select> <br /> Titan (experimental) <select name="deftitan"> <option value="1.12">Yes</option> <option value="1">No</option> <option value="1.12">Dont know, assume yes</option> </select> <br /> Alert status: <select name="defalert"> <option value="1.1">red</option> <option value="1.02">orange</option> <option value="1">yellow</option> <option value=".95">green</option> </select> <br /> Is this a bot? <select name="bot"> <option value="1">No</option> <option value="2">yes</option> </select> <p>Attacking player</p> player: <select name="attpt"> <option value="1.5">attacker</option> <option value=".9">Economist</option> <option value="1">Miner</option> <option value=".5">Explorer</option> <option value="1">Standard</option> <option value="1">Researcher</option> </select> <br /> Council: <select name="AttackingCouncil"> <option value="1.2">System Commander</option> <option value="1.15">Vice System Commander</option> <option value="1.15">Fleet Admiral</option> <option value="1.12">Vice Fleet Admiral</option> <option value="1">Starship Fleet Leader</option> <option value="1.12">Fighter squadron leader</option> <option value="1">Intelligence Officer</option> <option value="1">Secretary of treasury</option> <option value="1">Nooby Advisor</option> </select> <br /> Sector Bonus: <select name="AttackingSector"> <option value="1.1">Sector Leader</option> <option value="1.05">Vice Sector Leader</option> <option value="1">None</option> </select> <br /> Private system with attack bonus? <select name="psatt"> <option value="1">No</option> <option value="1.6">Yes</option> </select> <br /> Research: <select name="attres"> <option value="1">(none)</option> <option value="1.02">Torpedoes mark I</option> <option value="1.04">Torpedoes mark II</option> <option value="1.06">Torpedoes mark III</option> <option value="1.08">Torpedoes mark IV</option> <option value="1.1">Torpedoes mark V</option> <option value="1.2">Photon Torpedoes </option> </select> <br /> Titan(experimental) <select name="atttitan"> <option value="1.12">Yes</option> <option value="1">No</option> <option value="1.12">Dont know, assume yes</option> </select> Attacking with? <select name="fightertype"> <option value="20">FA-22 Raptor</option> <option value="11">F-15E Strike Eagle</option> <option value="4">F-18 Hornet</option> <option value="10">F-14 Tomcat</option> <option value="2">UH-60 Blackhawk</option> <option value="5">AH-64 Apache</option> </select> <br /> Zero power? <select name="zeorpower"> <option value="1">No</option> <option value="1.8" >Yes</option> </select> <br /> Alert status: <select name="alert"> <option value="1.1">red</option> <option value="1.02">orange</option> <option value="1">yellow</option> <option value=".95">green</option> </select> <br /> Oversend: <select name="oversend"> <option value="1.1">10%</option> <option value="1.05">5%</option> <option value="1">NONE</option> </select> <input type="submit" name="attackbonusnumber" value="calculate bonus" /> <br /> Your attack Bonus is: <input type="text" name="attbonnum" readonly="readonly" value="<?php echo $_POST['attwith'] ?>" /> <br /> Your enemies fighter count is: <input type="text" name="Fighternum" readonly="readonly" value="<?php echo $_POST['number'] ?>" /> <br /> You need to send: <input type="text" readonly="readonly" name="sendammount" value="<?php echo $_POST['sendammount'] ?>" /><br /> <br /> <input type='text' readonly='readonly' name="tydeath" /> <br /> </form> <table border=2> <tr> <td><a href="Homecalc.htm">Homes</a></td> <td><a href="pkcal.htm">PkCalc</a></td> <td><a href="sscalc.htm">Starship Calc</a></td> <td><a href="attcalc.htm">Fighter Calc</a></td> </tr> </table> </body> </html> </php> the main jist of this is that i am converting from html to php, for security and for reliability on html it works perfectly (the formulas and values) but from the testing and debugging ive done on the php code it does not seem to be accepting the submit
  5. I have a form that i need to show certain calculation on a form. these are the calculations, the form is to long but i will add the code that relate to where i need to add the calculations. the problem i have is that nothing shows up. <br /> Your attack Bonus is: <input type="text" name="attbonnum" readonly="readonly" value="<?php echo $_POST['attwith'] ?>" /> <br /> Your enemies fighter count is: <input type="text" name="Fighternum" readonly="readonly" value="<?php echo $_POST['number'] ?>" /> <br /> You need to send: <input type="text" readonly="readonly" name="sendammount" value="<?php echo $_POST['sendammount'] ?>" /><br /> $sector= $_POST ["AttackingSector"]; $council= $_POST ["AttackingCouncil"]; $playtype= $_POST ["attpt"]; $system= $_POST ["psatt"]; $titan= $_POST ["atttitan"]; $bot= $_POST ["bot"]; $power= $_POST ["zeorpower"]; $attalert= $_POST ["alert"]; $attres= $_POST ["attres"]; $oversend= $_POST ["oversend"]; $bonus= ($sector * $council * $playtype * $system * $titan * $bot * $power * $attalert * $attres); $defsec= $_POST ["defensivesector"]; $defcouncil= $_POST["DefensiveCouncil"]; $defpt= $_POST ["defpt"]; $defsystem= $_POST ["psdef"]; $deftitan= $_POST ["deftitan"]; $defalert= $_POST ["defalert"]; $defres= $_POST ["defres"]; $defbonus= ($defsec * $defcouncil * $defpt * $defsystem * $deftitan*$defalert * $defres * $oversend); if($bonus == 0){ $bonus =1;} if($defbonus == 0){ $defbonus = 1;} $attwith= $bonus / $defbonus; $python= $_POST ["python"]; $lance= $_POST ["lance"]; $pheonix= $_POST ["phenix"]; $tweet= $_POST ["tweet"]; $superator= $_POST ["super"]; $indie= $_POST ["indie"]; $turret= $_POST ["turrets"]; $ship= $_POST ["fightertype"]; $shipp= $python * 10; $shipl= $lance * 2; $shipP = $pheonix * 5; $shipt= $tweet * 4; $ships= $superator * 11; $shipi= $indie * 20; $shiptu= ($turret * 6); $shipcountotal= ($shipp + $shipl + $shipP + $shipt + $ships + $shipi + $shiptu); if ($shipcountotal == 0) {$shipcountotal = 1;} if($ship == 0){ $ship = 1;} $number= $shipcountotal / $ship; $sendammount = ceil($number / $attwith); ?>
  6. sigh... its always a semicolon... Thanks a lot man
  7. ok so im working on this calculator for some friends to help them in the game we all play, i got a simple html one working but i want to switch it to php. the problem i have is im getting a syntax error and i cannot figure out what it is <?php $sector= $_POST ["AttackingSector"]; $council= $_POST ["AttackingCouncil"]; $playtype= $_POST ["attpt"]; $system= $_POST ["psatt"]; $titan= $_POST ["atttitan"]; $bot= $_POST ["bot"]; $power= $_POST ["zeorpower"]; $attalert= $_POST ["alert"]; $attres= $_POST ["attres"]; $oversend= $_POST ["oversend"]; $bonus= $_POST ($sector * $council * $playtype * $system * $titan * $bot * $power * $attalert * $attres); $defsec= $_POST ["defensivesector"]; $defcouncil= $_POST["DefensiveCouncil"]; $defpt= $_POST ["defpt"]; $defsystem= $_POST ["psdef"]; $deftitan= $_POST ["deftitan"]; $defalert= $_POST ["defalert"]; $defres= $_POST ["defres"]; $defbonus= $defsec * $defcouncil * $defpt * $defsystem * $deftitan * $defalert * $defres * $oversend; $attwith= $bonus / $defbonus; $python= $_POST ["python"]; $lance= $_POST ["lance"]; $pheonix= $_POST ["phenix"]; $tweet= $_POST ["tweet"]; $superator= $_POST ["super"]; $indie= $_POST ["indie"]; $turret= $_POST ["turrets"]; $ship= $_POST ["fightertype"]; $shipp= $python * 10; $shipl= $lance * 2; $shipP = $pheonix * 5; $shipt= $tweet * 4; $ships= $superator * 11; $shipi= $indie * 20; $shiptu= ($turret * 6); $shipcountotal= $shipp + $shipl + $shipP + $shipt + $ships + $shipi + $shiptu; $number= $shipcountotal / $ship $sendammount ?/>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.