• Home
  • Forum
  • Fare Web
  • PHP

update nuova password

  • Creatore Discussione Creatore Discussione jimmybuz
  • Data di inizio Data di inizio 22 Apr 2005
J

jimmybuz

Nuovo Utente
22 Apr 2005
1
0
0
  • 22 Apr 2005
  • #1
ciao ho la necessità di fare un update sulla vecchiapassword con quella nuova.Essendo poco pratico allego tutto il codice fatto fino ad ora per potermi far dire esattamente l'istruzione e sopratutto dove collocarla.....vi prego aiutatemi altrimenti mi licenziano.........ciao

<?php
include_once("Include/Costants.php");
$szConn = getConnection();

if (isset($_REQUEST["cboNome"]))
{
$szNome = $_REQUEST["cboNome"];
}

if (isset($_REQUEST["cboCognome"]))
{
$szCognome = $_REQUEST["cboCognome"];
}

if (isset($_REQUEST["cboUser"]))
{
$szUser = $_REQUEST["cboUser"];
}

if (isset($_REQUEST["txtNascosto"]))
{
$szInserisci = $_REQUEST["txtNascosto"];
}
if (isset($_REQUEST["txtoldpsw"]))
{
$old = $_REQUEST["txtoldpsw"];
}
if (isset($_REQUEST["txtnewpsw"]))
{
$new = $_REQUEST["txtnewpsw"];
}


print "
<html>
<head>
<TITLE> CAMBIO PASSWORD </TITLE>
</head>
<body bgcolor= 'yellow'>
<form name ='frmCambioPsw' method='get'>
<div align='center'><b><h1>Cambio Password </h1></b></div>
<table width= '40%' border='10' align='center'>
<tr>
<td> Nome </td>

<td>";
$SzSql = "SELECT nome FROM accesso ORDER by nome ASC";
$recordset = mysql_query($SzSql, $szConn);

print"
<select name ='cboNome'>
<option></option>";

if (isset($szNome))
{
print "<option SELECTED value='$szNome'>$szNome</option>";
}

while ($Var= mysql_fetch_row ($recordset))
{
print"<option value ='$Var[0]'>$Var[0]</option>";
}
print "
</select>
</td>
</tr>

<tr>
<td> Cognome </td>

<td>";
$SzSql = "SELECT cognome FROM accesso ORDER by cognome ASC";
$recordset =mysql_query($SzSql, $szConn);

print "
<select name='cboCognome'>
<option></option>";

if (isset($szCognome))
{
print "<option SELECTED value='$szCognome'>$szCognome</option>";
}

while ($Var= mysql_fetch_row ($recordset))
{
print"
<option value ='$Var[0]'>$Var[0]</option>";
}
print"
</select>
</td>
</tr>

<tr>
<td> User name </td>

<td>";
$SzSql = "SELECT user_name FROM accesso ORDER by user_name ASC";
$recordset =mysql_query($SzSql, $szConn);

print"
<select name='cboUser'>
<option></option>";

if (isset($szUser))
{
print "<option SELECTED value='$szUser'>$szUser</option>";
}

while ($Var= mysql_fetch_row ($recordset))
{
print"
<option value ='$Var[0]'>$Var[0]</option>";
}
print"
</select>
</td>
</TR>

<tr>
<td>Vecchia password </td>
<td><input type='password' name= 'txtoldpsw' value='$old' size= '8'></td>
</TR>

<tr>
<td>Nuova password </td>
<td><input type='text' name= 'txtnewpsw' value='$new' size= '8'></td>
</TR>

<tr>
<td>Riconferma password </td>
<td><input type='text' name= 'txtnewpsw2' value='$new2' size='8'></td>
</tr>

<tr>
<td><input type='button' value='Inserisci' onclick='javascript: Salva()'></td>
</tr>
</table>

<input type='' name='txtNascosto' size ='1' value='$szInserisci'>
</form>
</body>

<script language= 'javascript'>
function Salva()
{
if (document.all.item('cboNome').value == '')
{
alert('Inserire un valore per i campo Nome');
}
else
{
if (document.all.item('cboCognome').value == '')
{
alert('Inserire un valore per i campo Cognome');
}
else
{
if (document.all.item('cboUser').value == '')
{
alert('Inserire un valore per i campo User');

}
else
{
if (document.all.item('txtoldpsw').value == '')
{
alert('Inserire un valore per i campo oldpass');
}
else
{
document.all.item('txtNascosto').value = 'Ok';
document.forms['frmCambioPsw'].submit();
}
}
}
}
}




</script>
</html>
";
if($szInserisci == "Ok")
{
$Sql = "SELECT * FROM accesso WHERE nome = '$szNome' AND cognome='$szCognome' AND user_name='$szUser' AND Password = '$old'";
$recordset = mysql_query($Sql, $szConn);
$szRows = mysql_fetch_row($recordset);

if (isset($szRows[0]))
{
UPDATE accesso SET Password = '$new' WHERE nome = '$szNome' cognome='$szCognome' user_name='$szUser' ;
}
else
{
print "
<SCRIPT language='JavaScript'>
alert('Utente inesistente.')

document.all.item('txtoldpsw').value = '';
</SCRIPT>";

}

}
 
Devi accedere o registrarti per poter rispondere.

Discussioni simili

M
Sintassi query update
  • Max61
  • 18 Lug 2024
  • PHP
Risposte
1
Visite
2K
PHP 23 Apr 2025
webest
T
update
  • twogate
  • 11 Apr 2024
  • PHP
Risposte
2
Visite
2K
PHP 20 Apr 2024
twogate
T
K
Problema form update
  • Kiko74b
  • 22 Giu 2023
  • PHP
Risposte
2
Visite
1K
PHP 3 Ott 2023
WEBLEADERS
W
M
query update e delete
  • mioser
  • 19 Ago 2022
  • PHP
Risposte
0
Visite
783
PHP 19 Ago 2022
mioser
M
N
MAX() + ADD_DATE - per update su Mysql
  • Namaste!
  • 20 Lug 2022
  • MySQL
Risposte
0
Visite
2K
MySQL 20 Lug 2022
Namaste!
N
Windows 7: errore 80072EFE su Windows Update
  • felino
  • 17 Giu 2021
  • Windows e Software
Risposte
1
Visite
4K
Windows e Software 2 Ott 2021
swetajoshi
S
A
pulsante di update campo mysql con javascript
  • AndreaCerre
  • 31 Mar 2021
  • Javascript
Risposte
2
Visite
1K
Javascript 31 Mar 2021
AndreaCerre
A
Update dinamico informazioni scritte in una pagina php
  • elpirata
  • 12 Ago 2020
  • jQuery
Risposte
11
Visite
6K
jQuery 13 Ago 2020
Tommy03
ON DUPLICATE KEY ma in realtà non UPDATE mai
  • MarcoGrazia
  • 21 Lug 2020
  • PHP
Risposte
17
Visite
3K
PHP 2 Set 2020
MarcoGrazia
R
Errore UPDATE tabella mysql
  • Riccardo Contu
  • 4 Lug 2020
  • PHP
Risposte
1
Visite
2K
PHP 4 Lug 2020
Tommy03
M
Update con condizione SQL
  • Maxilboss93
  • 3 Giu 2020
  • PHP
Risposte
7
Visite
1K
PHP 8 Giu 2020
marino51
M
Problema su update di 3 tabelle
  • Max61
  • 28 Mag 2020
  • PHP
Risposte
1
Visite
1K
PHP 28 Mag 2020
macus_adi
G
Problema update di un database
  • geysermill
  • 21 Mag 2020
  • PHP
Risposte
0
Visite
889
PHP 21 Mag 2020
geysermill
G
L
update tabelle in php mysql [risolto]
  • luigithen
  • 31 Mar 2020
  • PHP
Risposte
6
Visite
2K
PHP 31 Mar 2020
luigithen
L
P
update records
  • pasquale98brian
  • 22 Mar 2020
  • PHP
Risposte
2
Visite
1K
PHP 31 Mar 2020
luigithen
L
B
[MySQL] Problemino con UPDATE
  • Bened
  • 11 Ott 2019
  • MySQL
Risposte
10
Visite
2K
MySQL 18 Ott 2019
marino51
M
[PHP] Query UPDATE che non mi aggiorna campi seconda tabella
  • Max61
  • 13 Giu 2019
  • PHP
Risposte
3
Visite
2K
PHP 14 Giu 2019
Max61
M
[Windows 8.1] Windows Update non funziona correttamente
  • felino
  • 6 Mag 2019
  • Windows e Software
Risposte
3
Visite
2K
Windows e Software 17 Mag 2019
felino
P
[PHP] INSERT e UPDATE
  • prate007
  • 7 Apr 2019
  • PHP
Risposte
1
Visite
2K
PHP 8 Apr 2019
marino51
[MYSQL] Schedulare evento per update del campo data su tabella
  • elpirata
  • 4 Apr 2019
  • MySQL
Risposte
0
Visite
1K
MySQL 4 Apr 2019
elpirata
Condividi:
Facebook X (Twitter) LinkedIn WhatsApp e-mail Condividi Link
  • Home
  • Forum
  • Fare Web
  • PHP
  • Italiano
  • Termini e condizioni d'uso del sito
  • Policy Privacy
  • Aiuto
  • Home
Community platform by XenForo® © 2010-2024 XenForo Ltd. | Traduzione a cura di XenForo Italia
Menu
Accedi

Registrati

  • Home
  • Forum
    • Nuovi Messaggi
    • Cerca...
  • Novità
    • Featured content
    • Nuovi Messaggi
    • Ultime Attività
X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?

X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?