Scusa la mia ignoranza ma come lo devo usare il codice $str_no_blank=trim($stringa)
ti posto come visualizzo i campi, mi puoi fare un esempio di come usarlo?
Deve essere su tutti i campi di input questo codice.
Posto i campi a cui applicare il codice che mi hai postato
$sql = "select *
from ACSSI_DAT.srvrq00f
where srvcli = '".$customerSRVCLI."'
and srvnum = '".$customerSRVNUM."' ";
/* Esecuzione diretta dello stament SQL */
$stmt = db2_exec($dbh, $sql, array('cursor' => DB2_SCROLLABLE));
/* Salvataggio dei dati estratti in un array */
$row = db2_fetch_array($stmt);
$str_no_blank=trim($stringa)
/* Ciclo di lettura dei dati estratti e stampa */
if (!$row=="") {
$customerSRVSRN = $row[11];
$customerSRVMOD = $row[12];
$customerSRVNSP = $row[13];
$customerSRVPRO = $row[9];
$customerSRVVER = $row[10];
$customerSRVPMO = $row[47];
$customerSRVVRM = $row[48];
$customerSRVBLD = $row[42];
$customerSRVREL = $row[40];
$customerSRVASP = $row[41];
$customerSRVDAT = $row[18];
$customerSRVORA = $row[19];
$customerSRVPER = $row[17];
$customerSRVMOT = $row[20];
$customerSRVCAS = $row[21];
$customerSRVUSR = $row[23];
$customerSRVVIS = $row[16];
$customerSRVPRR = $row[24];
$customerSRVVRR = $row[25];
$customerSRVSOL = $row[22];
$customerSRVDUR = $row[38];
$customerSRVWEK = $row[39];
$customerSRVPCH = $row[45];
$customerSRVVAS = $row[46];
}
/* Il controllo viene passato ad un altro script PHP per l'aggiornamento dati cliente */
?>
<table border="0" width="950">
<tr>
<td height="55"></td>
</tr>
<tr>
<td>
<div class="box" align="left">
<div class="box" align="left">
<table border="0" width="990">
<tr>
<td width="900px">
<?php
print '<form name="action" onsubmit="return checkForm();" action="db2_update3.php?customerSRVCLI=' . $customerSRVCLI .'&customerSRVNUM=' . $customerSRVNUM . '" method="POST">';
Print 'Server cliente. . . . . . . . . . .'.$customerSRVCLI.' '.$customerSRVNUM.'
';
Print 'S/N server/Mod./Sist-Part. '.$customerSRVSRN.' '.$customerSRVMOD.' '.$customerSRVNSP.'
';
Print 'Prodotto/Versione. . . . . . . '.$customerSRVPRO.' '.$customerSRVVER.'
';
print 'Modulo/versione. . . . . . . . . <input type="text" size="10" maxlength="10" onkeyup=verificacaratteri(this); name="customerSRVPMO" value="'.$customerSRVPMO.' "/><input type="text" size="1" onkeyup=verificacaratteri(this); maxlength="3" name="customerSRVVRM" value="'.$customerSRVVRM.'"/>
';
print 'Build/Service: rls./pack . . . <input type="text" size="1" onkeyup=verificanumeri(this); maxlength="3" name="customerSRVBLD" value="'.$customerSRVBLD.'" /><input type="text" size="1" onkeyup=verificanumeri(this); maxlength="2" name="customerSRVREL" value="'.$customerSRVREL.'"/><input type="text" onkeyup=verificanumeri(this); size="1" maxlength="2 " name="customerSRVASP" value="'.$customerSRVASP.'"/>
';
print 'Richiesta effettuata il. . . . . <input type="text" size="10" maxlength="10" name="customerSRVDAT" value="'.$customerSRVDAT.'"onkeyup="verificadata(t his);"/> ora <input type="text" size="8" onkeyup=verificadata(this); maxlength="8" name="customerSRVORA" value="'.$customerSRVORA.'" />
';
print 'Richiesta effettuata da. . . .<input type="text" size="35" maxlength="35" onkeyup=verificacaratteri(this); name="customerSRVPER" value="'.$customerSRVPER.'" />
';
print 'Motivo della chiamata:
';
/*print '<textarea name="customerSRVMOT" rows="3" cols="100" onchange="conta(this.form);">'.$customerSRVMOT.' </textarea>
';
*/
print '<textarea name="customerSRVMOT" rows="3" cols="100" onkeyup=conta(this.form);verificacaratteri(this);> '.$customerSRVMOT.' </textarea> ';
print '
';
print 'Caso chiuso. . . . . . . . . . . . <input type="text" size="1" onkeyup=verificaflag(this); maxlength="1" name="customerSRVCAS" value="'.$customerSRVCAS.'"/>Durata: gestione <input type="text" size="2" maxlength="4" onkeyup=verificanumeri(this); name="customerSRVDUR" value="'.$customerSRVDUR.'"/>Week <input type="text" onkeyup=verificanumeri(this); size="2" maxlength="4" name="customerSRVWEK" value="'.$customerSRVWEK.'"/>
';
print 'Erogatore servizio. . . . . . . <input type="text" size="6" onkeyup=verificacaratteri(this); maxlength="6" name="customerSRVUSR" value="'.$customerSRVUSR.'"/>
';
print 'Service: codice vision. . . . <input type="text" size="10" onkeyup=verificacaratteri(this); maxlength="10" name="customerSRVVIS" value="'.$customerSRVVIS.'"/>
';
print 'Prodotto/Vrs. richiesti. . . . <input type="text" size="10" maxlength="10" onkeyup=verificacaratteri(this); name="customerSRVPRR" value="'.$customerSRVPRR.'"/><input type="text" size="1" onkeyup=verificacaratteri(this); maxlength="3" name="customerSRVVRR" value="'.$customerSRVVRR.'"/>
';
print 'Patch/Asp. . . . . . . . . . . . . . <input type="text" size="5" maxlength="5" onkeyup=verificacaratteri(this); name="customerSRVPCH" value="'.$customerSRVPCH.'"/><input type="text" size="4" maxlength="5" onkeyup=verificacaratteri(this); name="customerSRVVAS" value="'.$customerSRVVAS.'"/>
';
print 'Soluzione:
';
print '<textarea name="customerSRVSOL" rows="3" cols="100" name="customerSRVSOL" onkeyup=conta(this.form);verificacaratteri(this);> '.$customerSRVSOL.' </textarea> ';
print '
';
?>
</td> <td>
<?php
print '<input type="submit" name="action" value="Update" /></form>';
print '<form action="db2_delete5.php?customerSRVCLI=' . $customerSRVCLI .'&customerSRVNUM=' . $customerSRVNUM . '" method="POST">';
print '<input type="submit" name="action" value="Delete " /></form>';
print '<form action="db2_update1.php" method="POST">';
print '<input type="submit" name="action" value="Back " /></form>';
print '<form action="db2_update4.php" method="POST">';
print '<input type="submit" name="close" value="Close " /></form>';
print '<form action="db2_update6.php" method="POST">';
print '<input type="submit" name="New" value="New " /></form>';
print '</form>';
}
?>
Ciao, grazie