Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2006
    Messaggi
    656

    form aggiornamento dati

    sera...

    avrei bissogno d'aiuto per un modulo per far aggioranre i dati ai miei utenti.

    i dati degli utenti vengono richamati correttamente, il problema è quando si clicca su invia, aggiorna solamente il capo password, gli altri li resetta tutti.

    mi date una mano please??? allego il codice

    <?php
    if (!isset($_SESSION)) {
    session_start();
    }
    $MM_authorizedUsers = "";
    $MM_donotCheckaccess = "true";
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
    // For security, start by assuming the visitor is NOT authorized.
    $isValid = False;
    // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
    // Therefore, we know that a user is NOT logged in if that Session variable is blank.
    if (!empty($UserName)) {
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
    // Parse the strings into arrays.
    $arrUsers = Explode(",", $strUsers);
    $arrGroups = Explode(",", $strGroups);
    if (in_array($UserName, $arrUsers)) {
    $isValid = true;
    }
    // Or, you may restrict access to only certain users based on their username.
    if (in_array($UserGroup, $arrGroups)) {
    $isValid = true;
    }
    if (($strUsers == "") && true) {
    $isValid = true;
    }
    }
    return $isValid;
    }
    $MM_restrictGoTo = "/no-access.html";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
    $MM_qsChar = "?";
    $MM_referrer = $_SERVER['PHP_SELF'];
    if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
    if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
    $MM_referrer .= "?" . $QUERY_STRING;
    $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
    header("Location: ". $MM_restrictGoTo);
    exit;
    }
    ?>
    <?

    include "../affconfig.php";

    mysql_connect($server, $db_user, $db_pass) or die ("Database CONNECT Error (line 18)");
    $errorMsg = '';

    if($_POST['commited'] == 'yes')
    {

    {
    mysql_db_query($database, "UPDATE user SET password = '".$_POST['password']."', ridigita_password = '".$_POST['ridigita_password']."', nome = '".$_POST['nome']."', cognome = '".$_POST['cognome']."', nickname = '".$_POST['nickname']."', email = '".$_POST['email']."', seconda_email = '".$_POST['seconda_email']."' WHERE username = '".$_SESSION['MM_Username']."'")
    or die ("Database INSERT Error (line 7)");
    echo "<p align=center><font color=#009900>".AFF_D_CHANGED."</font></p>";
    }
    }

    $result = mysql_db_query($database, "select * from user where username = '".$_SESSION['MM_Username']."'") or die ("Database INSERT Error (line 19)");
    if($errorMsg != '')
    echo "<p align=center><font color=#ff0000>$errorMsg</font></p>";
    if (mysql_num_rows($result))
    {
    while ($qry = mysql_fetch_array($result))
    {
    ?>
    <form action=details.php method=post ENCTYPE=multipart/form-data>


    <font face=verdana></font><font face=verdana></font></p>
    <font face=verdana>
    <div align=center>



    <table border=0>
    <tr>
    <td width=170>Affiliate ID: </td>
    <td width=152><?=$_SESSION['MM_Username']?></td>
    </tr>
    <tr>
    <td>Password: </td>
    <td>
    <input type=password name=password value="<?=$qry[password]?>"> </td>
    </tr>
    <tr>
    <td><font face="verdana">ridigita password </font></td>
    <td>
    <input type=text name=clientcompany value="<?=$qry[ridigita_password]?>"> </td>
    </tr>
    <tr>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td><font face="verdana">nome</font></td>
    <td>
    <input type=text name=clientfirstname value="<?=$qry[nome]?>"> </td>
    </tr>
    <tr>
    <td><font face="verdana">cognome</font></td>
    <td>
    <input type=text name=clientlastname value="<?=$qry[cognome]?>"> </td>
    </tr>
    <tr>
    <td>nickname</td>
    <td>
    <input type=text name=clientemail value="<?=$qry[nickname]?>"> </td>
    </tr>
    <tr>
    <td>Email: </td>
    <td>
    <input type=text name=clientstreet value="<?=$qry[email]?>"> </td>
    </tr>
    <tr>
    <td><font face="verdana">seconda email</font>: </td>
    <td>
    <input type=text name=clienttown value="<?=$qry[seconda_email]?>"> </td>
    </tr>
    <tr>
    <td height=37 colspan=2 valign=top>
    <center>
    <input type=hidden name=commited value=yes>
    <input type=submit name=Submit>
    </center> </td>
    </tr>
    </table>


    </p>
    </div>
    </font>
    </form>

    </p>
    <?
    }
    }

    include "footer.php";
    ?>

  2. #2
    Quando posti un messaggio che contiene del codice.. usa i delimitatori appositi [ php] e [/php] che se no viene un bordello.. tanto piu se posti tutto quel popo di roba..
    Questa volta, più che un voto.. è favoreggiamento.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.