Visualizzazione risultati 1 fino 15 di 15

Discussione: Login utenti

  1. #1
    trombmask non è connesso Neofita
    Data registrazione
    12-04-2007
    Messaggi
    17

    Unhappy Login utenti

    Salve a tutti e chiedo scusa anticipatamente per eventuali errori di qualsiasi genere da parte mia, ma è la prima volta che chiedo aiuto in un forum...

    Ho disperatamente bisogno di aiuto, se potete farlo ve ne sarò immensamente grato..

    Sto creando un sito con dreamweaver e non riesco proprio a capire come visualizzare il nome dell'utente che effettua il login con usernam e password, un utente registrato ovviamente, accede al sito inserendo la sua email nel campo username e la password nell'apposito campo, ho provato ad usare una variabile di sessione ma non ci capisco molto, potreste darmi una mano per favore?
    Grazie anticipatamente, Antonio...

  2. #2
    L'avatar di seneca
    seneca non è connesso Super Moderatore
    Data registrazione
    18-12-2004
    Residenza
    la Città Eterna
    Messaggi
    8,376

    Predefinito

    Posta il tuo script, se ne hai già fatto uno.
    Ciao!


    -- Aut Roma Aut Nihil!

  3. #3
    trombmask non è connesso Neofita
    Data registrazione
    12-04-2007
    Messaggi
    17

    Predefinito

    Codice PHP:
    <?php
    // ---------------------------------------------
    // Pure PHP Upload version 1.1
    // -------------------------------------------
    if (phpversion() > "4.0.6") {
    $HTTP_POST_FILES = &$_FILES;
    }
    define("MAX_SIZE",3000000);
    define("DESTINATION_FOLDER", "./file_utenti");
    define("no_error", "caricamento_file_ok.php");
    define("yes_error", "caricamento_file_bad.php");
    $_accepted_extensions_ = "rar,zip,doc,gif,jpeg,mp3,wmv,swf,";
    if(
    strlen($_accepted_extensions_) > 0){
    $_accepted_extensions_ = @explode(",",$_accepted_extensions_);
    } else {
    $_accepted_extensions_ = array();
    }
    $_file_ = $HTTP_POST_FILES['sfoglia'];
    if(
    is_uploaded_file($_file_['tmp_name']) && $HTTP_POST_FILES['sfoglia']['error'] == 0){
    $errStr = "";
    $_name_ = $_file_['name'];
    $_type_ = $_file_['type'];
    $_tmp_name_ = $_file_['tmp_name'];
    $_size_ = $_file_['size'];
    if(
    $_size_ > MAX_SIZE && MAX_SIZE > 0){
    $errStr = "File troppo pesante";
    }
    $_ext_ = explode(".", $_name_);
    $_ext_ = strtolower($_ext_[count($_ext_)-1]);
    if(!
    in_array($_ext_, $_accepted_extensions_) && count($_accepted_extensions_) > 0){
    $errStr = "Estensione non valida";
    }
    if(!
    is_dir(DESTINATION_FOLDER) && is_writeable(DESTINATION_FOLDER)){
    $errStr = "Cartella di destinazione non valida";
    }
    if(empty(
    $errStr)){
    if(@
    copy($_tmp_name_,DESTINATION_FOLDER . "/" . $_name_)){
    header("Location: " . no_error);
    } else {
    header("Location: " . yes_error);
    }
    } else {
    header("Location: " . yes_error);
    }
    }

    // ---------------------------------------------
    // Pure PHP Upload version 1.1
    // -------------------------------------------
    if (phpversion() > "4.0.6") {
    $HTTP_POST_FILES = &$_FILES;
    }
    define("MAX_SIZE",3000000);
    define("DESTINATION_FOLDER", "./file_utenti");
    define("no_error", "caricamento_file_ok.php");
    define("yes_error", "caricamento_file_bad.php");
    $_accepted_extensions_ = "doc,rar,txt,zip,gif,";
    if(
    strlen($_accepted_extensions_) > 0){
    $_accepted_extensions_ = @explode(",",$_accepted_extensions_);
    } else {
    $_accepted_extensions_ = array();
    }
    $_file_ = $HTTP_POST_FILES['sfoglia_doc'];
    if(
    is_uploaded_file($_file_['tmp_name']) && $HTTP_POST_FILES['sfoglia_doc']['error'] == 0){
    $errStr = "";
    $_name_ = $_file_['name'];
    $_type_ = $_file_['type'];
    $_tmp_name_ = $_file_['tmp_name'];
    $_size_ = $_file_['size'];
    if(
    $_size_ > MAX_SIZE && MAX_SIZE > 0){
    $errStr = "File troppo pesante";
    }
    $_ext_ = explode(".", $_name_);
    $_ext_ = strtolower($_ext_[count($_ext_)-1]);
    if(!
    in_array($_ext_, $_accepted_extensions_) && count($_accepted_extensions_) > 0){
    $errStr = "Estensione non valida";
    }
    if(!
    is_dir(DESTINATION_FOLDER) && is_writeable(DESTINATION_FOLDER)){
    $errStr = "Cartella di destinazione non valida";
    }
    if(empty(
    $errStr)){
    if(@
    copy($_tmp_name_,DESTINATION_FOLDER . "/" . $_name_)){
    header("Location: " . no_error);
    } else {
    header("Location: " . yes_error);
    }
    } else {
    header("Location: " . yes_error);
    }
    }

    if (!
    function_exists("GetSQLValueString")) {
    function
    GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

    $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

    switch (
    $theType) {
    case
    "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case
    "long":
    case
    "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case
    "double":
    $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
    break;
    case
    "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case
    "defined":
    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
    break;
    }
    return
    $theValue;
    }
    }

    $colname_rsciao = "-1";
    if (isset(
    $_SESSION['nome'])) {
    $colname_rsciao = $_SESSION['nome'];
    }
    mysql_select_db($database_trombmask, $trombmask);
    $query_rsciao = sprintf("SELECT id, nome FROM registrazione_utenti WHERE nome = %s", GetSQLValueString($colname_rsciao, "text"));
    $rsciao = mysql_query($query_rsciao, $trombmask) or die(mysql_error());
    $row_rsciao = mysql_fetch_assoc($rsciao);
    $totalRows_rsciao = mysql_num_rows($rsciao);
    ?>
    <?php
    require_once('Connections/trombmask.php'); ?>
    <?php
    //initialize the session
    if (!isset($_SESSION)) {
    session_start();
    }

    // ** Logout the current user. **
    $logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
    if ((isset(
    $_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
    $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
    }

    if ((isset(
    $_GET['doLogout'])) &&($_GET['doLogout']=="true")){
    //to fully log out a visitor we need to clear the session varialbles
    $_SESSION['MM_Username'] = NULL;
    $_SESSION['MM_UserGroup'] = NULL;
    $_SESSION['PrevUrl'] = NULL;
    unset(
    $_SESSION['MM_Username']);
    unset(
    $_SESSION['MM_UserGroup']);
    unset(
    $_SESSION['PrevUrl']);

    $logoutGoTo = "grazie_per.php";
    if (
    $logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
    }
    }
    ?>
    <?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 = "login_ches****.php";
    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;
    }
    ?>

    Questa è la pagina a cui si accede dopo il login...
    Grazie per il soccorso...
    Ultima modifica di seneca : 14-01-2008 alle ore 21.15.41
    Antonio

  4. #4
    L'avatar di funcool
    funcool non è connesso Utente storico
    Data registrazione
    05-02-2004
    Residenza
    Qui... Non lì, qui!
    Messaggi
    15,433

    Predefinito

    Dovresti visualizzare l'username stampando a video $_SESSION['MM_Username'].
    Mattia vi manda a FunCool - Matriz - Directory Gogol - Sfondo rosso per la Birmania
    «Tu mi dai fastidio perché ti credi tanto un Dio!» «Bè, dovrò pur prendere un modello a cui ispirarmi, no?» Woody Allen

  5. #5
    trombmask non è connesso Neofita
    Data registrazione
    12-04-2007
    Messaggi
    17

    Predefinito Aiutatemi please..

    io vorrei visualizzare il nome dell'utente registrato quando lui effettua l'accesso al sito tipo: Bentornato"Gianni", non il suo username, anche se non riesco a far apparire neanche quello..
    Potete aiutarmi?
    Please....
    Antonio

  6. #6
    L'avatar di funcool
    funcool non è connesso Utente storico
    Data registrazione
    05-02-2004
    Residenza
    Qui... Non lì, qui!
    Messaggi
    15,433

    Predefinito

    Per stampare quello vuoi tu ti dovrebbe bastare:
    Codice PHP:
    echo "Benvenuto ".$colname_rsciao;
    P.S.: Non chiedermi aiuto in privato.
    Mattia vi manda a FunCool - Matriz - Directory Gogol - Sfondo rosso per la Birmania
    «Tu mi dai fastidio perché ti credi tanto un Dio!» «Bè, dovrò pur prendere un modello a cui ispirarmi, no?» Woody Allen

  7. #7
    trombmask non è connesso Neofita
    Data registrazione
    12-04-2007
    Messaggi
    17

    Predefinito login Utenti

    Ok funcool, sorry...

    Adesso provo...
    Grazie
    Antonio

  8. #8
    L'avatar di makpaolo
    makpaolo non è connesso Utente storico
    Data registrazione
    08-05-2003
    Residenza
    Brescia ( prov.)
    Messaggi
    9,399

    Predefinito

    ho unito le 2 discussioni, prego fare più attenzione
    Se smetti di imparare e evolverti sei morto dentro

  9. #9
    trombmask non è connesso Neofita
    Data registrazione
    12-04-2007
    Messaggi
    17

    Predefinito Login Utenti aiutatemi......

    echo "Benvenuto ".$colname_rsciao;



    non riesco proprio, io uso dreamweaver, non ho molta confidenza con il linguaggio...

    Saresti un pò più esauriente per favore?
    Dove devo inderire il codice che mi hai dato?
    Antonio
    Antonio

  10. #10
    L'avatar di funcool
    funcool non è connesso Utente storico
    Data registrazione
    05-02-2004
    Residenza
    Qui... Non lì, qui!
    Messaggi
    15,433

    Predefinito

    Potresti metterlo alla fine subito prima di "?>".
    Mattia vi manda a FunCool - Matriz - Directory Gogol - Sfondo rosso per la Birmania
    «Tu mi dai fastidio perché ti credi tanto un Dio!» «Bè, dovrò pur prendere un modello a cui ispirarmi, no?» Woody Allen

  11. #11
    Guest

    Smile Le las divinas

    ciao e benvenuti a tutti!!!!!
    ,mi presento sono ANGELA ALFANO
    vi scrivo e mi presento xke volevo farvi conoscere delle mie compagne di classe.
    hanno la mia eta': 11 anni.
    io sono la loro menager
    la manager del gruppo delle DIVINE.
    loro nn vogliono specificare i nomi ......
    ci vediamo con i nostri aggiornamenti.
    tutti i giorni potete commentare se volete....
    GRAZIE A CHI AVESSE LETTO LA NOSTRA PRESENTAZIONE CIOE' QUELLA DELLE DIVINE!!!!
    grazie dalla redazione TORR.

  12. #12
    Guest

    Predefinito

    Sinceramente non capisco che cosa ha questo a che fare con la discussione in corso...

  13. #13
    Guest

    Predefinito

    Già che centra?

  14. #14
    Guest

    Predefinito

    Perche nn cambi e provi su altervista

  15. #15
    L'avatar di alemoppo
    alemoppo non è connesso Staff AV
    Data registrazione
    24-08-2008
    Residenza
    PU / BO
    Messaggi
    22,270

    Predefinito

    Discussione iniziata quasi 6 anni fa. Direi che è meglio chiuderla.

    Ciao!

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •