Jump to content

Recommended Posts

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 ('>', '&#39', $refs);
$details = str_replace ('>', '&#39', $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>";


}

Link to comment
https://forums.phpfreaks.com/topic/72049-solved-post-data-issue/
Share on other sites

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.

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 ('>', '&#39', $refs);
$details = str_replace ('>', '&#39', $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....

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>

 

 

 

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.

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.