• Home
  • Forum
  • Fare Web
  • PHP

Interazione solo tra utenti stile facebook

  • Creatore Discussione Creatore Discussione searedone
  • Data di inizio Data di inizio 2 Ott 2011
Prec.
  • 1
  • 2
  • 3
Primo Prec. 3 di 3

alessandro1997

Utente Attivo
6 Ott 2009
5.302
1
0
27
Roma
alessandro1997.netsons.org
  • 14 Ott 2011
  • #41
AAHAHHAHAHAHAAHA IL MAESTRO PERDE COLPI
Clicca per allargare...
Bah, più che altro una brutta copia del maestro...
 

borgo italia

Super Moderatore
Membro dello Staff
SUPER MOD
MOD
4 Feb 2008
16.044
150
63
PR
www.borgo-italia.it
  • 14 Ott 2011
  • #42
alessandro1997 ha scritto:
Bah, più che altro una brutta copia del maestro...
Clicca per allargare...
più che altro una brutta copia di un brutto maestro
 
S

searedone

Utente Attivo
11 Giu 2010
508
0
0
  • 15 Ott 2011
  • #43
nuuuuuuuuuu .. meno male che i sono persone come Borgo nei forum....... non smetterò mai di ringraziarlo ....

Vi chiedo alcune curiosità ....

Ma la clausola header in remoto su mamp non funziona ????

