zhijiez Posted November 14, 2009 Share Posted November 14, 2009 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 (: Quote Link to comment Share on other sites More sharing options...
mga_ka_php Posted November 14, 2009 Share Posted November 14, 2009 what is your code? Quote Link to comment Share on other sites More sharing options...
zhijiez Posted November 15, 2009 Author Share Posted November 15, 2009 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>"; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.