Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
I

imperor

@imperor
Non seguire Segui
Informazioni
Post
137
Discussioni
56
Condivisioni
0
Gruppi
0
Da chi è seguito
0
Chi segue
0

Post

Recenti Migliore Controverso

  • codice non funzionante
    I imperor
    Coding

    Buongiorno ho trovato questo codice ma non funziona più ho provato a fare delle modifiche con esito negativo chiedo aiuto grazie

    <script>
    	
    function getText() {
    		
    	var $a =	document.getElementById('text').value;
    	
    		xhr = new XMLHttpRequest();
    		xhr.open('POST' , 'chatdb.php',true);
    		xhr.setRequestHeader('content-type','application/x-www-form-urlencoded');
    		xhr.send('chat='+$a);
    		xhr.onreadystatechange=function(){
    			if (xhr.responseText){
    			//	document.getElementById('chatarea').innerHTML=xhr.responseText;
    									}
    				}
    					}
    		
    
    function setText(){
    	
    	xhr = new XMLHttpRequest();
    	xhr.open('POST' , 'chatFetch.php' , true);
    	xhr.setRequestHeader('content-type','application/x-www-form-urlencoded');
    	xhr.send();
    	xhr.onreadystatechange = function(){
    	//	alert(xhr.responseText);
    			document.getElementById('chatarea').innerHTML = xhr.responseText;
    			}
    		
    	}
    	setInterval("setText()",2000);
    	
    	
    setInterval("users()",3000);
    
    	
    	function users(){
    	xhr1 = new XMLHttpRequest();
    	xhr1.open('POST' , 'userFetch.php' , true);
    	xhr1.setRequestHeader('content-type','application/x-www-form-urlencoded');
    	xhr1.send();
    	xhr1.onreadystatechange = function(){
    	//	alert(xhr.responseText);
    			document.getElementById('loginperson').innerHTML = xhr1.responseText;
    			}
    		
    		
    		}
    		
    		
    </script>
    

  • login con password verify
    I imperor
    Coding

    risolto con un altro codice 🙂


  • login con password verify
    I imperor
    Coding

    salve e ben ritrovati 😀 ho un problema non riesco a far funzionare il login con la password verify dove sbaglio? posto il codice

    <?php
        require('db.php');
        session_start();
        // When form submitted, check and create user session.
        if (isset($_POST['username'])) {
            $username = stripslashes($_REQUEST['username']);    // removes backslashes
            $username = mysqli_real_escape_string($con, $username);
            $password = stripslashes($_REQUEST['password']);
            $password = '$password'; // password inserita dall'utente nel login
    		if (password_verify($password, $password)) {
    			
    		}
            // Check user is exist in the database
            $query    = "SELECT * FROM `users` WHERE username='$username'
                         AND password='$password'";
            $result = mysqli_query($con, $query) or die(mysql_error());
            $rows = mysqli_num_rows($result);
            if ($rows == 1) {
                $_SESSION['username'] = $username;
                // Redirect to user dashboard page
                header("Location: dashboard.php");
            } else {
                echo "<div class='form'>
                      <h3>Incorrect Username/password.</h3><br/>
                      <p class='link'>Click here to <a href='login.php'>Login</a> again.</p>
                      </div>";
            }
        } else {
    ?>
        <form class="form" method="post" name="login">
            <h1 class="login-title">Login</h1>
            <input type="text" class="login-input" name="username" placeholder="Username" autofocus="true"/>
            <input type="password" class="login-input" name="password" placeholder="Password"/>
            <input type="submit" value="Login" name="submit" class="login-button"/>
            <p class="link">Don't have an account? <a href="registration.php">Registration Now</a></p>
      </form>
    

  • texarea quando si invia il testo emette un suono
    I imperor
    Coding

    @giulio-marchesi ha detto in texarea quando si invia il testo emette un suono:

    <script> function f(){ const suono = new Audio("nomefile.mp3"); suono.play(); } </script>

    buongiorno e grazie per la risposta meglio javascript 🙂


  • texarea quando si invia il testo emette un suono
    I imperor
    Coding

    @merlinox ciao ho usato chatGPT 🙂 e mi ha generato funziona alla grande! l'ho inserito nel file dove salva i messaggi sul daatabase

     <?php
    		$myAudioFile = "suoni/whisper.wav";
    		echo '<audio autoplay="true" style="display:none;">
    		<source src="'.$myAudioFile.'" type="audio/wav">
    		</audio>';
    		?>
    

  • texarea quando si invia il testo emette un suono
    I imperor
    Coding

    @merlinox grazie


  • texarea quando si invia il testo emette un suono
    I imperor
    Coding

    ciao a tutti 🙂 come posso fare in modo che quando un utente scrive nella texarea al clik emette un suono?


  • accesso utente
    I imperor
    Coding simple

    Buongiorno sono riuscito a risolvere certo non è un gran che ma va bene e funziona 🙂 posto il codice

    <?php
        session_start();
        include('../db.conn.php');
        if (isset($_POST['username'])) {
            $username = $_POST['username'];
            $password = $_POST['password'];
            $query = $conn->prepare("SELECT * FROM users WHERE username=:username");
            $query->bindParam("username", $username, PDO::PARAM_STR);
            $query->execute();
            $result = $query->fetch(PDO::FETCH_ASSOC);
            if (!$result) {
               
    		$em = "Il nome utente non risulta registrato!";
        	header("Location: ../../index.php?error=$em");
    			
            } else {
                if (password_verify($password, $result['password'])) {
                    $_SESSION['user_id'] = $result['user_id'];
    				$_SESSION['username'] = $result['username'];
    				$_SESSION['name'] = $result['name'];
    				
    				header("Location: ../../home.php");
    				
                    echo '<p class="success">Accesso eseguito con successo!</p>';
                } else {
                    $em = "Nome utente o password errata!";
        	    header("Location: ../../index.php?error=$em");
                }
            }
        }
    ?>
    

  • accesso utente
    I imperor
    Coding simple

    salve non riesco a capire perchè se un utente non registrato prova a effettuare l'accesso da pagina bianca come posso risolvere? chiedo aiuto posto i codici

    <form method="post" 
    			action="app/http/auth.php">
                <div class="d-flex
    			justify-content-center
    			align-items-center
    			flex-column">
    			<h3 class="display-4 fs-1 
    			text-center">
    			</h3>   
    
    			</div>
    			<?php if (isset($_GET['error'])) { ?>
    			<div class="alert alert-warning" role="alert">
    			<?php echo htmlspecialchars($_GET['error']);?>
    			</div>
    			<?php } ?>
    										
    			<?php if (isset($_GET['success'])) { ?>
    			<div class="alert alert-success" role="alert">
    			<?php echo htmlspecialchars($_GET['success']);?>
    			</div>
    			<?php } ?>
    			<div class="mb-3">
    			<label class="form-label">
    			Nome utente</label>
    			<input type="text" 
    			class="form-login"
    			name="username">
    			</div>
    
    			<div class="mb-3">
    			<label class="form-label">
    			Password</label>
    			<input type="password" 
    			class="form-login"
    			name="password">
    			</div>
    									  
    			 <button type="submit" 
    			 class="btn btn-outline-secondary">
    			 Accedi</button>
    			 <a class="btn btn-outline-secondary" href="signup.php" role="button">Registrati</a>
    			 <hr>
    			 <br>
    			 <a class="btn btn-outline-secondary" href="recupero.php" role="button">Password dimenticata?</a>
    			 </form>  
    ----------------------------------------------
    
    <?php  
    session_start();
    
    # check if username & password  submitted
    if(isset($_POST['username']) &&
       isset($_POST['password'])){
    
       # database connection file
       include '../db.conn.php';
       
       # get data from POST request and store them in var
       $password = $_POST['password'];
       $username = $_POST['username'];
       
       $data = "username=".$username;
       
       #simple form Validation
       if(empty($username)){
          # error message
          $em = "inserisci il nome utente";
    
          # redirect to 'index.php' and passing error message
          header("Location: ../../index.php?error=$em&$data");
       }else if(empty($password)){
          # error message
          $em = "inserisci la password";
    
          # redirect to 'index.php' and passing error message
          header("Location: ../../index.php?error=$em&$data");
       }else {
          $sql  = "SELECT * FROM 
                   users WHERE username=?";
          $stmt = $conn->prepare($sql);
          $stmt->execute([$username]);
    
          # if the username is exist
          if($stmt->rowCount() === 1){
            # fetching user data
            $user = $stmt->fetch();
    		
            # if both username's are strictly equal
            if ($user['username'] === $username) {
               
               # verifying the encrypted password
              if (password_verify($password, $user['password'])) {
    			  
    
                # successfully logged in
                # creating the SESSION
                $_SESSION['username'] = $user['username'];
                $_SESSION['name'] = $user['name'];
                $_SESSION['user_id'] = $user['user_id'];
    
                # redirect to 'home.php'
                header("Location: ../../home.php");
    
              }else {
                # error message
                $em = "Nome utente o password errati";
    
                # redirect to 'index.php' and passing error message
                header("Location: ../../index.php?error=$em&$data");
              }
            }else {
              # error message
              $em = "Nome utente o password errati";
    
              # redirect to 'index.php' and passing error message
              header("Location: ../../index.php?error=$em&$data");
            }
          }
       }
    }else {
      header("Location: ../../index.php");
      exit;
    }
    
    
    
    
    

  • sessione utente elimina chat
    I imperor
    Coding

    @oceweb ciao e buona domenica 🙂 sono riuscito a eliminare la chat ora sia l'utente A e B possono eliminare la chat ma la conversazione la può eliminare solo chi invia o chi riceve non riesco a capire cosa manca posto i codici ```

    <?php 
    
    function getConversation($user_id, $conn){
        /**
          Getting all the conversations 
          for current (logged in) user
        **/
        $sql = "SELECT * FROM conversations
                WHERE user_1=? OR user_2=?
                ORDER BY conversation_id DESC";
    
        $stmt = $conn->prepare($sql);
        $stmt->execute([$user_id, $user_id]);
    
        if($stmt->rowCount() > 0){
            $conversations = $stmt->fetchAll();
    
            /**
              creating empty array to 
              store the user conversation
            **/
            $user_data = [];
            
            # looping through the conversations
            foreach($conversations as $conversation){
                # if conversations user_1 row equal to user_id
                if ($conversation['user_1'] == $user_id) {
                	$sql2  = "SELECT *
                	          FROM users WHERE user_id=?";
                	$stmt2 = $conn->prepare($sql2);
                	$stmt2->execute([$conversation['user_2']]);
                }else {
                	$sql2  = "SELECT *
                	          FROM users WHERE user_id=?";
                	$stmt2 = $conn->prepare($sql2);
                	$stmt2->execute([$conversation['user_1']]);
                }
    
                $allConversations = $stmt2->fetchAll();
    
                # pushing the data into the array 
                array_push($user_data, $allConversations[0]);
            }
    
            return $user_data;
    
        }else {
        	$conversations = [];
        	return $conversations;
        }  
    
    }
    ---------------------------
     <ul id="chatList"
        		    class="list-group mvh-50 overflow-auto">
        			<?php if (!empty($conversations)) { ?>
        			    <?php 
    
        			    foreach ($conversations as $conversation){ ?>
    	    			<li class="list-group-item">
    	    				<a href="chat.php?user=<?=$conversation['username']?>"
    	    				   class="d-flex
    	    				          justify-content-between
    	    				          align-items-center p-2">
    	    					<div class="d-flex
    	    					            align-items-center">
    	    					    <img src="uploads/<?=$conversation['p_p']?>"
    	    					         class="w-10 rounded-circle">
    	    					    <h3 class="fs-xs m-2">
    	    					    	<?=$conversation['name']?><br>
                          <small>
                            <?php 
                              echo lastChat($_SESSION['user_id'], $conversation['user_id'], $conn);
                            ?>
                          </small>
    	    					    </h3>            	
    	    					</div>
    	    					<?php if (last_seen($conversation['last_seen']) == "Active") { ?>
    		    					<div title="online">
    		    						<div class="online"></div>
    		    					</div>
    	    					<?php } ?>
    	    				</a>
    						<a href="deleteconv.php?user_2=<?=$conversation['user_id']?>" class="btn btn-danger"><i class="fa fa-trash-o"></i> Elimina messaggi</a>
    	    			</li>
    
    

  • sessione utente elimina chat
    I imperor
    Coding

    @overclokk si concordo in effetti come ho già scritto la chat l'ho scaricata su YouTube fino al 2005 programmavo il mirc con il vincula lo usavo per proteggere le ex chat msn 😋 sinceramente era più facile scrivere il codice


  • sessione utente elimina chat
    I imperor
    Coding

    @oceweb ciao e buongiorno 🙂 non capisco perchè le conversazioni che sono nella home.php riesco a eliminarla solo con: user_1 oppure user_2 ma se provo a inserire conversation_id non funziona posto il codice dove stampa a video le conversazioni

    function getConversation($user_id, $conn){
        /**
          Getting all the conversations 
          for current (logged in) user
        **/
        $sql = "SELECT * FROM conversations
                WHERE user_1=? OR user_2=?
                ORDER BY conversation_id DESC";
    
        $stmt = $conn->prepare($sql);
        $stmt->execute([$user_id, $user_id]);
    
        if($stmt->rowCount() > 0){
            $conversations = $stmt->fetchAll();
    
            /**
              creating empty array to 
              store the user conversation
            **/
            $user_data = [];
            
            # looping through the conversations
            foreach($conversations as $conversation){
                # if conversations user_1 row equal to user_id
                if ($conversation['user_1'] == $user_id) {
                	$sql2  = "SELECT *
                	          FROM users WHERE user_id=?";
                	$stmt2 = $conn->prepare($sql2);
                	$stmt2->execute([$conversation['user_2']]);
                }else {
                	$sql2  = "SELECT *
                	          FROM users WHERE user_id=?";
                	$stmt2 = $conn->prepare($sql2);
                	$stmt2->execute([$conversation['user_1']]);
                }
    
                $allConversations = $stmt2->fetchAll();
    
                # pushing the data into the array 
                array_push($user_data, $allConversations[0]);
            }
    
            return $user_data;
    
        }else {
        	$conversations = [];
        	return $conversations;
        }  
    
    }
    

  • sessione utente elimina chat
    I imperor
    Coding

    @oceweb ariciao 🙂 ho fatto come mi hai detto e funziona! 😋 grazie x l'aiuto


  • sessione utente elimina chat
    I imperor
    Coding

    @oceweb ciao sinceramente non ho provato come mi hai detto ti mostro il codice dove preleva i messaggi sia inviati e ricevuti e li mostra nel file chat.php

    <?php 
    
    function getChats($id_1, $id_2, $conn){
       
       $sql = "SELECT * FROM chats
               WHERE (from_id=? AND to_id=?)
               OR    (to_id=? AND from_id=?)
               ORDER BY chat_id ASC";
        $stmt = $conn->prepare($sql);
        $stmt->execute([$id_1, $id_2, $id_1, $id_2]);
    
        if ($stmt->rowCount() > 0) {
        	$chats = $stmt->fetchAll();
        	return $chats;
        }else {
        	$chats = [];
        	return $chats;
        }
    
    }
    
    ?>
    
    

  • sessione utente elimina chat
    I imperor
    Coding

    la sessione è user_id


  • sessione utente elimina chat
    I imperor
    Coding

    @oceweb ciao questa è la struttura delle tabelle sia conversazione e chat

    
    -- Struttura della tabella `chats`
    --
    
    CREATE TABLE `chats` (
      `chat_id` int(11) NOT NULL,
      `from_id` int(11) NOT NULL,
      `to_id` int(11) NOT NULL,
      `message` text NOT NULL,
      `opened` tinyint(1) NOT NULL DEFAULT 0,
      `create_datetime` datetime NOT NULL DEFAULT current_timestamp()
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
    
    -- --------------------------------------------------------
    
    --
    -- Struttura della tabella `conversations`
    --
    
    CREATE TABLE `conversations` (
      `conversation_id` int(11) NOT NULL,
      `user_1` int(11) NOT NULL,
      `user_2` int(11) NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
    
    

  • sessione utente elimina chat
    I imperor
    Coding

    @overclokk ciao no non ho risolto riesco a eliminare chi invia ma no chi riceve ho riprovato ma elimina chi riceve ma no chi invia come posso fare per eliminare sia chi riceve e chi invia? ho scaricato la chat messaggio privato su YouTube in effetti in fase di registrazione non controlla se la mail è esistente il sito l'ho caricato sul mio dominio fcfclean.it/sito utente Francesco pass albachiara/12 è una pass di test sono riuscito anche a resettare la pass dimenticata non sono un programmatore ma autodidatta il sito è x l'amministratore di condominio dove i condomini si registrano e possono scaricare i doc inviati da l'amministratore e cambiare la foto profilo ho fatto anche la parte admin devo dire che non credo che il sito sia sicuro sto cercando un programmatore logico pagando x sistemare ciò


  • sessione utente elimina chat
    I imperor
    Coding

    risolto 🙂


  • sessione utente elimina chat
    I imperor
    Coding
    salve sto tentando di eliminare una chat la sessione è username ma non ci riesco dove sbaglio?
    
    <a href="delchat.php<?=$chat['message']?><?=$chat['to_id']?>" class="btn btn-danger"><i class="fa fa-trash-o"></i> Delete</a>		
    
    
    file delchat.php
    <?php
    
        include 'app/db.conn.php';
    	
    	
        $get_id = $_GET['to_id'];
    	$conn->query("delete from chats where to_id = '$get_id'");
    	header('location:home.php');
    ?>
    

  • elimina chat utente loggato
    I imperor
    Coding

    buongiorno sto tentando di eliminare due tabelle ho provato cosi ma non va 😞 :

    CREATE TABLE `chats` (
      `chat_id` int(11) NOT NULL,
      `from_id` int(11) NOT NULL,
      `to_id` int(11) NOT NULL,
      `message` text NOT NULL,
      `opened` tinyint(1) NOT NULL DEFAULT 0,
      `created_at` datetime NOT NULL DEFAULT current_timestamp()
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    
    -- --------------------------------------------------------
    
    --
    -- Table structure for table `conversations`
    --
    
    CREATE TABLE `conversations` (
      `conversation_id` int(11) NOT NULL,
      `user_1` int(11) NOT NULL,
      `user_2` int(11) NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    -----------------------------------------------------------
    <?php  
    
    session_start();
    
    # check if the user is logged in
    if(isset($_POST['del'])){
    	
    	# database connection file
    	include 'app/db.conn.php';
    
    	# get the logged in user's username from SESSION
    	$user_id = $_SESSION['user_id'];
    	$chat_id = $_POST['chat_id'];
    	$conversation_id = $_POST['conversation_id'];
    
    $sql = "DELETE chats,conversations
      FROM chat_id AS chats
      LEFT JOIN conversation_id AS conversations ON chat_id.from_id = conversation_id.conversation_id
      WHERE chat_id.from_id = 2;'");
    $stmt= $conn->prepare($sql);
    $stmt->execute([$chat_id, $conversation_id]);
    
    
    	header("Location: home.php");
    	exit;
    }
    
    ?>
    <form action="delchat.php" method="post" enctype="multipart/form-data">
    <input type="hidden" value="<?=$user['username']?>">  
    <input type="submit" name="del" value="Elimina chat">
    </form>
    
    
    
    
  • Accedi

  • Non hai un account? Registrati

  • Accedi o registrati per effettuare la ricerca.
  • Primo post
    Ultimo post
Home Accedi Registrati
Menu
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.