<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[chat utente registrato]]></title><description><![CDATA[<p dir="auto">buongiorno ho creato una chat dove l'utente loggato può creare la sua chat e vedere la lista delle stanze create quando entro in chat riconosce il nome della chat ma quando scrivo in chat e do invio mi da pagina bianca non riesco a capire il perchè non inserisce il testo posto ciò che ho creato chiedo aiuto grazie</p>
<pre><code>&lt;?php
    include "config.php";
	include("auth_session.php");
?&gt;
&lt;!doctype html&gt;
&lt;html lang="it"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;title&gt;&lt;?php echo $lang['title'] ?&gt;&lt;/title&gt;
    &lt;link rel="stylesheet" href="bootstrap-4.0.0-dist/css/bootstrap.min.css"&gt;
	&lt;!-- Begin emoji-picker Stylesheets --&gt;
    &lt;link href="lib/css/emoji.css" rel="stylesheet"&gt;
    &lt;!-- End emoji-picker Stylesheets --&gt;
	&lt;script src="https://code.jquery.com/jquery-1.11.3.min.js"&gt;&lt;/script&gt;

    &lt;!-- Begin emoji-picker JavaScript --&gt;
    &lt;script src="lib/js/config.js"&gt;&lt;/script&gt;
    &lt;script src="lib/js/util.js"&gt;&lt;/script&gt;
    &lt;script src="lib/js/jquery.emojiarea.js"&gt;&lt;/script&gt;
    &lt;script src="lib/js/emoji-picker.js"&gt;&lt;/script&gt;
    &lt;style type="text/css"&gt;
        .footer {
            left: 0;
            position: fixed;
            bottom: 0;
            text-align: center;
            color: white;
            width: 100%;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;nav class="navbar navbar-expand-sm bg-dark navbar-dark"&gt;
        &lt;ul class="navbar-nav"&gt;
            &lt;li class="nav-item active"&gt;
                &lt;a class="nav-link" href="profilo.php"&gt;&lt;?php echo $lang['home'] ?&gt;&lt;/a&gt;
            &lt;/li&gt;
            &lt;li class="nav-item"&gt;
                &lt;a class="nav-link" href="creachat.php"&gt;&lt;?php echo $lang['pricing'] ?&gt;&lt;/a&gt;
            &lt;/li&gt;
            &lt;li class="nav-item"&gt;
                &lt;a class="nav-link" href="#"&gt;&lt;?php echo $lang['contact'] ?&gt;&lt;/a&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/nav&gt;
    &lt;div class="container" style="margin-top: 100px;"&gt;
        &lt;div class="row justify-content-center"&gt;
            &lt;div class="col-md-6 col-md-offset-3 text-center"&gt;
                &lt;h1&gt;&lt;?php echo $lang['title'] ?&gt;&lt;/h1&gt;	                
			  &lt;/div&gt;
			   		 &lt;?php
						include('db.php');
						
						$id = $_GET['id'];

						$query=mysqli_query($con,"SELECT chatname FROM chat WHERE chatname = '$id' ");
						while($row=mysqli_fetch_array($query)){
							
							
						?&gt;  
                      
					 


                         &lt;?php 
					include ("db.php");
					
					
					if(!$con)
					{
						die(mysqli_error());
					}
					
					if(isset($_POST['submit']))
					{
						$id = $_POST['id'];
						$msg = trim($_POST['msg']);
						
						$sql = "insert into `chat` (chatname, msg, name) values (chatname='$id', '$msg' , '".$_SESSION['name']."', NOW())";
						$rs = mysqli_query($con, $sql);
						$affectedRows = mysqli_affected_rows($con);
						
						if($affectedRows == 1)
						{
							$successMsg = "Record has been saved successfully";
						}
					}
					?&gt;
                      						
            &lt;/div&gt;
			 
				
            &lt;div&gt;
			
                &lt;div class="panel panel-default" style="height: 400px;"&gt;
                    &lt;div style="height:10px;"&gt;&lt;/div&gt;
                    &lt;span style="margin-left:10px;"&gt;&lt;?php echo $row['chatname']; ?&gt;&lt;/span&gt;&lt;br&gt;
                    &lt;span style="font-size:10px; margin-left:10px;"&gt;&lt;i&gt;---------------------------------------------&lt;/i&gt;&lt;/span&gt;
                    &lt;div style="height:10px;"&gt;&lt;/div&gt;
                    &lt;div id="msg" style="margin-left:10px; max-height:320px; overflow-y:scroll;"&gt;
					           &lt;?php
								include('db.php');
								$id = $_GET['id'];
								$query=mysqli_query($con,"SELECT id, chatname, msg, name FROM chat WHERE chatname='$id' ");
								while($row=mysqli_fetch_array($query)){
								{
								
								 echo $row['name'] ." ". $row['msg'] ."&lt;br /&gt;";
								}
								?&gt;    
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="container"&gt;
                     &lt;form method="post" action="chatname.php"&gt;
                    &lt;p class="lead emoji-picker-container"&gt;
                     &lt;input type="text" name="msg" id="msg" class="form-control" placeholder="Di la tua"data-emojiable="true"&gt;
                    &lt;/p&gt;
                     &lt;input type="hidden" value="&lt;?= $_SESSION['name'] ?&gt;"&gt;  
                      &lt;input type="submit" name="submit" value="invia"&gt;
                     &lt;/form&gt;
                &lt;/div&gt;
           &lt;/div&gt;
		&lt;/div&gt;
                	 
         &lt;script&gt;
				const msg = document.getElementById('msg');

				function appendMsg() {
					const msg = document.getElementsByClassName('msg')[0];
				  const newMsg = msg.cloneNode(true);
				  msg.appendChild(newMsg);
				}

				function getMsg() {
					// Prior to getting your msg.
				  shouldScroll = msg.scrollTop + msg.clientHeight === msg.scrollHeight;
				  /*
				   * Get your msg, we'll just simulate it by appending a new one syncronously.
				   */
				  appendMsg();
				  // After getting your msg.
				  if (!shouldScroll) {
					scrollToBottom();
				  }
				}

				function scrollToBottom() {
				  msg.scrollTop = msg.scrollHeight;
				}

				scrollToBottom();

				setInterval(getMsg, 100);
				&lt;/script&gt;
               &lt;script&gt;
				  $(function() {
					// Initializes and creates emoji set from sprite sheet
					window.emojiPicker = new EmojiPicker({
					  emojiable_selector: '[data-emojiable=true]',
					  assetsPath: 'lib/img/',
					  popupButtonClasses: 'fa fa-smile-o'
					});
					// Finds all elements with `emojiable_selector` and converts them to rich emoji input fields
					// You may want to delay this step if you have dynamically created input fields that appear later in the loading process
					// It can be called as many times as necessary; previously converted input fields will not be converted again
					window.emojiPicker.discover();
				  });
				&lt;/script&gt;
				&lt;?php
								}
							
							?&gt;
		   &lt;/div&gt;
		  &lt;/div&gt;
		&lt;/div&gt;
	  &lt;/div&gt;
          
            





















        
        &lt;?php
								}
							
							?&gt;    

            &lt;/div&gt;
		  &lt;/div&gt;
		&lt;/div&gt;
	  &lt;/div&gt;
    
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/topic/246640/chat-utente-registrato</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 04:02:54 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/246640.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Jul 2021 04:15:05 GMT</pubDate><ttl>60</ttl></channel></rss>