Jump to content

Recommended Posts

Stuck What Im looking for is the input amount from the form to change the variable $amount.  this is what I have might be a little messy but everything works except the change.

 

function train2() {

global $userrow, $numqueries;

 

$good ="";

$bad ="";

$amount ="";

 

/********\

|Strength|

\********/

if (isset($_POST["Train1"])) {

 

$my_array = array(

"<font color=Lime>You train hard!</font>+.1125<br>", //0

"<font color=Lime>You train hard!</font>+.0381<br>", //1

                            "<font color=Red>Pulled a muscle</font>-.1427<br>",//2

                            "<font color=#808080>Your tired and give no effort!</font>+.0016<br>",//3

"<font color=Lime>You train hard!</font>+.1021<br>", //4

"<font color=Lime>You train hard!</font>+.0888<br>", //5

                            "<font color=Red>Pulled a muscle</font>-.0921<br>",//6

                            "<font color=#808080>Your tired and give no effort!</font>+.0004<br>",//7

"<font color=Lime>You train hard!</font>+.0221<br>", //8

"<font color=Lime>You train hard!</font>+.0377<br>", //9

                            "<font color=Red>Pulled a muscle</font>-.0925<br>",//10

                            "<font color=#808080>Your tired and give no effort!</font>+.0012<br>",//11

"<font color=Lime>You train hard!</font>+.0465<br>", //12

"<font color=Lime>You train hard!</font>+.0842<br>", //13

                            "<font color=Red>Pulled a muscle</font>-.1039<br>",//14

                            "<font color=#808080>Your tired and give no effort!</font>+.0004<br>"

);

 

for ($i=0; $i<=$amount; $i++){ 

$random = array_rand($my_array);

$parola .= $my_array[$random];

 

 

$gained = $good - $bad;

 

}

$title = "train";

$page = " <table width=100%><tr><td class=title align=center>Train Results</td></tr>";

$page .= " <tr><td>$parola</td></tr>";

$page .= " <tr><td>You Gained: $gained Strength</tr></table>";

$page .= "<center><a href=index.php?do=train>BACK</a></center>";

 

 

 

 

$updatequery = doquery("UPDATE {{table}} SET energy=energy-25, stamina=stamina-12 WHERE id='".$userrow["id"]."' LIMIT 1", "users");

 

} else {

$title = "train";

$page .= " <form action=\"index.php?do=train2\" method=\"post\">\n";

$page .= " <table width=90% border=1 align=center><tr><td align=center bgcolor=red colspan=2>TRAINING</td></tr>";

 

$page .= "<tr><td align=left>I want to train&nbsp&nbsp<input type=text name="" size=3 maxlength=3>&nbsp&nbsp times &nbsp&nbsp <input type=\"submit\" name=\"Train1\" value=\"SUBMIT\" /></td></tr>";

$page .= " </table><br /><br /> ";

$page .= "<center><a href=index.php?do=towninf>GO BACK</a></center>";

$page .= " </form>";

 

}

display($page, $title);

}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.