this is the simplier example :
php page
<head>
<link rel="stylesheet" type="text/css" href="stile.css">
<script src="scripts.js" type="text/javascript">
</script>
</head>
<body>
<?php
$login=$_POST['identita'];
$q="select password,nome from utenti where login='$login'";
$host="localhost";
$connessione=mysql_connect($host,null,null);
mysql_select_db('magazzino');
$risultato=mysql_query($q);
$riga=mysql_fetch_array($risultato,MYSQL_BOTH);
$pw=$riga[0];
$nome=$riga[1];
$tipo=$riga[2];
if ($pw!=$_POST['password']) {
echo "<h2>Accesso non autorizzato a MAST</h2> ";
echo "<h4>Controllare la password immessa per identificare l'utente</h4>";
echo "<center><img src=img/logo.bmp width=300 height=100>";
echo "<br><a href=index.html>Torna all'accesso</a>";
exit();
}
mysql_free_result($risultato);
mysql_close($connessione);
?>
<p>Redirezione alla schermata iniziale in corso...</p>
<form method=POST name=formaccesso action=welcome.php>
<input type=hidden name=nome value="<?php echo $nome ; ?>">
<input type=hidden name=tipo value="<?php echo $tipo ; ?>">
</form>
<script type=text/javascript>
js_home();
</script>
</body>
and this is the javascript file
//SCRIPTS UTILIZZATI
function js_2190_variati (){
form1.submit();
return false;
}
function js_check(x){
if (x.checked==true) document.form1.ok.disabled=false;
return true;
}
function controlla_radio() {
var q=document.queryform.query.value.substring(0,6).to UpperCase();
if (q=='SELECT') {
document.queryform.costrutto[1].checked=false;
document.queryform.costrutto[0].checked=true;
}
}
function js_sql(){
if (document.queryform.costrutto[0].checked==true) {
var q=document.queryform.query.value.substring(0,6).to UpperCase();
if (q=='SELECT') {
document.queryform.action="select.php";
document.queryform.submit();
return;
}
else {
alert("La query di interrogazione deve iniziare con la clausola SELECT");
return;
}
}
else {
var input=prompt("Inserire password del DBA per l'aggiornamento del
database","");
if(input!="submit") alert("Operazione annullata");
else document.queryform.submit();
}
}
function js_cancella(){
if (confirm("I Dati cancellati non saranno pił ripristinabili - Procedere
con la cancellazione?")==true) document.form1.submit();
else {
alert("Cancellazione annullata");
history.back();
return false;
}
return false;
}
function js_modifica(){
document.form1.submit();
return false;
}
function js_home(){
if (document.formaccesso)
document.formaccesso.submit();
else location.href="welcome.php";
}
function js_valore(nomecampo){
var campo='document.form1.'+nomecampo+'.value';
alert(campo);
return campo;
}
function select_all(n){
for (i=1;i<=n;i++)
eval("document.form1.cassa"+i+".checked=true");
document.form1.ok.disabled=false;
}
function deselect_all(n){
for (i=1;i<=n;i++)
eval("document.form1.cassa"+i+".checked=false");
document.form1.ok.disabled=true;
}
function js_reparti(){
var vera='update reparti ';
var sel='select * from reparti ';
var q="set Descrizione=\'";
q=q+document.reparti.descr.value+'\' ';
q=q+' where ID_Reparto='+document.reparti.rep.value;
sel=sel+' where ID_Reparto='+document.reparti.rep.value;
vera=vera+q;
alert(vera+'\n'+sel);
document.reparti.updatequery.value=vera;
document.reparti.selectquery.value=sel;
document.reparti.submit();
}
function js_config(){
document.form1.action="sqlcommand.php";
var vera="update azienda set ";
vera=vera+"Ragione_Sociale=\'"+document.form1.rags oc.value+"\' , ";
vera=vera+"Indirizzo=\'"+document.form1.indirizzo. value+"\' , ";
vera=vera+"Cap=\'"+document.form1.cap.value+"\' , ";
vera=vera+"Citta=\'"+document.form1.citta.value+"\ ' , ";
vera=vera+"Provincia=\'"+document.form1.prov.value +"\' , ";
vera=vera+"CF=\'"+document.form1.cf.value+"\' , ";
vera=vera+"PIVA=\'"+document.form1.piva.value+"\' , ";
vera=vera+"Tel=\'"+document.form1.tel.value+"\' , ";
vera=vera+"Fax=\'"+document.form1.fax.value+"\' , ";
vera=vera+"Anno=\'"+document.form1.anno.value+"\' ";
vera=vera+"where ID_Azienda= '1'";
alert(vera);
document.form1.query.value=vera;
document.form1.tabella.value="Configurazione";
document.form1.submit();
}
function aggiorna_prezzo(){
var prezzoal=document.getElementById("prezzoal");
var contenuto=document.form1.misura.value;
vecchio=prezzoal.firstChild;
vecchio.data='Prezzo al '+contenuto+' : ';
}
function creaquery2(){
var q='update articoli set giacenza=';
q=q+js_valore('quantita');
q=q+', prezzo=';
q=q+js_valore('prezzo');
q=q+' where indice=';
q=q+js_valore('articolo');
document.form1.updatequery.value=q;
document.write(""+document.form1.updatequery.value );
}
"Brett Foster" <fo****************@ioctl.ca> ha scritto nel messaggio
news:33*************@individual.net...
Pasquale wrote:
i show here the translation of my problem from italian to english made by
google language tool ( i hope it will be not so bad).then there are the
files : accesso.php is a simple example of the strange behaviour and
articoli is something more complex (it has 2 external files)
Can't see the files. My news provider doesn't support files. Post as text
inside the message and try to make sure it's as simple an example as
possible.
the project one that I am developing has many functions JS that I have
put
in external files. until a month ago they worked well... i stopped
developing for a month for personal reasons and now that I have resumed
my
project I have noticed one matter... all the scripts come load evil
from
the browsers i use (NN and MSIE), in the sense that, as the NN
Javascript
console tells me, the files js with the functions come loaded
incomplete,
that is do not from the beginning but from a particular point
approximately
to the half of the file. that cause the loss of functions and obviously
syntax errors...
It's not a great translation, but I get the jist.
in the past month i installed some windows updates,
i use apache 2,0,52 on win xp sp2
help me... is my thesis of bachelor! thaks a lot
"Pasquale" <we*******@retailcenter.it> ha scritto nel messaggio
news:LE**********************@news4.tin.it...
hello wverybody...
i've got a terrible matter with JS
my browsers (either IE and NN) load the external scripts
uncorrectly...they load the files from the half part of them and not from
the beginning, so my scripts don't work giving syntax errors.
can you give me a solution?