Jump to content

PHP output to html


zhijiez

Recommended Posts

Hi all. first time here. just have a question to ask.

 

im currently working on a display system for scores.

i have a form to input the team number and position of the team

 

i now need to output the team number at a certain position on a scoring chart

 

when i input the first time, the team number will appear.

however when i select the 2nd input, the team number from the first input will disappear, and the 2nd input will then appear where its supposed to be.

 

Anyone will be willing to help me? thanks (:

Link to comment
Share on other sites

Below is the code. Its one of the few files i have but this is the one responsible for printing the words.

 

 

<meta http-equiv="refresh" content="0;url=../admin.php">

 

<?php

$scoringFile = "text/scoring.txt";

$scoringFileName = fopen($scoringFile, 'w');

$scoreTeam = $_POST["score_num"];

$scorePos = $_POST["score_position"];

 

 

 

if ( $scorePos == "SHU Round 1 Winner"){

$posNum = 1;

$scoringTeam1 = $scoreTeam;

}

else if ( $scorePos == "SHU Round 2 Winner"){

$posNum = 2;

$scoringTeam2 = $scoreTeam;

}

else if ( $scorePos == "SHU Round 3 Winner"){

$posNum = 3;

$scoringTeam3 = $scoreTeam;

}

else if ( $scorePos == "WEI Round 1 Winner"){

$posNum = 4;

$scoringTeam4 = $scoreTeam;

}

else if ( $scorePos == "WEI Round 2 Winner"){

$posNum = 5;

$scoringTeam5 = $scoreTeam;

}

else if ( $scorePos == "WEI Round 3 Winner"){

$posNum = 6;

$scoringTeam6 = $scoreTeam;

}

else if ( $scorePos == "WU Round 1 Winner"){

$posNum = 7;

$scoringTeam7 = $scoreTeam;

}

else if ( $scorePos == "WU Round 2 Winner"){

$posNum = 8;

$scoringTeam8 = $scoreTeam;

}

else if ( $scorePos == "WU Round 3 Winner"){

$posNum = 9;

$scoringTeam9 = $scoreTeam;

}

else if ( $scorePos == "SHU Kingdom 2nd Runner Up"){

$posNum = 10;

$scoringTeam10 = $scoreTeam;

}

else if ( $scorePos == "SHU Kingdom 1st Runner Up"){

$posNum = 11;

$scoringTeam11 = $scoreTeam;

}

else if ( $scorePos == "SHU Kingdom Champion"){

$posNum = 12;

$scoringTeam12 = $scoreTeam;

}

else if ( $scorePos == "WEI Kingdom 2nd Runner Up"){

$posNum = 13;

$scoringTeam13 = $scoreTeam;

}

else if ( $scorePos == "WEI Kingdom 1st Runner Up"){

$posNum = 14;

$scoringTeam14 = $scoreTeam;

}

else if ( $scorePos == "WEI Kingdom Champion"){

$posNum = 15;

$scoringTeam15 = $scoreTeam;

}

else if ( $scorePos == "WU Kingdom 2nd Runner Up"){

$posNum = 16;

$scoringTeam16 = $scoreTeam;

}

else if ( $scorePos == "WU Kingdom 1st Runner Up"){

$posNum = 17;

$scoringTeam17 = $scoreTeam;

}

else if ( $scorePos == "WU Kingdom Champion"){

$posNum = 18;

$scoringTeam18 = $scoreTeam;

}

else if ( $scorePos == "Overall Champion"){

$posNum = 19;

$scoringTeam19 = $scoreTeam;

 

}

 

 

 

if($posNum < 10)

{

fwrite($scoringFileName, " ");

}

 

fwrite($scoringFileName, $posNum);

 

fwrite($scoringFileName, " ");

 

if ( (is_numeric($scoreTeam)) == 1 && $scoreTeam < 100 ){

if ($scoreTeam < 10)

{

fwrite($scoringFileName, " ");

}

fwrite($scoringFileName, $scoreTeam);

 

}

else {

echo"<script>alert('Invalid Alliance Number Entered')</script>";

}

 

 

 

?>

 

 

 

Link to comment
Share on other sites

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.