Ok premessa sto iniziando a usare php e alcune cose non mi sono chiare.

Quindi e' possibile nella stessa pagina dove metto lo username e la password fare l'sql con i dati che ho messo?

Posto la pagina perche', se e' possibile fare questo ci sono degli errori perche' ha me non riesce di testare le variabili che ho appena scritto.

Il problema e' che se guardi il terzo controllo, document.action.customerCLSCLI.value==""
quello e' il valore che dovrei reperire dal sql ma non riesce mai l'sql perche' il test
if ($customerCLSUSR=="" && $customerCLSUSR=="") non riesce perche' non riesco a impostare le variabili che ho appena scritto.

Mi dice come posso fare? Grazie

<html>

<?php
define("PAGE_TITLE", "Customer Update");
define("PHP_FILE_NAME", "srvrq1.php")
?>

<head>

<script language="javascript">
<!--
function checkForm()
{

if (document.action.customerCLSUSR.value==""){
alert("Username obbligatorio");
document.action.customerCLSUSR.focus();
return false;
}

if (document.action.customerCLSPSW.value==""){
alert("Password obbligatoria");
document.action.customerCLSPSW.focus();
return false;
}

if (document.action.customerCLSCLI.value==""){
alert("Cliente non registrato o errore nell'inserimento dei dati");
document.action.customerCLSUSR.focus();
return false;
}

}
//-->
</script>

<script language="Javascript">
function verificacaratteri(campo)
{
var chiffres = new RegExp("[a-z-A-Z-0-9,-?.\/*\r\n ]");
var verif;
var points = 0;

for(x = 0; x < campo.value.length; x++)
{
verif = chiffres.test(campo.value.charAt(x));
if(campo.value.charAt(x) == "."){points++;}
if(points > 1){verif = false; points = 1;}
if(verif == false){campo.value = campo.value.substr(0,x) + campo.value.substr(x+1,campo.value.length-x+1); x--;}
}
}
</script>

</head>

<?php
/* Apertura connessione al database*/
include("connection.inc");

$_POST["customerCLSUSR"]; $_POST["customerCLSPSW"];
$customerCLSUSR = $_POST["customerCLSUSR"];
$customerCLSPSW = $_POST["customerCLSPSW"];


if ($customerCLSUSR=="" && $customerCLSUSR=="")
{$customerCLSCLI = "";}
else {

$sql = "select *
from ACSSI_DAT.CLSSI00F
WHERE CLSUSR = '".$customerCLSUSR."'
AND CLSPSW = '".$customerCLSPSW."' ";
$stmt = db2_exec($dbh, $sql, array('cursor' => DB2_SCROLLABLE));
$row = db2_fetch_array($stmt);
/* Ciclo di lettura dei dati estratti e stampa */
if (!$row=="") {
$customerCLSCLI = $row[7];
}
}
?>

<body style="overflow:hidden;" bgcolor="#F7F7F7" leftmargin="0" rightmargin="0" topmargin="0">
<table border="1" width="100%" >
<tr>
<td width="110" height="50">SSI </td>
<td align="center">Gestione Richieste di Assistenza</td>
</tr>

<tr>
<td width="110">
</td>
<td rowspan="2" valign="top">

<p align="center"><?php print( date("d M Y H:i:s", time()) ); ?></p>


<?php print'Immettere username e password'; ?></p>

<?php
print '<form name="action" onsubmit="return checkForm();" action="srvrq2.php?
customerCLSCLI=' . $customerCLSCLI .'
" method="POST">';

print '<input type=hidden name="customerCLSCLI" value="'.$customerCLSCLI.'" />';

print 'Username <input type="text" size="10" maxlength="10" onkeyup=verificacaratteri(this);
name="customerCLSUSR" value="'.$customerCLSUSR.'" />
';

print 'Password <input type="password" size="10" maxlength="10" onkeyup=verificacaratteri(this);
name="customerCLSPSW" value="'.$customerCLSPSW.'" />
';

print '

';
?>




</td>
</tr>
<tr>
<td width="110" height="344" valign="top">

<?php
print '<input type="submit" name="action" value="Enter " /></form>';
print '<form action="db2_update4.php" name="close" method="POST">';
print '<input type="submit" name="close" value="Close " /></form>';
?>

</td>


</tr>
</table>
</body>
</html>