Ahí va. Pego un trozo del código, a ver si veis algo.
¿hay que definir la variable en la función confirm_wind?
Si pongo:
confirm_wind($matchid,$member,$map,$wfscore,$lfsco re,$wcomment,$kills,$r1) -- me da missing argument y en la base de datos me escribe "array"
Así es como estaba:
confirm_wind($matchid,$member,$map,$wfscore,$lfsco re,$wcomment,$kills)
no da error, pero no inserta el dato "r1" en la base de datos...
Código PHP:
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='50%' valign='center' align='center'>$wtinfo[teamname] <input type='text' name='wfscore' value='' size='3' maxlength='3'> </td>
<td width='50%' valign='center' align='center'>$match[loseralias] <input type='text' name='lfscore' value='' size='3' maxlength='3'> $ltinfo[teamname]</td>
</tr>
// ESTO ES LO QUE HE INTRODUCIDO
<tr>
<td width='' align='right'>resultados :<input type='text' name='r1' value='' size='1' maxlength='1'></td>
</tr>
// HASTA AQUI
</table>";
if($misc[winnercomment]=="yes"){
$out[body]=$out[body]."</td>
</tr>
<tr class='altcolorc'>
<td width='100%' valign='top' align='center'>
<strong>Comments</strong><br>
</td>
</tr>
<tr>
<td width='100%' valign='center' align='center'>
<tr>
<td width='100%' valign='center' align='center'>
<input type='text' name='wcomment' maxlength='50' size='50'><br>
<small>50 Characters Max</small>
</td>
</tr>";
}
$out[body]=$out[body]."
<tr>
<td width='100%' valign='top' align='center'>
<BR>
<input type='hidden' name='matchid' value='$match[matchid]'>
<input type='hidden' name='action' value='confirmwind'>
<input type='submit' name='' value='enviar'>
</td></form>
</tr>
</table>
$tablefoot";
include("$dir[curtheme]");
}
function confirm_wind($matchid,$member,$map,$wfscore,$lfscore,$wcomment,$kills,$r1){
global $dir, $file, $url, $out, $plyr, $misc;
if(!$matchid){
include("$dir[func]/error.php");
display_error("Invalid Match ID.<br>");
}
if((!$wfscore) || ($wfscore <= $lfscore)){
include("$dir[func]/error.php");
display_error("Invalid Final Score.<br>");
}
$matchinfo=mysql_query("SELECT * FROM matchdbval WHERE matchid='$matchid'");
$match=mysql_fetch_array($matchinfo);
if(!$match[matchid]){
include("$dir[func]/error.php");
display_error("Unknown Match ID.<br>");
}
//CHECK IF CAN CONFIRM/REPORT
if (mysql_num_rows(mysql_query("SELECT status FROM teammembers WHERE teamid='$match[winnerid]' AND playerid='$plyr[id]' AND status <='4'")) < 1){
include("$dir[func]/error.php");
display_error("You are not allowed to report losses for this team.<br>");
}
$ladderinfo=mysql_query("SELECT * FROM ladders WHERE id='$match[ladderid]'");
$linfo=mysql_fetch_array($ladderinfo);
if(!$linfo[laddername]){
include("$dir[func]/error.php");
display_error("Unknown ladder.<br>");
}
$winnerinfo=mysql_query("SELECT teamname FROM teams WHERE id='$match[winnerid]'");
$wtinfo=mysql_fetch_array($winnerinfo);
if(!$wtinfo[teamname]){
include("$dir[func]/error.php");
display_error("Unable to find your team.<br>");
}
if(!$member){
include("$dir[func]/error.php");
display_error("You must select the members that played.<br>");
}
include("$dir[func]/checkdata.php");
$wfscore=change_numbersonly($wfscore);
if($lfscore==""){
$lfscore=0;
}else{
$lfscore=change_numbersonly($lfscore);
}
if((!$wfscore) || (!$lfscore) && ($lfscore!="0")){
include("$dir[func]/error.php");
display_error("Invalid Final Score.<br>");
}
if($wcomment){
$wcomment=wordwrap($wcomment,20," ",1);
$wcomment=change_censor($wcomment);
$wcomment=change_charecters($wcomment);
}
while(list($memberid,$played)=each($member)){
if($played){
$memberid=change_numbersonly($memberid);
$kills[$memberid]=change_numbersonly($kills[$memberid]);
$membersplayed=$membersplayed."$memberid|$kills[$memberid],";
$totalkills=($totalkills + $kills[$memberid]);
}
}
if($map){
while(list($maporder,$wonmap)=each($map)){
if($wonmap){
$mapsplayed=$mapsplayed."$maporder,";
}
}
}
if(!$membersplayed){
include("$dir[func]/error.php");
display_error("You must select the members that played.<br>");
}
//CHECK FOR CHALLENGE OR IF OPEN PLAY IS ALLOWED
$thechallenge=mysql_query("SELECT * FROM challenges WHERE challenger='$match[winnerid]' AND challenged='$match[loserid]' AND finalizedby > '0' OR challenger='$match[loserid]' AND challenged='$match[winnerid]' AND finalizedby > '0'");
$chall=mysql_fetch_array($thechallenge);
if($chall[challid]){
if($match[winnerid]=="$chall[challenger]"){
$wtempnewrank="$chall[challengedrank]";
}else{
$wtempnewrank=0;
}
}else{
if($linfo[openplay] < 1){
include("$dir[func]/error.php");
display_error("Open play is not allowed on this ladder.<br>All matches must be scheduled challenges.<br>");
}
}
//CLEAN MATCH DB
clean_matchdb($matchid);
$tday=date("Y-m-d H:i:s");
$ip=getenv("REMOTE_ADDR");
//REPORT MATCH TO MATCH DATABASE
mysql_query("INSERT INTO matchdb VALUES (
'$match[matchid]',
'$match[winnerid]',
'$match[loserid]',
'$wtinfo[teamname]',
'$match[loseralias]',
'$match[ladderid]',
'$linfo[laddername]',
'$match[wrank]',
'$match[lrank]',
'$wfscore',
'$lfscore',
'$membersplayed',
'$match[losersmembers]',
'$match[maps]',
'$mapsplayed',
'$wcomment',
'$match[lcomment]',
'$match[points]',
'$totalkills|$match[skill]',
'$match[reportedby]',
'$match[reporteddate]',
'$match[reportedip]',
'$plyr[id]',
'$tday',
'$ip',
'$r1'
);");