php - Using a submit button dependent on another one being submitted first -


I am relatively new to PHP, I have been back to school after working for a number of years in the unorganized sector. I am working on an external project for my father and goes as an easy solution to the surface, which I can not solve.

On the page in question, it displays a list of players in a league and their score. The form below has a text box, so that you can enter a name and three buttons; To add a name as a player (with a default score of 0), remove that player from the list of players, and one-third to adjust that player's score. I got the first two ("add" and "delete") to work, but where I am running into a problem, the score is with the adjustment.

If you click the "adjust the score" button to actually submit it, it displays a new text box to enter the score with the second button. The problem is nothing happens I have just got a test "echo" statement in there that should be displayed on the submission when you press the new button to adjust the score, at this point But this is not happening. Below is the code in question, how can I fix any thoughts? Thanks for any suggestions.

  & lt; Html & gt; & Lt; Top & gt; & Lt; LINK REL = "stylesheet" type = "text / css" href = "styles / footballtest.css" / & gt; & Lt; Title & gt; VFW Football Trials & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;? Php $ dbConnect = mysql_connect ("localhost", "root", ""); $ DbName = "vfwleaguetest"; $ GetPlayers = "Select * From Players"; if (! $ DbConnect) {resonates "<< lt; P & gt; Connection failed & lt; / P & gt; ";} if (mysql_select_db ($ DBNAME, $ dbConnect) === incorrect) {echo" & lt; P & gt; Could not select database ". $ DBNAME" & lt; Br / & gt; "mysql_error ($ dbConnect)". & Lt. ; / P & gt; ";} If (isset ($ _ POST ['submit'])) {$ name = @ $ _ POST ['nameAdd']; $ PlayerAdd =" `vfwleaguetest`.`players` (` playerName`, ` SeasonTotal`) value ('' ',' 0 '. $ Name.') "; If (mysql_query ($ playerAdd, $ dbConnect) === incorrect) {echo" & lt; P & gt; Adding the player to the error database: ".mysql_error ($ dbConnect)" & lt; ($ _ POST ['submit']); if (isset ($ _ POST ['delete'])) {$ name = @ $ _ POST ['nameAdd']; $ PlayerDelete = "Remove the player from vfwleaguetest`. 'Player' where` player ' 'Player' name '=' ". $ Name." '"; If (mysql_query ($ playerDelete, $ dbConnect) === incorrect) {echo" & lt; P & gt; The player removing the error for the database: ".mysql_error ($ dbConnect)" & lt; / P & gt; ";} Else {echo $ name." Successfully deleted from the player list "}} If (isset ($ _ POST ['adjust'])) {? & Gt; & lt; br />  & amp; nbsp; & lt; input type = 'submit' name = 'fixscore' value = 'new for' Season total & lt ;? php echo $ _POST ['nameAdd'] ;? & gt; ' / & Gt; & lt ;? php if (isset ($ _ post ['fixScore']) // This is the problem where the problem seems to lie. "After fixScore click" echo "// add sql below" }? & Gt; form name = "player" verb = "" method = "post">  Player Name & lt; / Td> & Lt; Td> Season total & lt; / Td> & Lt; / Tr & gt; & Lt; / Th> "; while ($ line = mysql_fetch_row ($ playerList)) = false) {resonant" & lt; Tr & gt; & Lt; Td> $ Line [0] & lt; / Td> & Lt; Td> $ Line [1] & lt; / Td> & Lt; / TR & gt; ";} Resounds" & lt; / Table> ";? & Gt; Manage players & amp; nbsp; & lt; input type =" text "name =" add name "and> & nbsp; & quot; input type =" submit "Name =" submit "value =" add "/> & amp; nbsp; & lt; input type =" submit "name =" delete "value =" delete "/> & amp; nbsp; & Lt; input type = "submit" name = "adjust" value = "adjust score" /> gt; form & gt; & lt; / body & gt; & lt; / html & gt; ;    

Outside:

  input type = "text" size = "5" name = "score disabled"> 
input type = "submit" value = "AAA New season total for "name =" fixscore ">

You need it:

  
" post "action = '' & Gt; Input type = "text" size = "5" name = "score disabled">

Comments