Here is the full code for your Arena Points Calculator. Remember, you file has to be named something.php unless your server is setup to run PHP in non-.php files.
See the script in action here!
<head>
<title>Arena Calculator</title>
</head>
<body>
<h2>Arena Calculator</h2>
<form action = "<?php echo $_SERVER["PHP_SELF"]; ?>"
method = "GET">
Enter Your Arena Score:
<input type = "text" name = "arena_score" size=5>
<input type = "submit" name = "Calculate Score"/>
</form>
<?php
//If there is no score entered, we will assume the default score of 1500
$arena_score = $_GET['arena_score'];
if ($arena_score == "")
{
$arena_score = 1500;
}
if ($arena_score > 1500)
{$total = (1511.26/(1+1639.28* pow(2.71818,(-0.00412 * $arena_score))));
Echo " <b>Your Score is $arena_score <br></b>";
Echo "<b>5v5:</b> " . floor($total) ." points <br>";
Echo "<b>3v3:</b> ". floor($total*.88) ." points <br>";
Echo "<b>2v2:</b> ". floor($total*.76) ." points <br>";
}
else
{$total = ($arena_score *.22) + 14;
Echo " <b>Your Score is $arena_score <br></b>";
Echo "<b>5v5:</b> " . floor($total) ." points <br>";
Echo "<b>3v3:</b> ". floor($total*.88) ." points <br>";
Echo "<b>2v2:</b> ". floor($total*.76) ." points <br>";
}
?>