Need to fix my code Need to fix my code Solution 10 printHE

Need to fix my code.

Need to fix my code.

Solution

<php

$charName = $_POST[\'charName\'];

$charType = $_POST[\'charType\'];

$healthToken = $_POST[\'heathTokens\'];

$expTokens = $_POST[\'expTokens\'];

$supplyTokens = $_POST[\'supplyTokens\'];

$goldSpent = $healthTokens/10 + $expTokens/2 + $supplyTokens/25;

if ($goldSpent > 10) {

print(\"<h1>HEY THERE, $charName! </h1> \");

print(\"<p> YOU SPEND MORE GOLD THAN YOU HAVE! </p>\");

print(\"<p> GO BACK AND TRY THAT AGAIN - YOU HAVE 10 GOLD PIECES...</p>\");

}elseif ($charType ==\' elf\') {

$healthTokens = $_POST[\'heathTokens\'] + 5;

}elseif ($charType == \'wizard\') {

$expTokens = $_POST[\'expTokens\'] + 2;

}elseif ($charType == \'human\' || $charType == \'dwarf\') {

$supplyTokens = $_POST[\'supplyTokens] + 10;

}

$totalGold = 10;

$goldLeft = $totalGold - $goldSpent;

print(\"<h1> You have created $charName the $charType! </h1>\");

print(\"<p> $charName has <strong>$healthTokens </strong>heath tokens,

<strong>$expTokens</strong> experieence tokens, and

<strong>$supplytokes</strong>supply tokens.</p>\");

print( \"<p> You received some bonus tokens!:)</p>):

print(\"<p>$charName has spent <strong> $goldSpent</strong> gold pieces, and has <strong> goldLeft</strong >gold pieces left\");

print(\"<a href=\\\"gameintr.html\\\">Return to form<a>\");

print(\"<p>

Need to fix my code. Need to fix my code. Solution<php $charName = $_POST[\'charName\']; $charType = $_POST[\'charType\']; $healthToken = $_POST[\'heathToken

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site