Pagina 2 di 3 primaprima 1 2 3 ultimoultimo
Visualizzazione dei risultati da 11 a 20 su 23
  1. #11
    Utente di HTML.it
    Registrato dal
    Mar 2011
    Messaggi
    53
    Affitti php (che in realtà adesso uso per gestire delle news)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>News - Sezione di aggiornamento</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>


    <body bgcolor="#999999" text="#FFFFFF">
    <p><img src="../images/object1264150268.png" align="absmiddle"> <font size="+3"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amministrazione
    del Sito </strong></font>


    <table width="100%" border="0">
    </p>
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    <tr>


    <td width="20%" valign="top">
    <p><a href="affittipr.php">Corsi</a></p>
    <p><a href="affitti.php">News</a></p>
    <p><br>
    </p></td>
    <td width="80%" valign="top"><font size="+1"><em><strong>Elenco
    delle news</strong></em></font><br>
    <br>


    <?php


    global $id_aff;
    global $affitti;
    global $img;
    global $img_small;
    global $descrizione;
    global $zona;
    global $cod_aff;
    global $rif;




    //Connessione
    include 'conn.php';
    //Leggo i dati dal DB
    $dati=mysql_query("select id_aff, affitti, descrizione, zona, img_small from AFFITTI order by affitti");
    //Controllo che siano caricati i dati
    if (mysql_num_rows($dati)>0) {
    while ($rs=mysql_fetch_array($dati, MYSQL_BOTH)) {
    echo "<img src='../admin/images/".$rs["img_small"]."' border='0' align='absmiddle'> -
    ".$rs["affitti"]."<br><a href=classi.php?id_aff=".$rs["id_aff"].">
    </a> <br>
    <a href='aff_modifica.php?id_aff=".$rs["id_aff"]."'>Maodifica questa news</A><br><br>
    <a href='aff_elimina.php?id_aff=".$rs["id_aff"]."'>Elimina questa news</a><br><br>"
    ;
    }
    }
    echo "<br><br><a href='aff_modifica.php?id_aff=0'>Inserisci una news</A><br>"
    ?>


    </body>
    </html>



    Aff_modifica.php


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">


    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Amministrazione</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>


    <body bgcolor="#999999" text="#FFFFFF">
    <img src="../images/object1264150268.png" align="absmiddle"> <font size="+3"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amministrazione
    del Sito </strong></font>
    <table width="100%" border="0">
    <tr>
    <td width="20%" valign="top">
    <p><a href="affittipr.php">Corsi</a></p>
    <p><a href="affitti.php">News</a></p>
    </td>


    <?php
    //Connessione


    include 'conn.php';
    $conn=mysql_connect($host,$user,$pwd);
    mysql_select_db($db,$conn);


    //scrivo il nome della affitti


    if ($id_aff!=0) {
    $daticat=mysql_query("select affitti from AFFITTI where id_aff=$id_aff");
    while ($rscat=mysql_fetch_array($daticat, MYSQL_BOTH)) {
    echo "<b>".$rscat["affitti"]."</b><br><br>";
    }
    $target="aff_chg.php";
    $dati=mysql_query("select affitti, img, descrizione, zona,rif, img_small from AFFITTI where id_aff=$id_aff");


    //Controllo che siano caricati i dati


    if (mysql_num_rows($dati)>0) {
    while ($rs=mysql_fetch_array($dati, MYSQL_BOTH)) {


    //leggo i dati e li memorizzo


    $affitti=$rs["affitti"];
    $descrizione=$rs["descrizione"];
    $zona=$rs["zona"];
    $img=$rs["img"];
    $img_small=$rs["img_small"];
    $rif=$rs["rif"];
    }
    }


    else echo "Errore - Non esiste questa news<br><br>";


    }


    else {


    $target="aff_add.php";
    echo "<b>Inserimento di una nuova Vendita</b>";
    }
    echo "<form action='$target' method='post' enctype='multipart/form-data'>";
    ?>


    <table width="100%" cellspacing="1" cellpadding="3" >
    <tr>
    <td width="13%" valign="top">&nbsp;</td>
    <td width="7%" valign="top"><strong>Titolo:</strong></td>
    <td width="80%">
    <?php
    echo "<input type='text' name='affitti' value='$affitti'>";
    ?>
    </td>
    </tr>
    <tr>
    <td valign="top">&nbsp;</td>
    <td valign="top"><strong>File:</strong></td>
    <td>
    <?php
    if ($img_small!="")
    echo "<img src='../admin/images/$img_small'>";
    ?>
    <br> <input type="file" name="img_small"> <br> <input name="el_img_small" type="checkbox" value="1">
    Sostituisci l'immagine<br> </td>
    </tr>
    <tr>
    <td valign="top">&nbsp;</td>
    <td valign="top">Corpo:</td>
    <td><textarea name="descrizione" id="descrizione" cols="45" rows="5">
    </textarea></td>
    </tr>
    <tr>
    <td colspan="3" align="left" valign="top"> <div align="center"><br>
    <input type="submit" name="Submit" value=" Invia "></form>
    </div></td>
    </tr>
    <tr>
    <td colspan="3" valign="top"> <p>&nbsp;</p></td>
    </tr>
    </table>


    <?php
    echo "</form>";
    ?>


    </body>
    </html>


    Il problema è che quando clicco su "Modifica questa news" o "Elimina questa news" non mi restituisce i valori nella form di aff_modifica.php
    poi se inserisco i dati in tutti i campi mi esegue correttamente la query

  2. #12
    Utente di HTML.it
    Registrato dal
    Mar 2011
    Messaggi
    53
    Affitti.php che adesso uso per gestire delle News (ho cambiato solo le descrizioni dei campi)



    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>News - Sezione di aggiornamento</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>


    <body bgcolor="#999999" text="#FFFFFF">
    <p><img src="../images/object1264150268.png" align="absmiddle"> <font size="+3"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amministrazione
    del Sito </strong></font>


    <table width="100%" border="0">
    </p>
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    <tr>


    <td width="20%" valign="top">
    <p><a href="affittipr.php">Corsi</a></p>
    <p><a href="affitti.php">News</a></p>
    <p><br>
    </p></td>
    <td width="80%" valign="top"><font size="+1"><em><strong>Elenco
    delle news</strong></em></font><br>
    <br>


    <?php


    global $id_aff;
    global $affitti;
    global $img;
    global $img_small;
    global $descrizione;
    global $zona;
    global $cod_aff;
    global $rif;




    //Connessione
    include 'conn.php';
    //Leggo i dati dal DB
    $dati=mysql_query("select id_aff, affitti, descrizione, zona, img_small from AFFITTI order by affitti");
    //Controllo che siano caricati i dati
    if (mysql_num_rows($dati)>0) {
    while ($rs=mysql_fetch_array($dati, MYSQL_BOTH)) {
    echo "<img src='../admin/images/".$rs["img_small"]."' border='0' align='absmiddle'> -
    ".$rs["affitti"]."<br><a href=classi.php?id_aff=".$rs["id_aff"].">
    </a> <br>
    <a href='aff_modifica.php?id_aff=".$rs["id_aff"]."'>Modifica questa news</A><br><br>
    <a href='aff_elimina.php?id_aff=".$rs["id_aff"]."'>Elimina questa news</a><br><br>"
    ;
    }
    }
    echo "<br><br><a href='aff_modifica.php?id_aff=0'>Inserisci una news</A><br>"
    ?>


    </body>
    </html>

  3. #13
    Utente di HTML.it
    Registrato dal
    Mar 2011
    Messaggi
    53
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>News - Sezione di aggiornamento</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>


    <body bgcolor="#999999" text="#FFFFFF">
    <p><img src="../images/object1264150268.png" align="absmiddle"> <font size="+3"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amministrazione
    del Sito </strong></font>


    <table width="100%" border="0">
    </p>
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    <tr>


    <td width="20%" valign="top">
    <p><a href="affittipr.php">Corsi</a></p>
    <p><a href="affitti.php">News</a></p>
    <p><br>
    </p></td>
    <td width="80%" valign="top"><font size="+1"><em><strong>Elenco
    delle news</strong></em></font><br>
    <br>


    <?php


    global $id_aff;
    global $affitti;
    global $img;
    global $img_small;
    global $descrizione;
    global $zona;
    global $cod_aff;
    global $rif;




    //Connessione
    include 'conn.php';
    //Leggo i dati dal DB
    $dati=mysql_query("select id_aff, affitti, descrizione, zona, img_small from AFFITTI order by affitti");
    //Controllo che siano caricati i dati
    if (mysql_num_rows($dati)>0) {
    while ($rs=mysql_fetch_array($dati, MYSQL_BOTH)) {
    echo "<img src='../admin/images/".$rs["img_small"]."' border='0' align='absmiddle'> -
    ".$rs["affitti"]."<br><a href=classi.php?id_aff=".$rs["id_aff"].">
    </a> <br>
    <a href='aff_modifica.php?id_aff=".$rs["id_aff"]."'>Modifica questa news</A><br><br>
    <a href='aff_elimina.php?id_aff=".$rs["id_aff"]."'>Elimina questa news</a><br><br>"
    ;
    }
    }
    echo "<br><br><a href='aff_modifica.php?id_aff=0'>Inserisci una news</A><br>"
    ?>


    </body>
    </html>

  4. #14
    Utente di HTML.it
    Registrato dal
    Mar 2011
    Messaggi
    53
    affitti.php (che adesso utilizzo per gestire delle news ho cambiato solo le descrizioni dei campi)


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>News - Sezione di aggiornamento</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>


    <body bgcolor="#999999" text="#FFFFFF">
    <p><img src="../images/object1264150268.png" align="absmiddle"> <font size="+3"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amministrazione
    del Sito </strong></font>


    <table width="100%" border="0">
    </p>
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    <tr>
    <td width="20%" valign="top">
    <p><a href="affittipr.php">Corsi</a></p>
    <p><a href="affitti.php">News</a></p>
    <p><br>
    </p></td>
    <td width="80%" valign="top"><font size="+1"><em><strong>Elenco
    delle news</strong></em></font><br>
    <br>


    <?php


    global $id_aff;
    global $affitti;
    global $img;
    global $img_small;
    global $descrizione;
    global $zona;
    global $cod_aff;
    global $rif;


    //Connessione
    include 'conn.php';
    //Leggo i dati dal DB
    $dati=mysql_query("select id_aff, affitti, descrizione, zona, img_small from AFFITTI order by affitti");
    //Controllo che siano caricati i dati
    if (mysql_num_rows($dati)>0) {
    while ($rs=mysql_fetch_array($dati, MYSQL_BOTH)) {
    echo "<img src='../admin/images/".$rs["img_small"]."' border='0' align='absmiddle'> -
    ".$rs["affitti"]."<br><a href=classi.php?id_aff=".$rs["id_aff"].">
    </a> <br>
    <a href='aff_modifica.php?id_aff=".$rs["id_aff"]."'>Modifica questa news</A><br><br>
    <a href='aff_elimina.php?id_aff=".$rs["id_aff"]."'>Elimina questa news</a><br><br>"
    ;
    }
    }
    echo "<br><br><a href='aff_modifica.php?id_aff=0'>Inserisci una news</A><br>"
    ?>


    </body>
    </html>

  5. #15
    Utente di HTML.it
    Registrato dal
    Mar 2011
    Messaggi
    53
    chiedo scusa se l'ho ripetuto più volte ma credevo non l'avesse caricato.

  6. #16
    Utente di HTML.it L'avatar di lukezz
    Registrato dal
    Feb 2010
    Messaggi
    494
    Devi inserire il codice tra i tag
    Codice PHP:
    qui va il codice 

  7. #17
    Utente di HTML.it
    Registrato dal
    Mar 2011
    Messaggi
    53
    codice HTML:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>News - Sezione di aggiornamento</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    
    <body bgcolor="#999999" text="#FFFFFF">
    <p><img src="../images/object1264150268.png" align="absmiddle"> <font size="+3"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amministrazione 
    del Sito </strong></font> 
    
    
    <table width="100%" border="0">
    </p>
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    <tr>
    
    
    <td width="20%" valign="top"> 
    <p><a href="affittipr.php">Corsi</a></p>
    <p><a href="affitti.php">News</a></p>
    <p><br>
    </p></td>
    <td width="80%" valign="top"><font size="+1"><em><strong>Elenco 
    delle news</strong></em></font><br>
    <br>
    
    
    <?php
    
    
    global $id_aff;
    global $affitti;
    global $img;
    global $img_small;
    global $descrizione;
    global $zona;
    global $cod_aff;
    global $rif;
    
    
    
    
    //Connessione
    include 'conn.php';
    //Leggo i dati dal DB
    $dati=mysql_query("select id_aff, affitti, descrizione, zona, img_small from AFFITTI order by affitti");
    //Controllo che siano caricati i dati
    if (mysql_num_rows($dati)>0) {
    while ($rs=mysql_fetch_array($dati, MYSQL_BOTH)) {
    echo "<img src='../admin/images/".$rs["img_small"]."' border='0' align='absmiddle'> - 
    ".$rs["affitti"]."<br><a href=classi.php?id_aff=".$rs["id_aff"].">
    </a> <br> 
    <a href='aff_modifica.php?id_aff=".$rs["id_aff"]."'>Maodifica questa news</A><br><br>
    <a href='aff_elimina.php?id_aff=".$rs["id_aff"]."'>Elimina questa news</a><br><br>"
    ;
    }
    }
    echo "<br><br><a href='aff_modifica.php?id_aff=0'>Inserisci una news</A><br>"
    ?>
    
    
    </body>
    </html>
    
    
    
    Aff_modifica.php
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Amministrazione</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    
    <body bgcolor="#999999" text="#FFFFFF">
    <img src="../images/object1264150268.png" align="absmiddle"> <font size="+3"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amministrazione 
    del Sito </strong></font> 
    <table width="100%" border="0">
    <tr>
    <td width="20%" valign="top">
    <p><a href="affittipr.php">Corsi</a></p>
    <p><a href="affitti.php">News</a></p>
    </td>
    
    
    <?php
    //Connessione
    
    
    include 'conn.php';
    $conn=mysql_connect($host,$user,$pwd);
    mysql_select_db($db,$conn);
    
    
    //scrivo il nome della affitti
    
    
    if ($id_aff!=0) {
    $daticat=mysql_query("select affitti from AFFITTI where id_aff=$id_aff");
    while ($rscat=mysql_fetch_array($daticat, MYSQL_BOTH)) {
    echo "<b>".$rscat["affitti"]."</b><br><br>";
    }
    $target="aff_chg.php";
    $dati=mysql_query("select affitti, img, descrizione, zona,rif, img_small from AFFITTI where id_aff=$id_aff");
    
    
    //Controllo che siano caricati i dati
    
    
    if (mysql_num_rows($dati)>0) {
    while ($rs=mysql_fetch_array($dati, MYSQL_BOTH)) {
    
    
    //leggo i dati e li memorizzo
    
    
    $affitti=$rs["affitti"];
    $descrizione=$rs["descrizione"];
    $zona=$rs["zona"];
    $img=$rs["img"];
    $img_small=$rs["img_small"];
    $rif=$rs["rif"];
    }
    }
    
    
    else echo "Errore - Non esiste questa news<br><br>";
    
    
    }
    
    
    else {
    
    
    $target="aff_add.php";
    echo "<b>Inserimento di una nuova Vendita</b>";
    }
    echo "<form action='$target' method='post' enctype='multipart/form-data'>";
    ?>
    
    
    <table width="100%" cellspacing="1" cellpadding="3" >
    <tr>
    <td width="13%" valign="top">&nbsp;</td> 
    <td width="7%" valign="top"><strong>Titolo:</strong></td>
    <td width="80%"> 
    <?php
    echo "<input type='text' name='affitti' value='$affitti'>";
    ?>
    </td>
    </tr>
    <tr>
    <td valign="top">&nbsp;</td> 
    <td valign="top"><strong>File:</strong></td>
    <td> 
    <?php
    if ($img_small!="")
    echo "<img src='../admin/images/$img_small'>";
    ?>
    <br> <input type="file" name="img_small"> <br> <input name="el_img_small" type="checkbox" value="1">
    Sostituisci l'immagine<br> </td>
    </tr>
    <tr>
    <td valign="top">&nbsp;</td>
    <td valign="top">Corpo:</td>
    <td><textarea name="descrizione" id="descrizione" cols="45" rows="5">
    </textarea></td>
    </tr>
    <tr>
    <td colspan="3" align="left" valign="top"> <div align="center"><br> 
    <input type="submit" name="Submit" value=" Invia "></form>
    </div></td>
    </tr>
    <tr> 
    <td colspan="3" valign="top"> <p>&nbsp;</p></td>
    </tr>
    </table>
    
    
    <?php
    echo "</form>";
    ?>
    
    
    </body>
    </html>

  8. #18
    Utente di HTML.it
    Registrato dal
    Mar 2011
    Messaggi
    53

  9. #19
    Utente di HTML.it
    Registrato dal
    Jun 2008
    Messaggi
    1,317
    Sostituisci con:

    Codice PHP:
    error_reporting(E_ALL);
    //Connessione
    include 'conn.php';
    //Leggo i dati dal DB
    $dati=mysql_query("select id_aff, affitti, descrizione, zona, img_small from AFFITTI order by affitti") or die(mysql_error()); 
    e vedi che restituisce
    Logiqo.org gestionale per perizie infortunistiche.

  10. #20
    Utente di HTML.it
    Registrato dal
    Mar 2011
    Messaggi
    53
    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\admin\conn.php on line 9

    Ho capito che devo passare mysqli ma non si può ovviare a questa cosa provvisoriamente in modo che io abbia possibilità di studiare il codice e le differenze con calma e intanto il sito funziona.
    Grazie
    Ultima modifica di cero76; 20-06-2015 a 17:32

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.