Jump to content

Recommended Posts

okay so I'm struggling to find what the issue is here the form tags are okay as this is one submit of many in a tournament update form where each match there is two submits for teams and two for scores then a submit button 

 

to save publishing the 1300 lines of code i have added the affected coded 

if($_POST['sub_16_1']){
$teamA_16_1_name=$_POST['teamA_16_1_name'];
$teamB_16_1_name=$_POST['teamB_16_1_name'];
$teamA_16_1_score=$_POST['teamA_16_1_score'];
$teamB_16_1_score=$_POST['teamB_16_1_score'];
mysql_query("UPDATE `teamResults` set `teamAName`='$teamA_16_1_name', `teamBName`='$teamB_16_1_name', `scoreA`='$teamA_16_1_score', `scoreB`='$teamB_16_1_score' WHERE `match`='1' AND `round`='16'");
if($teamA_16_1_score > $teamB_16_1_score){ 
$winner="$teamA_16_1_name"; $loser="$teamB_16_1_name"; }else{ $winner="$teamB_16_1_name"; $loser="$teamA_16_1_name"; }
$text="$winner defeats $loser in the Golden 8 Ball";
mysql_query("INSERT INTO `live-result` (`id` ,`text` ,`type`)VALUES ('' ,  '$text',  'score');"); $response = $tmhOAuth->request('POST', $tmhOAuth->url('1.1/statuses/update'), array('status' => ''.$text.''));
 mysql_query("UPDATE `teamResults` SET `teamAName`='$winner' WHERE `match`='1' AND `round`='8'");
header("Location: edit-main-team-scores.php");
}

and 

   <tr bgcolor="#999999">
        <td><div align="center">1:
          <input name="teamA_16_1_name" type="text" id="teamA_16_1_name" value="<?php echo"$round_16_1->teamAName"; ?>" />
        </div></td>
        <td><div align="center"><span class="text">
          <input name="teamA_16_1_score" type="text" id="teamA_16_1_score" value="<?php echo"$round_16_1->scoreA";?>" size="4" maxlength="2" />
        </span></div></td>
        <td><div align="center" class="text"><strong>:</strong></div></td>
        <td><div align="center"><span class="text">
          <input name="teamB_16_1_score" type="text" id="teamB_16_1_score" value="<?php echo"$round_16_1->scoreB";?>" size="4" maxlength="2" />
        </span></div></td>
        <td><div align="center">
          <input name="teamB_16_1_name" type="text" id="teamB_16_1_name" value="<?php echo"$round_16_1->teamBName"; ?>" />
        </div></td>
        <td><div align="center">
          <label>
            <input type="submit" name="sub_16_1" id="sub_16_1" value="Update Score" />
          </label>

am struggling to work out why the textfield are submitting blank even though it it submitting the form. please help

Edited by blmg911
Link to comment
https://forums.phpfreaks.com/topic/279467-cant-understand-why-this-isnt-working/
Share on other sites

Please clean up your code, with proper indentation, so it's actually readable. I suspect that you might be able to spot the error yourself, after doing this.

 

Secondly, please use proper grammar. I'm thinking especially of punctuation. Make your question easy to read, and more people will read it. Make it unnecessary hard to read, by skipping out on grammar, and people won't bother with reading it.

 

Lastly, no need to shout (all caps). In fact, doing so is considered quite rude, and will only serve to give your thread less attention.

 

PS: I recommend that you read this article. Should help you get the help you're looking for.

what makes you think the text fields are blank? what symptom are you getting?

 

AND, you apparently have code repeated 16 (or more) times, that only differs in a group number. you need to learn how to use variables and arrays so that you only write out one copy of your code and let the computer produce the repeat regions of code for you. if all the other sections work, you have probably made a syntax error in your form and letting the computer produce the repeat regions from one tested block of code will help in preventing things like copy/paste/typo's from breaking your code.

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.