Zepo. Posted October 6, 2007 Share Posted October 6, 2007 It's just not getting any of the $match values over. $matches = mysql_query("SELECT id,posted,ladder,mid,wid,lid,refs,details FROM matchreports"); while ($match = mysql_fetch_array($matches)){ $account++; $refs = str_replace ('>', ''', $refs); $details = str_replace ('>', ''', $details); echo" <tr valign='top'> <form method='post'> <td class='optiontitle' colspan='2'><div>ID: $match[id] | Posted By: $match[posted] | Ladder: $match[ladder] | Match ID: $match[mid] | Losser ID: $match[lid] | Referees Present : $match[refs] </div></td> </tr> <tbody id='tbody_keywords'> <tr valign='top'> <td class='alt1'><div class='smallfont' align='center'> $match[details] </td><td class='alt1' width='5%' align='center'> <input type='hidden' name='act' value='deleterefticket'> <input type='image' src='./images/delete.png' name='submit'> </form></td> </tr> "; } Goes to function reportdelete($match){ global $config; mysql_query("DELETE FROM `matchreports` WHERE `id`='$match[id]'"); echo" <body style='margin:0px'> <div style='margin:10px'> <br /> <form method='post'> <table cellpadding='4' cellspacing='0' border='0' align='center' width='95%' class='tborder' id='optionsform'> <colgroup span='2'> <col style='width:45%'></col> <col style='width:55%'></col> </colgroup> <tr> <td class='tcat' align='center' colspan='2'> <b>Report Manager</b> </td> </tr> <tr valign='top'> <td class='optiontitle' colspan='2'><div>Deleted</div></td> </tr> <tbody id='tbody_keywords'> <tr valign='top'> <td class='alt1'><div class='smallfont' align='center'> Deleted report ID: $match[id], Originally posted by $match[posted]. </td> </tr> </tbody> </table>"; } Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/ Share on other sites More sharing options...
Zepo. Posted October 6, 2007 Author Share Posted October 6, 2007 Bump ??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363105 Share on other sites More sharing options...
lszanto Posted October 6, 2007 Share Posted October 6, 2007 I don't think this is the issue but for the fields in match maybe try putting in single quotes e.g instead of putting $match[refs] try $match['refs']. Are you sure the query pulls data our of the database? Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363112 Share on other sites More sharing options...
Zepo. Posted October 6, 2007 Author Share Posted October 6, 2007 I tried that, but its still not getting the $match data across the form. Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363115 Share on other sites More sharing options...
lszanto Posted October 6, 2007 Share Posted October 6, 2007 Um I think its cause the echo ""; would return the values as "" because of the brackets specifying the array, you would need to put encase the var with {} e.g $match['ref'] becomes {$match['ref']}, I'm pretty sure this is the problem. Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363116 Share on other sites More sharing options...
Zepo. Posted October 6, 2007 Author Share Posted October 6, 2007 The brackets didnt do anything, im not sure if you guys understand my problem, i cant get $match[id] and $match[posted] to go through the form onto the second bit of code i posted. If you would like a demo go to www.eliteladders.com/devlopment/admincp and login with Hogen, pass demo, click on Manage Referee Reports and click the X next to one of them. Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363117 Share on other sites More sharing options...
lszanto Posted October 6, 2007 Share Posted October 6, 2007 Sorry I didn't understand the question, can you post the code that calls the function? Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363119 Share on other sites More sharing options...
Zepo. Posted October 6, 2007 Author Share Posted October 6, 2007 Ok i have a loop $matches = mysql_query("SELECT id,posted,ladder,mid,wid,lid,refs,details FROM matchreports"); while ($match = mysql_fetch_array($matches)){ $account++; $refs = str_replace ('>', ''', $refs); $details = str_replace ('>', ''', $details); echo" <form method='post'> <tr valign='top'> <td class='optiontitle' colspan='2'><div>ID: $match[id] | Posted By: $match[posted] | Ladder: $match[ladder] | Match ID: $match[mid] | Losser ID: $match[lid] | Referees Present : $match[refs] </div></td> </tr> <tbody id='tbody_keywords'> <tr valign='top'> <td class='alt1'><div class='smallfont' align='center'> $match[details] </td><td class='alt1' width='5%' align='center'> <input type='hidden' name='act' value='deleterefticket'> <input type='image' src='./images/delete.png' name='submit' onClick='return confirm(confirmdelete);'> </form></td> </tr> "; } if(!ids){ echo" <tr valign='top'> <td class='optiontitle' colspan='2'><div>Error</div></td> </tr> <tbody id='tbody_keywords'> <tr valign='top'> <td class='alt1'><div class='smallfont' align='center'> No Current Tickets </td> </tr>"; } echo" </div> </form> </td> </tr> </tbody> </table> "; } Inside the loop i have a form <form method='post'><input type='hidden' name='act' value='deleterefticket'> <input type='image' src='./images/delete.png' name='submit' onClick='return confirm(confirmdelete);'></form> This form goes to the next function that is called by case "deleterefticket": include("./includes/refticket.php"); reportdelete($match); break; The function is function reportdelete($match){ global $config; mysql_query("DELETE FROM `matchreports` WHERE `id`='{$match[id]}'"); echo" <body style='margin:0px'> <div style='margin:10px'> <br /> <table cellpadding='4' cellspacing='0' border='0' align='center' width='95%' class='tborder' id='optionsform'> <colgroup span='2'> <col style='width:45%'></col> <col style='width:55%'></col> </colgroup> <tr> <td class='tcat' align='center' colspan='2'> <b>Referee Report Manager</b> </td> </tr> <tr valign='top'> <td class='optiontitle' colspan='2'><div>Deleted</div></td> </tr> <tbody id='tbody_keywords'> <tr valign='top'> <td class='alt1'><div class='smallfont' align='center'> Deleted report ID: {$match[id]}, Originally posted by {$match[posted]}. </td> </tr> </tbody> </table>"; } The thing is the $match variables dont get sent through the form.... Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363121 Share on other sites More sharing options...
Zepo. Posted October 6, 2007 Author Share Posted October 6, 2007 Bumpidy Bump Bump Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363153 Share on other sites More sharing options...
Zepo. Posted October 6, 2007 Author Share Posted October 6, 2007 ??? ??? ??? Bump again???? ??? Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363440 Share on other sites More sharing options...
BlueSkyIS Posted October 6, 2007 Share Posted October 6, 2007 what $match variables are you referring to? i don't see them in your form. Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363446 Share on other sites More sharing options...
Zepo. Posted October 6, 2007 Author Share Posted October 6, 2007 They're not in the form... they're in the sql loop.... Solved, just mad to put hidden imputs.. Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363449 Share on other sites More sharing options...
BlueSkyIS Posted October 6, 2007 Share Posted October 6, 2007 okay, i'm not understanding your problem either. i thought the problem was when you submit the forms, the variables are not passed from the form page to the next page. so that's apparently not the problem. second guess: is the problem that the values are not displayed in this line? <td class='optiontitle' colspan='2'><div>ID: $match[id] | Posted By: $match[posted] | Ladder: $match[ladder] | Match ID: $match[mid] | Losser ID: $match[lid] | Referees Present : $match[refs] </div></td> if that is the problem, it's because you're not bracketing the array variables, plus i would add single quotes like this: <td class='optiontitle' colspan='2'><div>ID: {$match['id']} | Posted By: {$match['posted']} | Ladder: {$match['ladder']} | Match ID: {$match['mid']} | Losser ID: {$match['lid']} | Referees Present : {$match['refs']} </div></td> Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363455 Share on other sites More sharing options...
BlueSkyIS Posted October 6, 2007 Share Posted October 6, 2007 They're not in the form... they're in the sql loop.... Solved, just mad to put hidden imputs.. yes, if you need to pass information from a form to a PHP script you need to include the values in the form. the only way to do that is via hidden or non-hidden form elements. Quote Link to comment https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/#findComment-363457 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.