Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 20

Discussione: integrare css con php

  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    2,043

    integrare css con php

    ciao a tutti,
    vorrei integrare un css con php solo che non mi stampa niente, ho fatto così:

    LA PARTE CHE SECONDO ME NON FUNZIONA LA SCRIVO IN ROSSO

    <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

    <?php
    $i=1;


    $sql = "SELECT b_photogallery.*
    FROM b_photogallery
    ORDER BY b_photogallery.id_photogallery DESC";
    $result = mysql_query($sql,$conn) or die ("errore ".mysql_error());

    while($row = mysql_fetch_array($result)){
    ?>
    <?php
    if ($i==1){ echo "<tr align=\"center\" valign=\"top\">";
    }
    ?>
    <td align="center">

    <style type="text/css">
    .<?=$row['foto']?>{
    background-image: url(images_photogallery/<?=$row['foto']?>);
    background-repeat: no-repeat;
    background-position: center;
    width: 200px;
    }
    </style>


    <table width="10" height="10" border="0" cellpadding="5" cellspacing="0">
    <tr>
    <td class="<?=$row['foto']?>"><a href="images_photogallery/<?=$row['foto']?>" rel="lightbox[roadtrip]">
    [img]images/pixel_trasparente.gif[/img]</a></td>
    </tr>
    <tr>
    <td align="center">


    </td>
    </tr>
    </table>



    </td>
    <?
    if ($i==4){
    echo "</tr><tr align=\"center\" valign=\"top\"><td height=\"6\"></td><td></td><td></td></tr>";
    $i=0;
    }
    $i++;
    }?>

    </table>

  2. #2

  3. #3
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    2,043
    modificato ma continua a non stamparmi niente

  4. #4

  5. #5
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    2,043
    Originariamente inviato da rickystra
    lo style dovrebbe stare nell'head.
    no, funziona anche fuori dall'head, infatti se metto un numero statico al posto di quello dinamico l'immagine me la stampa, solo che mi stampa sempre la stessa, è solo quello il problema che ho.

    <style type="text/css">
    .555{
    background-image: url(images_photogallery/<?=$row['foto']?>);
    background-repeat: no-repeat;
    background-position: center;
    width: 200px;
    }
    </style>


    <table width="10" height="10" border="0" cellpadding="5" cellspacing="0">
    <tr>
    <td class="555"><a href="images_photogallery/<?=$row['foto']?>" rel="lightbox[roadtrip]">
    [img]images/pixel_trasparente.gif[/img]</a></td>
    </tr>
    <tr>
    <td align="center">


    </td>
    </tr>
    </table>



    SE INVECE INSERISCO UN NUMERO DINAMICO NON MI STAMPA NIENTE


    <style type="text/css">
    .<?php echo $row['id_photogallery']; ?>{
    background-image: url(images_photogallery/<?=$row['foto']?>);
    background-repeat: no-repeat;
    background-position: center;
    width: 200px;
    }
    </style>


    <table width="10" height="10" border="0" cellpadding="5" cellspacing="0">
    <tr>
    <td class="<?php echo $row['id_photogallery']; ?>"><a href="images_photogallery/<?=$row['foto']?>" rel="lightbox[roadtrip]">
    [img]images/pixel_trasparente.gif[/img]</a></td>
    </tr>
    <tr>
    <td align="center">


    </td>
    </tr>
    </table>

  6. #6
    Il file ha estensione .php?
    Lo richiami tramite webserver con PHP installato e funzionante?

  7. #7
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    2,043
    Originariamente inviato da k.b
    Il file ha estensione .php?
    Lo richiami tramite webserver con PHP installato e funzionante?
    certo è php

  8. #8
    Che cosa restituisce var_dump($row['id_photogallery']); ?

  9. #9
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    2,043
    Originariamente inviato da filippo.toso
    Che cosa restituisce var_dump($row['id_photogallery']); ?
    mi restituisce questo:

    string(2) "12" string(2) "11" string(2) "10"

  10. #10
    Originariamente inviato da prinzart
    modificato ma continua a non stamparmi niente
    Potresti postare un estratto del sorgente della pagina restituita al browser da <tr> a </tr>?

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.