Questo perché mi tocca utilizzare nel posto <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> ma ovviamente mi posta ad ogni refresh un commento vuoto ;(

vi posto il codice senza leader si può' fare qualcosa per far si che ad ogni refresh non posti nulla

PHP:
<?php 
include 'dbc.php';
page_protect();


?>
<html>
<head>
<title>My Account</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="styles.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="main">
  <tr> 
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr> 
    <td width="160" valign="top">
<?php 
/*********************** MYACCOUNT MENU ****************************
This code shows my account menu only to logged in users. 
Copy this code till END and place it in a new html or php where
you want to show myaccount options. This is only visible to logged in users
*******************************************************************/
if (isset($_SESSION['user_id'])) {?>
<div class="myaccount">
  <p><strong>My Account</strong></p>
  <a href="myaccount.php">My Account</a><br>
  <a href="mysettings.php">Settings</a><br>
    <a href="logout.php">Logout </a>
	
  <p>You can add more links here for users</p></div>
<?php }
if (checkAdmin()) {
/*******************************END**************************/
?>
      <p> <a href="admin.php">Admin CP </a></p>
	  <?php } ?>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p></td>
    <td width="732" valign="top"><p>&nbsp;</p>
      <h3 class="titlehdr">Welcome <?php echo $_SESSION['user_name'];?></h3>  
	  <?php	
      if (isset($_GET['msg'])) {
	  echo "<div class=\"error\">$_GET[msg]</div>";
	  }
	  	  
	  ?>
      <p>This is the my account page</p>
      
      <a href="accetta.php" />Controlla se hai richieste d'amicizia</a>
      
      <br />
      <br />
      
      <br />
<?php echo $_SESSION['user_id'];  
require ("db_connect.php"); 


$user_id = $_POST['user_id']; 



$commento=$_POST["commento"];
$commento=ereg_replace("\n","<br>",$commento); 

if(get_magic_quotes_gpc()) { 


$commento=stripslashes($commento); 
} 

$commento =mysql_real_escape_string($commento); 

$insert = mysql_query("INSERT INTO annunci SET
commento='$commento', user_id=".$_SESSION['user_id'].""); 

 


?>
	 
 <div class="content">
    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
     
      <p>
        <label for="commento"></label>
        <textarea name="commento" id="commento" cols="55" rows="20"></textarea>
      </p>
      <p>
        <input type="submit" name="submit" id="submit" value="Invia Commento" />
      </p>
    </form>
    </div>
    
    
   <?php 
   
   
require ("db_connect.php"); 



$result = mysql_query("SELECT * FROM annunci, users WHERE user_id=".$_SESSION['user_id']. " AND  user_id=users.id
"); 


//recuperiamo i dati da stampare 


while ($records = mysql_fetch_array($result)) {  


$commento = $records['commento'];
$user_name = $records['user_name'];
$ts = $records['ts'];
 echo "<a href=\"myprofile.php?user_name=$user_name\">$user_name</a>"; 
echo "<h2> <img src='immagini/.gif' width='30' height='50' /> $user_name</h2> "; 
echo "<h6>$commento</h6> "; 
echo "<h6>$ts</h6> "; 



} 

?>


  
	 
	 
      </td>
    <td width="196" valign="top">&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="3">&nbsp;</td>
  </tr>
</table>

</body>
</html>


Un'altra cosa ... allora così mi vede i post che metto nel mio profilo e così è ok

Il prox passaggio era fare una bacheca tipo facebook dove si vedono i mex postati dagli utenti che nella tabella relationship ( user_! user_2 = amico S e non N )

Ho fatto una join ma mi da risultati 0 .

Mi sapete dire cosa sbaglio ???

PHP:
<?php 
include 'dbc.php';
page_protect();


?>
<html>
<head>
<title>My Account</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="styles.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="main">
  <tr> 
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr> 
    <td width="160" valign="top">
<?php 
/*********************** MYACCOUNT MENU ****************************
This code shows my account menu only to logged in users. 
Copy this code till END and place it in a new html or php where
you want to show myaccount options. This is only visible to logged in users
*******************************************************************/
if (isset($_SESSION['user_id'])) {?>
<div class="myaccount">
  <p><strong>My Account</strong></p>
  <a href="myaccount.php">My Account</a><br>
  <a href="mysettings.php">Settings</a><br>
    <a href="logout.php">Logout </a>
	
  <p>You can add more links here for users</p></div>
<?php }
if (checkAdmin()) {
/*******************************END**************************/
?>
      <p> <a href="admin.php">Admin CP </a></p>
	  <?php } ?>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p></td>
    <td width="732" valign="top"><p>&nbsp;</p>
      <h3 class="titlehdr">Welcome <?php echo $_SESSION['user_name'];?></h3>  
	  <?php	
      if (isset($_GET['msg'])) {
	  echo "<div class=\"error\">$_GET[msg]</div>";
	  }
	  	  
	  ?>
      <p>This is the my account page</p>
      
      <a href="accetta.php" />Controlla se hai richieste d'amicizia</a>
      
      <br />
      <br />
      
      <br />
<?php echo $_SESSION['user_id'];  
require ("db_connect.php"); 


$user_id = $_POST['user_id']; 



$commento=$_POST["commento"];
$commento=ereg_replace("\n","<br>",$commento); 

if(get_magic_quotes_gpc()) { 


$commento=stripslashes($commento); 
} 

$commento =mysql_real_escape_string($commento); 

$insert = mysql_query("INSERT INTO annunci SET
commento='$commento', user_id=".$_SESSION['user_id'].""); 

 


?>
	 
 <div class="content">
    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
     
      <p>
        <label for="commento"></label>
        <textarea name="commento" id="commento" cols="55" rows="20"></textarea>
      </p>
      <p>
        <input type="submit" name="submit" id="submit" value="Invia Commento" />
      </p>
    </form>
    </div>
    
    
   <?php 
   
   
require ("db_connect.php"); 



$result = mysql_query("SELECT * FROM
        annunci 
        INNER JOIN users ON (annunci.user_id=users.id )
         INNER JOIN relationship ON (annunci.relationshipid=relationship.id)
     
    
     
WHERE
     WHERE user_id=".$_SESSION['user_id']. " AND relationship.amico='S'  ORDER BY `user_id` DESC LIMIT "); 


//recuperiamo i dati da stampare 


while ($records = mysql_fetch_array($result)) {  


$commento = $records['commento'];
$user_name = $records['user_name'];
$ts = $records['ts'];

echo "<h2> <img src='immagini/.gif' width='30' height='50' /> $user_name</h2> "; 
echo "<h6>$commento</h6> "; 
echo "<h6>$ts</h6> "; 



} 

?>


  
	 
	 
      </td>
    <td width="196" valign="top">&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="3">&nbsp;</td>
  </tr>
</table>

</body>
</html>
 

borgo italia

Super Moderatore
Membro dello Staff
SUPER MOD
MOD
4 Feb 2008
16.044
150
63
PR
www.borgo-italia.it
  • 16 Ott 2011
  • #44
ciao
prima una tiratina d'orecchi: fai un altro post "un problema un post", questo perchè diventa più difficile seguire il tutto, poi anche altri utenti che potrebbero essere interessati e non trovano l'qrgomento.
comunque fammi vedere come hai messo l'header, poi il fatto di mettere $_SERVER non c'entra, per i valori vuoti, comunque (non oggi) ci dò un occhio poi ti so dire.
 
S

searedone

Utente Attivo
11 Giu 2010
508
0
0
  • 16 Ott 2011
  • #45
ok scusaaaaaaaaaaa....

Apro due nuovi post ...

Uno per i post multipli

e uno per la bacheca ...

Grazie mille Borgo e scusa
 
Prec.
  • 1
  • 2
  • 3
Primo Prec. 3 di 3
Devi accedere o registrarti per poter rispondere.

Discussioni simili

M
Interazione tra un più campi di un form con un solo campo di database - query mysql
  • megarospo
  • 27 Mag 2008
  • PHP
Risposte
2
Visite
2K
PHP 3 Giu 2008
megarospo
M
A
PROBLEMA INTERAZIONE PHP E JAVASCRIPT
  • andre2796
  • 23 Nov 2017
  • PHP
Risposte
1
Visite
2K
PHP 23 Nov 2017
Max 1
F
Interazione tra i form html ajax e php
  • francesco1976
  • 16 Mag 2017
  • PHP
Risposte
3
Visite
3K
PHP 16 Mag 2017
francesco1976
F
F
Facebook ADS ... meglio impression o interazione con post?
  • Fabio_TO
  • 25 Apr 2017
  • Social Media Marketing
Risposte
1
Visite
2K
Social Media Marketing 18 Mag 2017
Itinerariodiviaggio
A
interazione su campo input dopo l'inserimento della prima lettera
  • amhal
  • 23 Feb 2017
  • jQuery
Risposte
2
Visite
1K
jQuery 24 Feb 2017
amhal
A
S
[PHP] Interazione tra due finestre. Come fare?
  • samurai.sette
  • 27 Ott 2016
  • PHP
Risposte
4
Visite
2K
PHP 31 Ott 2016
samurai.sette
S
V
Interazione excel con pagina web
  • Vale Tammariello
  • 2 Ott 2015
  • HTML e CSS
Risposte
1
Visite
2K
HTML e CSS 2 Ott 2015
Max 1
interazione con VNC
  • MrClog
  • 26 Gen 2015
  • PHP
Risposte
0
Visite
1K
PHP 26 Gen 2015
MrClog
interazione PHP Access con paginazione
  • ste80
  • 27 Ago 2013
  • PHP
Risposte
7
Visite
2K
PHP 28 Ago 2013
ste80
L
Interazione Javascript con Java
  • luis20
  • 5 Nov 2012
  • Javascript
Risposte
0
Visite
1K
Javascript 5 Nov 2012
luis20
L
Problemi Interazione tra PHP\JS\MYSQL
  • Albertoesse
  • 21 Set 2012
  • PHP
Risposte
3
Visite
2K
PHP 23 Set 2012
criric
Interazione session_start() e array associativo
  • Athene
  • 23 Mar 2012
  • PHP
Risposte
5
Visite
1K
PHP 24 Mar 2012
Athene
Interazione tra il foreach e una tabella html
  • Athene
  • 16 Mar 2012
  • PHP
Risposte
12
Visite
4K
PHP 17 Mar 2012
Athene
S
bacheca interazione tra utenti stile facebook ...
  • searedone
  • 16 Ott 2011
  • PHP
  • 2 3
Risposte
49
Visite
6K
PHP 20 Ott 2011
searedone
S
M
interazione database con google maps
  • marine
  • 25 Ago 2011
  • Javascript
Risposte
0
Visite
2K
Javascript 25 Ago 2011
marine
M
V
Interazione tra PHP e MS Access, aggiungere WHERE condition
  • vgsangiuliano
  • 21 Dic 2010
  • PHP
Risposte
2
Visite
2K
PHP 22 Dic 2010
vgsangiuliano
V
X
interazione javascript e php (aggirare limite)
  • xeryan
  • 6 Ott 2010
  • Javascript
Risposte
2
Visite
2K
Javascript 6 Ott 2010
xeryan
X
interazione programmazione web .exe con laurea breve
  • emanuelevt
  • 8 Gen 2010
  • Discussioni Varie
Risposte
5
Visite
2K
Discussioni Varie 14 Gen 2010
emanuelevt
F
interazione database template system
  • felixaf21
  • 29 Apr 2009
  • PHP
Risposte
1
Visite
1K
PHP 29 Apr 2009
felixaf21
F
G
Snoopy e Php,tentativo di interazione con sito
  • Giuliotresauri
  • 11 Nov 2008
  • PHP
Risposte
1
Visite
2K
PHP 11 Nov 2008
Eliox
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?