Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. sappe
    3. Post
    S

    sappe

    @sappe

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 9
    • Post 17
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Età 36
    0
    Reputazione
    19
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User

    Post creati da sappe

    • Centrare contenuto

      Scusate se vi disturbo ancora con cose banali, stavo risistemando il CSS del mio file quando per sbaglio ho cancellato un pezzo e... Non riesco più a ricentrare il contenuto! E' sotto i menù a sinistra 😞 per come cerco di farlo andare da altre parti, non si muove.
      Codice pagina:

      <!DOCTYPE 99/xhtml">
      <head>
      <title>Linguaggio Editoriale</title>
      <lik hr="style.css" rel="stylesheet" type="text/css" />
      <lik re="stylesheet" type="text/css" media="print" href=
      "style_stampa.css" />
      <meta http-equiv="Content-Type" content=
      "text/html; charset=us-ascii" />
      <script type="text/javascript" src="script/cercaPagina.js">
      </script>
      <script type="text/javascript" src="script/stampa.js"></script>
      <script type="text/javascript" src="script/galleria.js"></script>
        <script type="text/javascript">
          <!--
            function in_giorni (s) {
              return Math.floor(s/(1000 * 60 * 60 * 24))
            }
          //-->
        </script>
      </head>
      <body>
      <div>
      <div id="logo">
      <i src="" width="727" height="240" alt=""/>
      </div>
      <div id="navbg">
      <div id="nav">
      <p>menu<p><a h="javascript:stampa()">Stampa la pagina</a></p>
      </div>
      <div id="contentbg">
      
      <div id="content">
      ...contenuti
      
      </div>
      </div>
      </div>
      <div id="spacer">
      <script type="text/javascript" id="data">
        <!--
         var adesso = new Date( );
         document.write("oggi è il " + adesso + "<br/>");
         //-->
      </script>
      </div>
      <div id="spacer2"></div>
      </div>
      </body>
      </html>
      

      codice css:

      body {
      background-image: url();
      background-repeat: repeat-x; 
      background-color: #808080;
      font-family: verdana;
      font-size: 10px;
      }
      
      #logo {
      position: relative;
      
      top: 0px; left: 300px;
      }
      
      .contentbg {
      width: 471px;
      height: 274px;
      background-image: url();
      background-repeat: repeat-x;
      float: left;
      position: left;
      }
      
      #navbg {
      width: 155px;
      height: 274px;
      background-image: url();
      background-repeat: repeat-x; 
      position: absolute;
      
      top: 248px; left: 308px;
      }
      
      #spacer {
      width: 101px;
      height: 277px;
      background-repeat: no-repeat; 
      background-color:;
      color: #C0C0C0;
      text-align: center;
      background-repeat: repeat-x; 
      position: absolute;
      top: 300px; left: 26px;
      }
      
      #nav {
      text-align: center;
      padding-left: 15px;
      padding-right: 15px;
      }
      
      .h2 {
      text-align: right;
      font-family: georgia;
      font-size: 12px;
      color: #FFFFFF;
      width: 98.5%;
      border-bottom: solid 1px #808000;
      border-right: solid 1px;
      border-left: solid 1px;
      font-weight: bold;
      text-transform: uppercase;
      letter-spacing: 2px;
      background-image: url();
      display: block;
      }
      
      .navsubtitle {
      border-bottom: solid 1px #4B4B4B;
      border-right: solid 1px;
      border-left: solid 1px;
      width: 98.5%;
      display: block;
      }
       a {
      text-decoration: none;
      display: block;
      color:;
      border-bottom: solid 1px;
      border-right: solid 1px;
      border-left: solid 1px;
      width: 98.5%;
      }
       a:hover {
      text-decoration: none;
      background-color:;
      color: #6699FF;
      border-right: solid 1px;
      border-left: solid 1px;
      width: 98.5%;
      }
      
      #content {
      padding-left: 18px;
      padding-right: 10px;
      text-align: justify;
      }
      
      h1 {
      text-align: center;
      font-size: 18px;
      color:;
      background-image: url();
      }
      
      a {
      text-decoration: none;
      color:;
      }
      
      a:hover {
      text-decoration: underline;
      color:;
      }
      
      table#simboli {
      border: 1px;
      border-collapse: collapse;
      }
      
      hr {
      color:;
      background:;
      border: 0;
      height: 1px;
      }
      
      strong {
      color:;
      text-decoration: underline;
      }
      
      em {
      color:;
      }
      
      tr {
      background-color:;
      }
      
      
      td {
      background-color:;
      }
      
      

      Grazie in anticipo! :sun:

      postato in Coding
      S
      sappe
    • Galleria immagini javascript

      Basandomi su questo script (alistapart.com/articles/imagegallery), volevo creare una galleria immagini.
      Il problema è che cliccando sull'immagine stessa, apre solo quella (nella stessa pagina): per spiegarmi meglio, invece di venire visualizzata come una galleria nel sito, appare solo lei.
      Questo è il codice che sto usando:

      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
      <title>Com'&egrave; composto un libro</title>
      <link href="style.css" rel="stylesheet" type="text/css">
      <link rel="stylesheet" type="text/css" media="print" href=
      "style_stampa.css">
      <meta http-equiv="Content-Type" content=
      "text/html; charset=us-ascii">
      <script type="text/javascript" src="cercaPagina.js">
      </script>
      <script type="text/javascript" language="javascript">
      function showPic (whichpic) {
       if (document.getElementById) {
        document.getElementById('placeholder')»
        .src = whichpic.href;
        if (whichpic.title) {
         document.getElementById('desc')»
        .childNodes[0].nodeValue = whichpic.title;
        } else {
         document.getElementById('desc')»
        .childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
        }
        return false;
       } else {
        return true;
       }
      }
      </script>
      </head>
      <body>
      <div align="center">
      <table class="maintable" cellpadding="0" cellspacing="0" summary=
      "menu">
      <tr>
      <td colspan="3"><div id="logo"><img src="immagini/banner.gif" width="727"
      height="240" alt=""></div></td>
      </tr>
      <tr>
      <td rowspan="2" class="navbg" valign="top">
      <div id="nav">
      <p><span class="h2">Menu</span> <a href="index.html">Home</a>
      <a href="contatti.html">Contatti</a> <a href=
      "bibliografia.html">Bibliografia</a></p>
      <hr>
      <p><a href="editoriaEditing.html">Editoria e Editing</a> <a href=
      "linguaggioEditoriale.html">Linguaggio editoriale</a> <a href=
      "figureProfessionali.html">Figure Professionali</a> <a href=
      "composizioneLibro.html">Com'&egrave; composto un libro</a>
      <a href="normeEditoriali.html">Norme editoriali</a></p>
      </div>
      </td>
      </tr>
      <tr>
      <td rowspan="2" class="contentbg" valign="top">
      <div id="content">
      <h1>Com'&egrave; composto un libro</h1>
      <p>Ricerca rapida per pagina<input type="text" id=
      "searchInput"><button id="performSearch">Cerca</button></p>
      <hr>
      <h2>Struttura ed elaborazione</h2>
      <h3>Struttura</h3>
      <h4>TIPI DI COPERTINA</h4>
      <p id="desc">Choose an image to begin</p>
      <img id="placeholder" src="images/bg.gif" alt="" />
      <ul>
      <li><a onclick="return showPic(this)" href="images/bananas.jpg" title="A bunch of bananas on a table">some bananas</a></li>
      <li><a onclick="return showPic(this)" href="images/condiments.jpg" title="Condiments in a Chinese restaurant">two bottles</a></li>
      <li><a onclick="return showPic(this)" href="images/shells.jpg" title="Seashells on a table">some shells</a></li>
      </ul>
       .... contenuti ....
      </div>
      </td>
      <td valign="top" class="spacer"></td>
      </tr>
      <tr>
      <td height="2" class="spacer2"></td>
      </tr>
      <tr>
      <td colspan="3" class="creditsbg"></td>
      </tr>
      </table>
      </div>
      </body>
      </html>
      

      Che sto sbagliando? :S
      Grazie infinite per l'aiuto in anticipo!! Scusate se mi blocco sulle cose banali :sun:

      postato in Coding
      S
      sappe
    • RE: css alternativo stampa e schermo

      Risolti entrambi!! Grazie lo stesso ragazzi!! Buona fortuna a voi!! 😉

      postato in Coding
      S
      sappe
    • RE: css alternativo stampa e schermo

      Il primo problema l'ho risolto da me! Mi aiutate per il secondo per favore? :sun:

      postato in Coding
      S
      sappe
    • css alternativo stampa e schermo

      Ciao a tutti, avrei bisogno di aiuto con i fogli di stile, per la precisione due questioni:

      1. per la stampa, come faccio a non far visualizzare il banner e il menù laterale? Il codice della pagina è questo:
      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
       <title>Linguaggio editoriale</title>
        <link href="style.css" rel="stylesheet" type="text/css" media="screen" >
      	<link rel="stylesheet" type="text/css" media="print" href="style_stampa.css" />
        <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
      	<script type="text/javascript" src="cercaPagina.js"></script>
      </head>
      <body>
       <div align="center">
        <table class="maintable" cellpadding="0" cellspacing="0" summary="menu">
         <tr>
          <td colspan="3"><img src="immagini/banner.gif" width="727" height="240" alt="" id="banner"></td>
         </tr>
         <tr>
          <td rowspan="2" class="navbg" valign="top">
           <div id="nav">
            <p><span class="h2">Menu</span> <a href="index.html">Home</a>
            <a href="contatti.html">Contatti</a>
      			<a href="bibliografia.html">Bibliografia</a></p>
      			<hr />
      			<p><a href="editoriaEditing.html">Editoria e Editing</a>
      			<a href="linguaggioEditoriale.html">Linguaggio editoriale</a>
      			<a href="figureProfessionali.html">Figure Professionali</a>
      			<a href="composizioneLibro.html">Com'è composto un libro</a>
      			<a href="normeEditoriali.html">Norme editoriali</a></p>
           </div>
          </td>
         </tr>
         <tr>
          <td rowspan="2" class="contentbg" valign="top">		
      		 <div id="content">
      
      ... contenuto ...
      
      		 </div>
          </td>
          <td valign="top" class="spacer"></td>
         </tr>
         <tr>
          <td height="2" class="spacer2"></td>
         </tr>
         <tr>
          <td colspan="3" class="creditsbg"></td>
         </tr>
        </table>
      </body>
      </html>
      

      Mentre il css della versione stampa è questo (per ora):

      body {
      font-family: verdana;
      font-size: 10px;
      }
      
      td {
      font-family: verdana;
      font-size: 10px;
      }
      
      img#banner {
      display: none;
      }
      
      .maintable {
      width: 727px; 
      margin-top: auto;
      }
      
      .navbg {
      width: 80px;
      height: 274px;
      }
      
      .contentbg {
      width: 471px;
      height: 274px;
      }
      
      .creditsbg {
      width: 727px;
      height: 86px; 
      }
      
      .spacer {
      width: 101px;
      height: 277px;
      }
      
      .spacer2 {
      width: 101px;
      }
      
      #nav {
      display: none;
      }
      
      #banner {
      visibility: hidden;
      }
      
      #content {
      padding-left: 18px;
      padding-right: 10px;
      text-align: justify;
      }
      
      table#simboli {
      border: 1px #000000;
      border-collapse: collapse;
      }
      
      hr {
      border: 0;
      height: 1px;
      }
      

      Provo con visibility: hidden; oppure display: none;, naturalmente dando un id ai tr, ma non funziona... Avete dei suggerimenti?

      1. la seconda cosa, se io volessi fare un css alternativo per uno schermo particolare, come ad esempio uno 800 x 600, come dovrei fare?
        Invece di:
      <link rel="stylesheet" type="text/css" media="print" href="style_stampa.css" />
      

      che attributi devo specificare?

      Scusatemi se sono cose banali... Ma non sono riuscita a trovare da sola una soluzione sul web. Grazie mille in anticipo! :sun:

      postato in Coding
      S
      sappe
    • Errore inserimento commenti

      Ho un problema con la mia pagina dell'inserimento commenti:
      [PHP]Notice: Undefined index: ID in C:\Program Files\EasyPHP-5.3.2\www\Sito\comment.php on line 63

      Notice: Undefined variable: comment in C:\Program Files\EasyPHP-5.3.2\www\Sito\comment.php on line 72
      write a comment before submit it![/PHP]
      In questa pagina ho la mia form:
      [PHP]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <?php session_start();
      ?>
      <HTML>
      <HEAD>
      <TITLE>Image</TITLE><link href="style.css" rel="stylesheet" type="text/css">
      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
      </HEAD>
      <BODY>
      <div align="center">
      <TABLE class="maintable" CELLPADDING="0" CELLSPACING="0">
      <TR>
      <TD COLSPAN=3> <IMG SRC="images/index_01.gif" WIDTH=727 HEIGHT=240 ALT=""></TD>
      </TR>
      <TR>
      <TD ROWSPAN=2 class="navbg" valign="top"><div id="nav">
      <p><span class="h2">Menu</span> <a href="index.php">Home</a> <a href="rules.php">Rules</a>
      <a href="gallery.php">Gallery</a> <a href="upload.php">Upload</a> <a href="search.php">Search</a>
      <span class="endbox"></span> </p>

      <?php
      if ((isset($_SESSION['login']))&&((isset($_SESSION['password'])))){
      echo <<<print

       <p><span class="h2">Logout</span> <a href="profile.php">Your Profile</a> <a href="logout.php">Logout</a><span class="endbox"></span> </p>
           <p><span class="h2">Friendship</span> <a href="users.php">Search user</a> <a href="friend.php">My friends</a> <a href="request.php">Friends request</a> <span class="endbox"></span> </p>
      

      print;
      }
      else {
      echo <<<print

       <p><span class="h2">Sign in</span> <a href="create.html">Create account</a> <a href="login.htm">Login</a><span class="endbox"></span></p>
      

      print;
      }
      ?>
      <?php
      include("connessione.inc");
      if (isset($_SESSION['login'])) {
      $login = $_SESSION['login'];
      $sqlA="SELECT Nickname FROM utenti WHERE Nickname = '$login' AND Admin = '1'";
      $resA=mysql_query($sqlA,$conn)or die("Error!".mysql_error());
      $lines=mysql_num_rows($resA);
      if ($lines == 1){
      echo <<<print

       <p><span class="h2">Admin</span> <a href="admin.php">Administration</a><span class="endbox"></span></p>
      

      print;
      }
      }
      echo <<<print

      </p>
      </div></TD>
      <TD ROWSPAN=2 class="contentbg" valign="top"><div id="content">
      print;
      ?>
      <h1>Image</h1>
      <p>
      <?php
      include("connessione.inc");
      $path=$_GET["path"];
      $title=$_GET["title"];
      $nickname=$_GET["nickname"];//nickname della persona che ha postato l'immagine
      $description=$_GET["description"];
      $ID=$_GET["ID"];//IDsketch
      echo <<<MESS
      <table summary="immagine" border="1" id="image" align="center">
      <tr align="center"><td><a href="$_GET[path]"><img src=$_GET[path] style="width: 60%;"></a></td></tr><tr><th>$title</th><tr><td>by $nickname</td></tr><tr><td>$description</td></tr></table>
      <a href="comment.php?ID=$ID">See the comments of this image</a></br>
      <p><b>Comment</b></br>Write a comment:</br>
      <textarea name="comment" cols="40" rows="4" maxlength="300">
      </textarea>
      <FORM enctype="multipart/form-data" action="comment.php?ID=$ID" id="comment" method="POST" name="modulo">
      <button type="submit">submit</button>
      MESS;

      ?>

      				</p>
            </br>
      				</br>
      				</br>
      				</br>
            <h1>©SketchMania</h1>
      		<TD valign="top" class="spacer"></TD>
      </TR><TR> 
        <TD height="2" class="spacer2"></TD>
      </TR><TR> 
        <TD COLSPAN=3 class="creditsbg">
      			<p>| Contact us <a href:/yahoo.com/" target="_blank">[email protected]</a> | </p></TD>
      </TR>
      

      </TABLE>
      </div>
      </BODY>
      </HTML>[/PHP]
      Mentre questa è la pagina dove le variabili non sono ben ricavate... Non capisco perché però!
      [PHP]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <?php session_start();
      ?>
      <HTML>
      <HEAD>
      <TITLE>Comments</TITLE><link href="style.css" rel="stylesheet" type="text/css">
      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
      </HEAD>
      <BODY>
      <div align="center">
      <TABLE class="maintable" CELLPADDING="0" CELLSPACING="0">
      <TR>
      <TD COLSPAN=3> <IMG SRC="images/index_01.gif" WIDTH=727 HEIGHT=240 ALT=""></TD>
      </TR>
      <TR>
      <TD ROWSPAN=2 class="navbg" valign="top"><div id="nav">
      <p><span class="h2">Menu</span> <a href="index.php">Home</a> <a href="rules.php">Rules</a>
      <a href="gallery.php">Gallery</a> <a href="upload.php">Upload</a> <a href="search.php">Search</a>
      <span class="endbox"></span> </p>

      <?php
      if ((isset($_SESSION['login']))&&((isset($_SESSION['password'])))){
      echo <<<print

       <p><span class="h2">Logout</span> <a href="profile.php">Your Profile</a> <a href="logout.php">Logout</a><span class="endbox"></span> </p>
           <p><span class="h2">Friendship</span> <a href="users.php">Search user</a> <a href="friend.php">My friends</a> <a href="request.php">Friends request</a> <span class="endbox"></span> </p>
      

      print;
      }
      else {
      echo <<<print

       <p><span class="h2">Sign in</span> <a href="create.html">Create account</a> <a href="login.htm">Login</a><span class="endbox"></span></p>
      

      print;
      }
      ?>
      <?php
      include("connessione.inc");
      if (isset($_SESSION['login'])) {
      $login = $_SESSION['login'];
      $sqlA="SELECT Nickname FROM utenti WHERE Nickname = '$login' AND Admin = '1'";
      $resA=mysql_query($sqlA,$conn)or die("Error!".mysql_error());
      $lines=mysql_num_rows($resA);
      if ($lines == 1){
      echo <<<print

       <p><span class="h2">Admin</span> <a href="admin.php">Administration</a><span class="endbox"></span></p>
      

      print;
      }
      }
      echo <<<print

      </p>
      </div></TD>
      <TD ROWSPAN=2 class="contentbg" valign="top"><div id="content">
      print;
      ?>
      <h1>Comments</h1>
      <p>
      <?php
      include("connessione.inc");
      $ID=$_GET["ID"];//IDsketch
      //per prima cosa fare l'inserisci commenti: nickcomment ID del commentatore
      function control ($comment){
      $result=true;
      if ($comment ==''){
      $result=false;
      echo "write a comment before submit it!";
      }
      }
      if (control($comment) == true){
      $sql="INSERT INTO commenti(IDcommento, User, Sketch, Commento) VALUES ($IDcommento, $nickcomment, $ID, $comment)";
      $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
      echo "Your comment it's been added.</br>$IDcommento, $nickcomment, $ID, $comment";
      }
      ?>

      				</p>
            </br>
      				</br>
      				</br>
      				</br>
            <h1>©SketchMania</h1>
      		<TD valign="top" class="spacer"></TD>
      </TR><TR> 
        <TD height="2" class="spacer2"></TD>
      </TR><TR> 
        <TD COLSPAN=3 class="creditsbg">
      			<p>| Contact us <a href="//yahoo.com/" target="_blank">[email protected]</a> | </p></TD>
      </TR>
      

      </TABLE>
      </div>
      </BODY>
      </HTML>[/PHP]
      Tralasciando poi che devo sempre finirla anche graficamente, cos'ho sbagliato? Sapete darmi una mano? 😞
      Grazie della pazienza!

      postato in Coding
      S
      sappe
    • RE: Problema visualizzazione lista amici

      Ti ringrazio ma ho risolto facendo due query separate 😄 grazie ancora e un salutone!

      postato in Coding
      S
      sappe
    • RE: Problema visualizzazione lista amici

      In pratica voglio stampare una lista di amici: ho un sender, che invia l'amicizia, e un receiver, che la riceve e se vuole la accetta. Quindi io volevo selezionare tutte le righe dov'è l'utente connesso (perché è lui che vuole visualizzare la sua lista amici), che può essere sia sender che receiver, perché sono amici indipendentemente che l'abbia chiesta l'uno o l'altro (lo stato dell'amicizia accettata è 1), dopodiché stampare nella tabella l'altro utente, l'amico dell'utente connesso... Non so se mi sono spiegata :S

      postato in Coding
      S
      sappe
    • Problema visualizzazione lista amici

      In una pagina che dovrebbe stamparmi la lista degli utenti amici dell'utente collegato ho scritto questo codice php:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <?php session_start(); 
      $IDutente = $_SESSION['IDutente'];?>
      <HTML>
      <HEAD>
      <TITLE>Your Friends</TITLE><link href="style.css" rel="stylesheet" type="text/css">
      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
      </HEAD>
      <BODY>
      <div align="center">
        <TABLE class="maintable" CELLPADDING="0" CELLSPACING="0">
          <TR> 
            <TD COLSPAN=3> <IMG SRC="images/index_01.gif" WIDTH=727 HEIGHT=240 ALT=""></TD>
          </TR>
          <TR> 
            <TD ROWSPAN=2 class="navbg" valign="top"><div id="nav">
                <p><span class="h2">Menu</span> <a href="index.php">Home</a> <a href="rules.php">Rules</a> 
                  <a href="gallery.php">Gallery</a> <a href="upload.php">Upload</a> <a href="search.php">Search</a>
                  <span class="endbox"></span> </p>
      						
               
      					
      <?php 
      if ((isset($_SESSION['login']))&&((isset($_SESSION['password'])))){
         echo <<<print
      	 
      	 <p><span class="h2">Logout</span> <a href="profile.php">Your Profile</a> <a href="logout.php">Logout</a><span class="endbox"></span> </p>
               <p><span class="h2">Friendship</span> <a href="users.php">Search user</a> <a href="friend.php">My friends</a> <a href="request.php">Friends request</a> <span class="endbox"></span> </p>
      print;
      }
      else {
         echo <<<print
      	 
      	 <p><span class="h2">Sign in</span> <a href="create.html">Create account</a> <a href="login.htm">Login</a><span class="endbox"></span>
      print;
      }
      echo <<<print
      
       </p>
              </div></TD>
            <TD ROWSPAN=2 class="contentbg" valign="top"><div id="content">
                
      print;
      
       ?>
                <h1>Friend page:</h1>
      <h2 align="center">Your friends:</h2>
      <?php 
      include ("connessione.inc");
      $sql="SELECT nickname FROM utenti WHERE IDutente = ALL (SELECT Receiver AS amico FROM amicizie WHERE (Sender = '$IDutente') AND (Friend = '1') UNION SELECT Sender AS amico FROM amicizie WHERE (Receiver = '$IDutente') AND (Friend = '1'))";
      $res = mysql_query($sql, $conn) or die("Error!".mysql_error());
      while ($records = mysql_fetch_assoc($res)){
         echo <<<MESS
      <a href=\"?page="profile.php?id=$records[nickname]\" title=\"Go to his profile\" id=\"previus\">$records[nickname]</a>
      <form action="friend.php" id="delete" method="POST" align="right">
      <input type="submit" name="button" value="Delete" class="button"/> 
      </form>
      MESS;
      }
      //codice del bottone Delete
      if (isset($_POST['button'])){
      $button=$_POST['button'];
         if ($button == "Delete"){
             $sql2="DELETE FROM amicizie WHERE (Receiver = '$IDutente' and Sender = '$records[nickname]') or (Sender = '$records[nickname]' and Receiver = '$IDutente')";
      	     $res2=mysql_query($sql2, $conn) or die("Error!".mysql_error()); 
      	 echo "You and $records[nickname] aren't longer friend.";
      	 }
      }
      ?>	
       </p>
      
      				</p>
      
                </br>
      					</br>
      					</br>
      					</br>
                <h1>©SketchMania</h1>
      			<TD valign="top" class="spacer"></TD>
          </TR><TR> 
            <TD height="2" class="spacer2"></TD>
          </TR><TR> 
            <TD COLSPAN=3 class="creditsbg">
      				<p>| Contact us <a href="yahoo.com/" target="_blank">[email protected]</a> | </p></TD>
          </TR>
        </TABLE>
      </div>
      </BODY>
      </HTML>
      

      Ovviamente l'errore è nella richiesta sql, che riscrivo qua:

      SELECT nickname FROM utenti WHERE IDutente = ALL (SELECT Receiver AS amico FROM amicizie WHERE (Sender = '$IDutente') AND (Friend = '1') UNION SELECT Sender AS amico FROM amicizie WHERE (Receiver = '$IDutente') AND (Friend = '1'))
      

      Il mio database è questo:
      mediafire.com/?j0b4sujt2twja3t
      Sono stata ingannata dal fatto che ieri funzionava, ma avevo solo una amicizia con lo stato '1', quindi solo una accettata. Adesso, però, non riesco assolutamente più a richiamare tramite sql l'altro utente (prima di scrivere ho provato sul database ma nisba).
      Avete qualche idea di come potrei effettuare la query?
      Spero vivamente di non aver sbagliato sezione, vi ringrazio in anticipo per l'aiuto e la pazienza :).

      postato in Coding
      S
      sappe
    • Errore variabile category

      Ciao a tutti, ho un errore con una variabile che invece sembrerebbe essere settata benissimo, eccovi il file:

      <?php 
      include("connessione.inc");
      $title=$_POST["title"];
      $tag1=$_POST["tag1"];
      $tag2=$_POST["tag2"];
      $tag3=$_POST["tag3"];
      $category=$_POST["category"];
      $description=$_POST["description"];
      $who_see=$_POST["who_see"];
      $target_path="uploads/";
      $date=date("j/M/Y");
      $target_path = $target_path.basename( $_FILES['fileUtente']['name']); 
      function control ($title, $tag1, $tag2, $tag3, $description){
         $result=true;
      if ($title=="" or $tag1=="" or $tag2=="" or $tag3=="" or $category=="" or $description=="" or $who_see==""){
         $result=false;
      } return $result;
      }
      if (control ($title, $tag1, $tag2, $tag3, $description) == true){
      if  ($_FILES['fileUtente']['error'] == 0) {
         move_uploaded_file($_FILES['fileUtente']['tmp_name'], $target_path);
            echo "File ".basename( $_FILES['uploadedfile']['name'])." has been uploaded.</br> Now you have to wait that the administrator approve it.";   
           	   echo "<a href='upload.php'>Upload another image.</a>";   
      $sql="INSERT INTO opere(title, tag1, tag2, tag3, category, description, who_see) VALUES('$title','$Tag1', '$Tag2', '$Tag3', '$category', '$description', '$who_see', '$target_path')";
      mysql_query($sql,$conn) or die("Errore!".mysql_error());
      	}
         else   {
      	    echo "Error in the process, try it again!";
      	 }
      }
      else { echo "</br>Missing data</br>"; }
      ?>
      
      

      ed ecco l'errore:

      Notice: Undefined variable: category in C:\Program Files\EasyPHP-5.3.2\www\Sito\uploadOpera.php on line 60

      Missing data

      A me sembra tutto ok, è la pagina che viene quando clicco sul bottone per inviare un'immagine, vi metto anche l'altra pagina:

      <?php 
      include("connessione.inc");
      function autorizza(){
         if ((isset($_SESSION['login']))&&((isset($_SESSION['password'])))){
      	    echo <<<MESS
      			<p>You have logged in and you can submit a file.</p></br>
      <p><b>Choose Sketch:</b>
      <FORM enctype="multipart/form-data" action="uploadOpera.php" id="uploadOpera" method="POST" name="modulo">
       <input name="fileUtente" type="file" maxlength="1000"></p>
      </br>
      <p><b>Title</b></br>
      Insert the title:<br>
      <input type="text" name="title">
      </br></p>
      <p><b>Insert tags</b>:</br>
      <input name="tag1" type="text" size="20" maxlength="30"></br>
      <input name="tag2" type="text" size="20" maxlength="30"></br>
      <input name="tag3" type="text" size="20" maxlength="30"></label>
      </br>
      </p><p>
       <b>Category</b></br>
       <input type="radio" name="category" value="nature" checked="checked"/>Nature
       <input type="radio" name="category" value="people"/>People 
       <br>
       <input type="radio" name="category" value="animal"/>Animal
       <input type="radio" name="category" value="other"/>Other
      </p>
      	</br>
      <p><b>Description</b></br>Describe your sketch:</br>
         <textarea name="description" cols="40" rows="10" maxlength="300" onkeyup="ContaCaratteri()">
      </textarea>
      <input type="text" name="conta" readonly>
      </p>
      	</br>
      	</br>
      	<p><b>Who can see this sketch?</b></br>
         <select name="who_see" >
      	 <option value="1" selected="selected">All users</option>
      	 <option value="0">Only friends</option>
        </select></p>
      	</br>
      	</br>
        <button type="submit">
         submit
       </button>
      MESS;
      }
      	 else {
      	    echo "<p>We are sorry, you need to login to submit a file!</p>";
      	 }
      }
      echo autorizza();
      ?>
      

      Sapete aiutarmi? Ve ne sarei infinitamente grata 😄

      postato in Coding
      S
      sappe
    • Errore visualizzazione richiesta amicizia

      Ho un altro problema, spero che possiate aiutarmi! >_<
      Ho questa pagina:

      
      <h2>Frinds that are waiting for approval:</h2>
       <p>
      <?php 
      include("connessione.inc");
      $user= $_SESSION ['login'];
      $sql3= "SELECT IDutente from utenti WHERE Nickname = '$user'";
      $res3=mysql_query($sql3,$conn)or die("Error!".mysql_error());
      while ($records=mysql_fetch_assoc($res3)) { 
         $IDutente=$records['IDutente'];
      	 }
      $sql="SELECT * FROM utenti JOIN amicizie ON utenti.IDutente = amicizie.Receiver WHERE amicizie.Friend = '0' and amicizie.Receiver = '$IDutente'";
      $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
      $recordperpagina=3;
      $lines=mysql_num_rows($res);
      $tot_page=ceil($lines / $recordperpagina); //numero totale di pagine
      if (isset($_GET['page'])){ $paginacorrente = $_GET['page'];} else { $paginacorrente = 1;}  // pagina corrente				
      $primo = ($paginacorrente - 1) * $recordperpagina; //primo parametro LIMIT
      if ($lines == 0){//controllare variabile
      				    echo <<<MESS
      						   <table summary="norichiesta" id="richiesta">
      <tr>
      <td> You don't have any request for friendship.</td>
      </tr>
      </table>
      MESS;
       	
      }
      if ($lines >= 1) { 
      $sql="SELECT * FROM utenti JOIN amicizie ON utenti.IDutente = amicizie.Receiver WHERE (amicizie.Friend = '0' and amicizie.Receiver = '$IDutente') LIMIT $primo, $recordperpagina"; 
      $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
         while ($records=mysql_fetch_assoc($res)){
         $sql2="SELECT Nickname FROM utenti WHERE IDutente = $records[Sender]";
      							 $res2=mysql_query($sql2,$conn) or die ("Errore!".mysql_error());
      						   while ($records2=mysql_fetch_assoc($res2)){
      							    $Sender = $records['Nickname'];
                     }
      							 echo <<<MESS
      						<table summary="richiesta" id="richiesta">
      <tr>
      <td>
      						You have a friend request from $Sender. Want to be his friend? 
      						<form action="friend.php?sender=$records[Sender]" id="accept" method="POST">
      						<input type="submit"  name="button" value="Accept" class="button"/>
      						<input type="submit" name="button" value="Refuse" class="button"/></form>
      
      </td>
      </tr>
      </table>
      MESS;
         }
      	 if ($paginacorrente == 1){
      						          $precedente = "";
      						       }
      						       else {
      						          $previous_page = ($paginacorrente - 1);
      							        $precedente = "<a href=\"?page=$previous_page\" title=\"See other request\" id=\"previus\"><<-- previous</a>";
      						       }
      						       if($paginacorrente == $tot_page){
      						          $successiva = "";
      									 }
      									 else {
      									    $next_page = ($paginacorrente + 1);
      											$successiva = "<a href=\"?page=$next_page\" title=\"Go back\" id=\"next\">next -->></a>";
      									 }
      	                 echo "$precedente <p id=\"paginacorrente\">Page $paginacorrente of $tot_page </p> $successiva";
      } //chiude if ($lines >= 1)
      
      ?>
      	
       </p>
      

      in pratica mi deve dire se l'utente registrato accetta la richiesta di amicizia da parte di un altro utente, ma visualizza il nickname dell'utente stesso che chiede la richiesta a se stesso!!
      Sender è colui che ha inviato la richiesta, e receiver colui che la riceve, in questo caso l'utente connesso. Nel database è tutto a posto, se faccio la prova e invio una richiesta l'id di sender è di colui che invia la richiesta, allora perché mi stampa il ricevente?
      Grazie in anticipo delle risposte!!

      postato in Coding
      S
      sappe
    • RE: Errore sintassi php

      Ho un altro problema, spero che possiate aiutarmi! >_<
      Ho questa pagina:

      
      <h2>Frinds that are waiting for approval:</h2>
       <p>
      <?php 
      include("connessione.inc");
      $user= $_SESSION ['login'];
      $sql3= "SELECT IDutente from utenti WHERE Nickname = '$user'";
      $res3=mysql_query($sql3,$conn)or die("Error!".mysql_error());
      while ($records=mysql_fetch_assoc($res3)) { 
         $IDutente=$records['IDutente'];
      	 }
      $sql="SELECT * FROM utenti JOIN amicizie ON utenti.IDutente = amicizie.Receiver WHERE amicizie.Friend = '0' and amicizie.Receiver = '$IDutente'";
      $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
      $recordperpagina=3;
      $lines=mysql_num_rows($res);
      $tot_page=ceil($lines / $recordperpagina); //numero totale di pagine
      if (isset($_GET['page'])){ $paginacorrente = $_GET['page'];} else { $paginacorrente = 1;}  // pagina corrente				
      $primo = ($paginacorrente - 1) * $recordperpagina; //primo parametro LIMIT
      if ($lines == 0){//controllare variabile
      				    echo <<<MESS
      						   <table summary="norichiesta" id="richiesta">
      <tr>
      <td> You don't have any request for friendship.</td>
      </tr>
      </table>
      MESS;
       	
      }
      if ($lines >= 1) { 
      $sql="SELECT * FROM utenti JOIN amicizie ON utenti.IDutente = amicizie.Receiver WHERE (amicizie.Friend = '0' and amicizie.Receiver = '$IDutente') LIMIT $primo, $recordperpagina"; 
      $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
         while ($records=mysql_fetch_assoc($res)){
         $sql2="SELECT Nickname FROM utenti WHERE IDutente = $records[Sender]";
      							 $res2=mysql_query($sql2,$conn) or die ("Errore!".mysql_error());
      						   while ($records2=mysql_fetch_assoc($res2)){
      							    $Sender = $records['Nickname'];
                     }
      							 echo <<<MESS
      						<table summary="richiesta" id="richiesta">
      <tr>
      <td>
      						You have a friend request from $Sender. Want to be his friend? 
      						<form action="friend.php?sender=$records[Sender]" id="accept" method="POST">
      						<input type="submit"  name="button" value="Accept" class="button"/>
      						<input type="submit" name="button" value="Refuse" class="button"/></form>
      
      </td>
      </tr>
      </table>
      MESS;
         }
      	 if ($paginacorrente == 1){
      						          $precedente = "";
      						       }
      						       else {
      						          $previous_page = ($paginacorrente - 1);
      							        $precedente = "<a href=\"?page=$previous_page\" title=\"See other request\" id=\"previus\"><<-- previous</a>";
      						       }
      						       if($paginacorrente == $tot_page){
      						          $successiva = "";
      									 }
      									 else {
      									    $next_page = ($paginacorrente + 1);
      											$successiva = "<a href=\"?page=$next_page\" title=\"Go back\" id=\"next\">next -->></a>";
      									 }
      	                 echo "$precedente <p id=\"paginacorrente\">Page $paginacorrente of $tot_page </p> $successiva";
      } //chiude if ($lines >= 1)
      
      ?>
      	
       </p>
      

      in pratica mi deve dire se l'utente registrato accetta la richiesta di amicizia da parte di un altro utente, ma visualizza il nickname dell'utente stesso che chiede la richiesta a se stesso!!
      Sender è colui che ha inviato la richiesta, e receiver colui che la riceve, in questo caso l'utente connesso. Nel database è tutto a posto, se faccio la prova e invio una richiesta l'id di sender è di colui che invia la richiesta, allora perché mi stampa il ricevente?
      Grazie in anticipo delle risposte!!

      postato in Coding
      S
      sappe
    • RE: Errore sintassi php

      Non ci credo che mi sono fatta fregare da un errore così!!! O_O
      Ci ho messo qualche minuto prima di rendermi conto anche quale fosse la tua correzione xDD grazie mille! L'ho testato e funziona 😉 velocissimi e competentissimi come sempre!

      postato in Coding
      S
      sappe
    • RE: Errore sintassi php

      Grazie della risposta e della pazienza, ero in uno stato confusionale dalla stanchezza e non ci capivo più nulla xDDD appena me ne sono accorta e ho risolto mi sarei presa a patte sulla testa!
      Ho un altro problema, relativo al database. Nella pagina di richiesta amicizia (quando un utente clicca quindi per richiedere l'amicizia) mi viene questo errore:

      Error!Cannot add or update a child row: a foreign key constraint fails (`progetto`.`amicizie`, CONSTRAINT `amicizie_ibfk_2` FOREIGN KEY (`Receiver`) REFERENCES `utenti` (`IDutente`) ON DELETE CASCADE ON UPDATE CASCADE)
      

      Il database è questo:
      mediafire.com/?j0b4sujt2twja3t
      Il mio codice php è questo:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <?php session_start(); ?>
      <HTML>
      <HEAD>
      <TITLE>Friend Request</TITLE><link href="style.css" rel="stylesheet" type="text/css">
      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
      </HEAD>
      <BODY>
      <div align="center">
        <TABLE class="maintable" CELLPADDING="0" CELLSPACING="0">
          <TR> 
            <TD COLSPAN=3> <IMG SRC="images/index_01.gif" WIDTH=727 HEIGHT=240 ALT=""></TD>
          </TR>
          <TR> 
            <TD ROWSPAN=2 class="navbg" valign="top"><div id="nav">
                <p><span class="h2">Menu</span> <a href="index.php">Home</a> <a href="rules.php">Rules</a> 
                  <a href="gallery.php">Gallery</a> <a href="upload.php">Upload</a> <a href="search.php">Search</a>
                  <span class="endbox"></span> </p>
      						
               
      					
      <?php 
      if ((isset($_SESSION['login']))&&((isset($_SESSION['password'])))){
         echo <<<print
      	 
      	 <p><span class="h2">Logout</span> <a href="profile.php">Your Profile</a> <a href="logout.php">Logout</a><span class="endbox"></span> </p>
               <p><span class="h2">Friendship</span> <a href="users.php">Search user</a> <a href="friend.php">My friends</a> <a href="request.php">Friends request</a> <span class="endbox"></span> </p>
      print;
      }
      else {
         echo <<<print
      	 
      	 <p><span class="h2">Sign in</span> <a href="create.html">Create account</a> <a href="login.htm">Login</a><span class="endbox"></span>
      print;
      }
      echo <<<print
      
       </p>
              </div></TD>
            <TD ROWSPAN=2 class="contentbg" valign="top"><div id="content">
                
      print;
      
       ?>
                <h1>Request:</h1>
      <p>
      <?php
      include("connessione.inc");
      $ID=$_GET["ID"];
      $user= $_SESSION ['login'];
      $sql= "SELECT IDutente from utenti WHERE Nickname = '$user'";
      $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
      while ($records=mysql_fetch_assoc($res)) { 
         $IDutente=$records['IDutente'];
      	 }
      	 echo "$ID </br> $IDutente";
      $query= "INSERT INTO amicizie (Sender,Receiver) VALUES ('$ID','IDutente')";
      $ress=mysql_query($query,$conn)or die("Error!".mysql_error());
      if ($ress != false){
      echo <<<MESS
      Your friends request è stato inoltrato.
      MESS;
      }
      else {
      echo "Error!";
      }
       ?>				
      </p>
                </br>
      					</br>
      					</br>
      					</br>
                <h1>©SketchMania</h1>
      			<TD valign="top" class="spacer"></TD>
          </TR><TR> 
            <TD height="2" class="spacer2"></TD>
          </TR><TR> 
            <TD COLSPAN=3 class="creditsbg">
      				<p>| Contact us <a href="yahoo.com/" target="_blank">[email protected]</a> | </p></TD>
          </TR>
        </TABLE>
      </div>
      </BODY>
      </HTML>
      

      Avete una qualche idea del perché non funziona? Grazie infinite!!

      postato in Coding
      S
      sappe
    • RE: Errore sintassi php

      Grazie della risposta pronta 🙂 ora ho corretto ma l'errore persiste:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <?php session_start(); ?>
      <HTML>
      <HEAD>
      <TITLE>Results</TITLE><link href="style.css" rel="stylesheet" type="text/css">
      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
      </HEAD>
      <BODY>
      <div align="center">
        <TABLE class="maintable" CELLPADDING="0" CELLSPACING="0" summary="">
          <TR> 
            <TD COLSPAN=3> <IMG SRC="images/index_01.gif" WIDTH=727 HEIGHT=240 ALT=""></TD>
          </TR>
          <TR> 
            <TD ROWSPAN=2 class="navbg" valign="top"><div id="nav">
                <p><span class="h2">Menu</span> <a href="index.php">Home</a> <a href="rules.php">Rules</a> 
                  <a href="gallery.php">Gallery</a> <a href="upload.php">Upload</a> <a href="search.php">Search</a>
                   </p></div>
      						
               
      					
      <?php 
      if ((isset($_SESSION['login']))&&((isset($_SESSION['password'])))){
         echo <<<print
      	 
      	 <p><span class="h2">Logout</span> <a href="profile.php">Your Profile</a> <a href="logout.php">Logout</a><span class="endbox"></span> </p>
               <p><span class="h2">Friendship</span> <a href="users.php">Search user</a> <a href="friend.php">My friends</a> <a href="request.php">Friends request</a> <span class="endbox"></span> </p>
      print;
      }
      else {
         echo <<<print
      	 
      	 <p><span class="h2">Sign in</span> <a href="create.html">Create account</a> <a href="login.htm">Login</a><span class="endbox"></span> <span class="endbox"></span> </p>
      print;
      }
      echo <<<print
      
       </p>
              </div></TD>
            <TD ROWSPAN=2 class="contentbg" valign="top"><div id="content">
                
      print;
      
       ?>
                 <h1>Results</h1>
      <?php
      include("connessione.inc");
      $conta=0;
      if (isset($_GET['search'])){ 
         $search=$_GET['search'];
      } 
      		else {
      		   $search = "WHERE utenti.IDutente != '$IDuser' ";
      			 }
      if (isset ($_POST['nickname'])!= '') { 
         $nickname = addslashes(htmlentities($_POST['nickname']));
      	 $search = $search."and Nickname LIKE '%".$nickname."%' ";
      }
      if (isset ($_POST['name'])!= '') { 
         $name = addslashes(htmlentities($_POST['name']));
      	 $search = $search."and Name LIKE '%".$name."%' ";
      }
      if (isset ($_POST['surname'])!= '') { 
         $surname = addslashes(htmlentities($_POST['surname']));
      	 $search = $search."and Surname LIKE '%".$surname."%' ";
      }
      if (isset ($_POST['place'])!= '') { 
         $place = addslashes(htmlentities($_POST['place']));
      	 $search = $search."and LuogoNascita LIKE '%".$place."%' ";
      }
      if (isset ($_POST['sketch'])!= '') { 
         $conta++;                              
      	 $interest1 = addslashes(htmlentities($_POST['sketch']));
      	 $search = $search."and Interesse1 LIKE '%".$sketch."%' ";
      }
      if (isset ($_POST['art'])!= '') { 
         $conta++;                              
      	 $interest2 = addslashes(htmlentities($_POST['art']));
      	 $search = $search."and Interesse2 LIKE '%".$art."%' ";
      }
      if (isset ($_POST['painting'])!= '') { 
         $conta++;                              
      	 $interest3 = addslashes(htmlentities($_POST['painting']));
      	 $search = $search."and Interesse3 LIKE '%".$painting."%' ";
      }
      if (isset ($_POST['music'])!= '') { 
         $conta++;                              
      	 $interest4 = addslashes(htmlentities($_POST['music']));
      	 $search = $search."and Interesse4 LIKE '%".$music."%' ";
      }
      if (isset ($_POST['games'])!= '') { 
         $conta++;                              
      	 $interest5 = addslashes(htmlentities($_POST['games']));
      	 $search = $search."and Interesse5 LIKE '%".$games."%' ";
      }
      if (isset ($_POST['book'])!= '') { 
         $conta++;                              
      	 $interest6 = addslashes(htmlentities($_POST['book']));
      	 $search = $search."and Interesse6 LIKE '%".$book."%' ";
      }
      if (isset ($_POST['photography'])!= '') { 
         $conta++;                              
      	 $interest7 = addslashes(htmlentities($_POST['photography']));
      	 $search = $search."and Interesse7 LIKE '%".$photography."%' ";
      }
      if (isset ($_POST['film'])!= '') { 
         $conta++;                              
      	 $interest8 = addslashes(htmlentities($_POST['film']));
      	 $search = $search."and Interesse8 LIKE '%".$film."%' ";
      }
      if (isset ($_POST['other'])!= '') { 
         $conta++;                              
      	 $interest9 = addslashes(htmlentities($_POST['other']));
      	 $search = $search."and Interesse9 LIKE '%".$other."%' ";
      }
      $sql="SELECT * FROM (utenti) $search";
      $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
      $lines=mysql_num_rows($res);
      if ($lines = 0){
         echo "There isn't user with that name!";
      }
      else {
         $recordperpagina=5;//numero di record per pagina
      	 $numeropagine=ceil($lines / $recordperpagina);
      {
      	 if (isset ($_GET['page'])){ 
      	 $paginacorrente = $_GET['page'];
      	 }
      	    else { 
      			$paginacorrente = 1;
      	    }
      	    $primolimit = ($paginacorrente - 1)* $recordperpagina;
      
      	 $sql="SELECT * FROM (utenti) $search ORDER BY utenti.Nickname LIMIT $primolimit, $recordperpagina";
         $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
         while ($records=mysql_fetch_assoc($res)) { 
      	 echo "$record[Nickname];</br>$record[Name];</br>$record[Surname]";
      }
      	 
      if ($paginacorrente == 1){
      						          $precedente = "";
      						       }
      						       else {
      						          $previous_page = ($paginacorrente - 1);
      							        $precedente = "<a href=\"?page=$previous_page&search=$search\" title=\"Go to the previous page\" id=\"previus\"><<-- previous</a>";
      						       }
      						       if($paginacorrente == $numeropagine){
      						          $successiva = "";
      									 }
      									 else {
      									    $next_page = ($paginacorrente + 1);
      											$successiva = "<a href=\"?page=$next_page&search=$search\" title=\"Go to the next page\" id=\"next\">next -->></a>";
      									 }
      	                 echo "$precedente <p id=\"paginacorrente\">Pagina $paginacorrente di $numeropagine </p> $successiva";
      	 
      ?> 
                </br>
      					</br>
      					</br>
      					</br>
                <h1>?SketchMania</h1>
            <TD valign="top" class="spacer"></TD>
          </TR><TR> 
            <TD height="2" class="spacer2"></TD>
          </TR><TR> 
            <TD COLSPAN=3 class="creditsbg">
      				<p>| Contact us <a href="yahoo.com/" target="_blank">[email protected]</a> | </p>
      				</TD>
          </TR>
        </TABLE>
      </div>
      </BODY>
      </HTML>
      

      Altri errori di sintassi non riesco a trovarne, punti e virgola, parentesi e altro mi sembrano a posto :S
      In fondo noto questo cambiamento di colore (qui l'immagine): i56.tinypic.com/35ichh0.jpg
      indica forse altri tipi di errore che possono essere la causa del non funzionamento?

      postato in Coding
      S
      sappe
    • Errore sintassi php

      Ho un problema con una pagina php, mi dà questo errore:

      Parse error: syntax error, unexpected $end in C:\Program Files\EasyPHP-5.3.2\www\Sito\results.php on line 167
      proprio sull'ultima riga... Il file è questo:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <?php session_start(); ?>
      <HTML>
      <HEAD>
      <TITLE>Results</TITLE><link href="style.css" rel="stylesheet" type="text/css">
      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
      </HEAD>
      <BODY>
      <div align="center">
        <TABLE class="maintable" CELLPADDING="0" CELLSPACING="0">
          <TR> 
            <TD COLSPAN=3> <IMG SRC="images/index_01.gif" WIDTH=727 HEIGHT=240 ALT=""></TD>
          </TR>
          <TR> 
            <TD ROWSPAN=2 class="navbg" valign="top"><div id="nav">
                <p><span class="h2">Menu</span> <a href="index.php">Home</a> <a href="rules.php">Rules</a> 
                  <a href="gallery.php">Gallery</a> <a href="upload.php">Upload</a> <a href="search.php">Search</a>
                  <span class="endbox"></span> </p>
      						
               
      					
      <?php 
      if ((isset($_SESSION['login']))&&((isset($_SESSION['password'])))){
         echo <<<print
      	 
      	 <p><span class="h2">Logout</span> <a href="profile.php">Your Profile</a> <a href="logout.php">Logout</a><span class="endbox"></span> </p>
               <p><span class="h2">Friendship</span> <a href="users.php">Search user</a> <a href="friend.php">My friends</a> <a href="request.php">Friends request</a> <span class="endbox"></span> </p>
      print;
      }
      else {
         echo <<<print
      	 
      	 <p><span class="h2">Sign in</span> <a href="create.html">Create account</a> <a href="login.htm">Login</a><span class="endbox"></span> <span class="endbox"></span> </p>
      print;
      }
      echo <<<print
      
       </p>
              </div></TD>
            <TD ROWSPAN=2 class="contentbg" valign="top"><div id="content">
                
      print;
      
       ?>
                 <h1>Results</h1>
      <?php
      include("connessione.inc");
      $conta=0;
      if (isset($_GET['search'])){ 
         $search=$_GET['search'];
      } 
      		else {
      		   $search = "WHERE utenti.IDutente != '$IDuser' ";
      if (isset ($_POST['nickname'])!= '') { 
         $nickname = addslashes(htmlentities($_POST['nickname']));
      	 $search = $search."and Nickname LIKE '%".$nickname."%' ";
      }
      if (isset ($_POST['name'])!= '') { 
         $name = addslashes(htmlentities($_POST['name']));
      	 $search = $search."and Name LIKE '%".$name."%' ";
      }
      if (isset ($_POST['surname'])!= '') { 
         $surname = addslashes(htmlentities($_POST['surname']));
      	 $search = $search."and Surname LIKE '%".$surname."%' ";
      }
      if (isset ($_POST['place'])!= '') { 
         $place = addslashes(htmlentities($_POST['place']));
      	 $search = $search."and LuogoNascita LIKE '%".$place."%' ";
      }
      if (isset ($_POST['sketch'])!= '') { 
         $conta++;                              
      	 $interest1 = addslashes(htmlentities($_POST['sketch']));
      	 $search = $search."and Interesse1 LIKE '%".$sketch."%' ";
      }
      if (isset ($_POST['art'])!= '') { 
         $conta++;                              
      	 $interest2 = addslashes(htmlentities($_POST['art']));
      	 $search = $search."and Interesse2 LIKE '%".$art."%' ";
      }
      if (isset ($_POST['painting'])!= '') { 
         $conta++;                              
      	 $interest3 = addslashes(htmlentities($_POST['painting']));
      	 $search = $search."and Interesse3 LIKE '%".$painting."%' ";
      }
      if (isset ($_POST['music'])!= '') { 
         $conta++;                              
      	 $interest4 = addslashes(htmlentities($_POST['music']));
      	 $search = $search."and Interesse4 LIKE '%".$music."%' ";
      }
      if (isset ($_POST['games'])!= '') { 
         $conta++;                              
      	 $interest5 = addslashes(htmlentities($_POST['games']));
      	 $search = $search."and Interesse5 LIKE '%".$games."%' ";
      }
      if (isset ($_POST['book'])!= '') { 
         $conta++;                              
      	 $interest6 = addslashes(htmlentities($_POST['book']));
      	 $search = $search."and Interesse6 LIKE '%".$book."%' ";
      }
      if (isset ($_POST['photography'])!= '') { 
         $conta++;                              
      	 $interest7 = addslashes(htmlentities($_POST['photography']));
      	 $search = $search."and Interesse7 LIKE '%".$photography."%' ";
      }
      if (isset ($_POST['film'])!= '') { 
         $conta++;                              
      	 $interest8 = addslashes(htmlentities($_POST['film']));
      	 $search = $search."and Interesse8 LIKE '%".$film."%' ";
      }
      if (isset ($_POST['other'])!= '') { 
         $conta++;                              
      	 $interest9 = addslashes(htmlentities($_POST['other']));
      	 $search = $search."and Interesse9 LIKE '%".$other."%' ";
      }
      $sql="SELECT * FROM (utenti) $search";
      $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
      $lines=mysql_num_rows($res);
      if ($lines = 0){
         echo "There isn't user with that name!";
      }
      else {
         $recordperpagina=5;//numero di record per pagina
      	 $numeropagine=ceil($lines / $recordperpagina);
      	 if (isset ($_GET['page'])){ $paginacorrente = $_GET['page'];} else { $paginacorrente = 1;}
      	 $primolimit = ($paginacorrente - 1)* $recordperpagina;
      
      	 $sql="SELECT * FROM (utenti) $search ORDER BY utenti.Nickname LIMIT $primolimit, $recordperpagina";
         $res=mysql_query($sql,$conn)or die("Error!".mysql_error());
         while ($records=mysql_fetch_assoc($res)) { 
      	 echo "$record[Nickname];</br>$record[Name];</br>$record[Surname]";
      	 }
      	 
      if ($paginacorrente == 1){
      						          $precedente = "";
      						       }
      						       else {
      						          $previous_page = ($paginacorrente - 1);
      							        $precedente = "<a href=\"?page=$previous_page&cerca=$cerca\" title=\"Go to the previous page\" id=\"previus\"><<-- previous</a>";
      						       }
      						       if($paginacorrente == $numeropagine){
      						          $successiva = "";
      									 }
      									 else {
      									    $next_page = ($paginacorrente + 1);
      											$successiva = "<a href=\"?page=$next_page&cerca=$cerca\" title=\"Go to the next page\" id=\"next\">next -->></a>";
      									 }
      	                 echo "$precedente <p id=\"paginacorrente\">Pagina $paginacorrente di $numeropagine </p> $successiva";
      	 
      ?> 
                </br>
      					</br>
      					</br>
      					</br>
                <h1>©SketchMania</h1>
            <TD valign="top" class="spacer"></TD>
          </TR><TR> 
            <TD height="2" class="spacer2"></TD>
          </TR><TR> 
            <TD COLSPAN=3 class="creditsbg">
      				<p>| Contact us <a href="yahoo.com/" target="_blank">[email protected]</a> | </p>
      				</TD>
          </TR>
        </TABLE>
      </div>
      </BODY>
      </HTML>
      
      

      E' per un progetto, è la pagina che dovrebbe visualizzare gli utenti che risultano dopo una ricerca. Sapete qual'è il mio errore? Grazie infinite 🙂

      postato in Coding
      S
      sappe
    • Salve a tutti

      Mi presento, il mio nick è sappe, il mio nome è Teresa, piacere di conoscervi :ciauz:

      postato in Presentati alla Community
      S
      sappe