Visualizzazione dei risultati da 1 a 9 su 9

Discussione: php e css

  1. #1

    php e css

    Ragazzi ho creato un foglio di style facendogli prendere direttamente i valori dal db in questo modo


    Codice PHP:
    <?php
    // Imposto come pagina CSS il file;
    header("Content-type: text/css");
    include(
    'config.php');
    $style="SELECT * FROM style_zero"
    $query_sql=@mysql_query($style);
    $style_row = @mysql_fetch_array($query_sql);
    if(!
    $style_row) die("Errore MySQL: ".mysql_error().'"
    Query:
    "'
    .$query_sql);
    echo (
    "body {
        font-family: '" 
    $style_row['body_1'] ."';
        font-size: '" 
    $style_row['body_2'] . "';
        color: '" 
    $style_row['body_3'] . "';
        background-attachment: '" 
    $style_row['body_4'] . "';
        background-color: '" 
    $style_row['body_5'] . "';
        background-image: '" 
    $style_row['body_6'] . "';
        background-repeat: '" 
    $style_row['body_7']. "';
        background-position:  '" 
    $style_row['body_8'] . "';
        letter-spacing: '" 
    $style_row['body_9'] . "';
        text-align: '" 
    $style_row['body_10']. "';
        word-spacing: '" 
    $style_row['body_11']. "';
        margin-top: '" 
    $style_row['body_12']. "';
        margin-right: '" 
    $style_row['body_13']. "';
        margin-bottom: '" 
    $style_row['body_14']. "';
        margin-left: '" 
    $style_row['body_15']. "';
        cursor: '" 
    $style_row['body_16']. "';
    }\n"
    );
    echo (
    ".banner {
        background-color: '" 
    $style_row['banner_1']. "';
        background-repeat: '" 
    $style_row['banner_2']. "';
        height: '" 
    $style_row['banner_3']. "';
        width: '" 
    $style_row['banner_4']. "';
        margin-top: '" 
    $style_row['banner_5']. "';
        margin-right: '" 
    $style_row['banner_6']. "';
        margin-bottom: '" 
    $style_row['banner_7']. "';
        margin-left: '" 
    $style_row['banner_8']. "';
        padding-right: '" 
    $style_row['banner_9']. "';
    }\n"
    );

    echo (
    "input {
        font-family: '" 
    $style_row['input_1']. "';
        font-size: '" 
    $style_row['input_2']. "';
        color: '" 
    $style_row['input_3']. "';
        background-color: '" 
    .  $style_row['input_4']. "';
        text-align: '" 
    $style_row['input_5']. "';
        border: '" 
    $style_row['input_6']. "';
    }\n"
    );

    echo (
    "textarea {
        font-family: '" 
    $style_row['textarea_1']. "';
        font-size: '" 
    $style_row['textarea_2']. "';
        color: '" 
    $style_row['textarea_3']. "';
        background-color: '" 
    $style_row['textarea_4']. "';
        text-align: '" 
    $style_row['textarea_5']. "';
        border: '" 
    $style_row['textarea_6']. "';
    }\n"
    );
    echo (
    "a:link {
        font-family: '" 
    $style_row['link_1']. "';
        font-size: '" 
    $style_row['link_2']. "';
        color: '" 
    $style_row['link_3']. "';
        text-decoration: '" 
    $style_row['link_4']. "';
        text-align: '" 
    $style_row['link_5']. "';
    }\n"
    );
    echo (
    "a:visited {
        font-family:  '" 
    $style_row['visited_1']. "';
        font-size: '" 
    $style_row['visited_2']. "';
        color: '" 
    $style_row['visited_3']. "';
        text-decoration: '" 
    $style_row['visited_4']. "';
        text-align: '" 
    $style_row['visited_5']. "';
    }\n"
    );
    echo (
    "a:hover {
        font-family: '" 
    $style_row['hover_1']. "';
        font-size: '" 
    $style_row['hover_2']. "';
        color: '" 
    $style_row['hover_3']. "';
        text-decoration: '" 
    $style_row['hover_4']. "';
        text-align: '" 
    $style_row['hover_5']. "';
    }\n"
    );
    echo (
    "a:active {
        font-family: '" 
    $style_row['active_1']. "';
        font-size: '" 
    $style_row['active_2']. "';
        color: '" 
    $style_row['active_3']. "';
        text-decoration: '" 
    $style_row['active_4']. "';
        text-align: '" 
    $style_row['active_5']. "';
    }\n"
    );

    echo (
    ".titolo {
        font-family: '" 
    $style_row['titolo_1']. "';
        font-size: '" 
    $style_row['titolo_2']. "';
        font-weight: '" 
    $style_row['titolo_3']. "';
        color: '" 
    $style_row['titolo_4']. "';
        text-align: '" 
    $style_row['titolo_5']. "';
        margin-top: '" 
    $style_row['titolo_6']. "';
        margin-right: '" 
    $style_row['titolo_7']. "';
        margin-bottom: '" 
    $style_row['titolo_8']. "';
        margin-left: '" 
    $style_row['titolo_9']. "';
    }\n"
    );
    echo (
    ".contenuto {
        font-family: '" 
    $style_row['contenuto_1']. "';
        font-size: '" 
    $style_row['contenuto_2']. "';
        line-height: '" 
    $style_row['contenuto_3']. "';
        font-weight: '" 
    $style_row['contenuto_4']. "';
        color: '" 
    $style_row['contenuto_5']. "';
        text-align: '" 
    $style_row['contenuto_6']. "';
        margin-top: '" 
    $style_row['contenuto_7']. "';
        margin-right: '" 
    $style_row['contenuto_8']. "';
        margin-bottom: '" 
    $style_row['contenuto_9']. "';
        margin-left: '" 
    $style_row['contenuto_10']. "';
    }\n"
    );
    echo (
    "img {
        padding-top: '" 
    $style_row['img_1']. "';
        padding-right: '" 
    $style_row['img_2']. "';
        padding-bottom: '" 
    $style_row['img_3']. "';
        padding-left: '" 
    $style_row['img_4']. "';
        border: '" 
    $style_row['img_5']. "';
    }\n"
    );
    echo (
    ".calendario {
        font-family: '" 
    .  $style_row['calendario_1']. "';
        font-size: '" 
    $style_row['calendario_2']. "';
        color: '" 
    $style_row['calendario_3']. "';
        text-align: '" 
    .  $style_row['calendario_4']. "';
        margin-top: '" 
    $style_row['calendario_5']. "';
        margin-right: '" 
    $style_row['calendario_6']. "';
        margin-bottom: '" 
    $style_row['calendario_7']. "';
        margin-left: '" 
    $style_row['calendario_8']. "';
    }\n"
    );
    echo(
    ".rosso {
        font-family: '" 
    $style_row['rosso_1']. "';
        font-size: '" 
    $style_row['rosso_2']. "';
        color: '" 
    $style_row['rosso_3']. "';
    }\n"
    );
    echo (
    ".verde {
        font-family: '" 
    $style_row['verde_1']. "';
        font-size: '" 
    $style_row['verde_2']. "';
        color: '" 
    $style_row['verde_3']. "';
    }\n"
    );
    echo (
    ".news {
        font-family: '" 
    $style_row['news_1']. "';
        font-size: '" 
    $style_row['news_2']. "';
        color: '" 
    $style_row['news_3']. "';
        text-align: '" 
    $style_row['news_4']. "';
        margin-top: '" 
    $style_row['news_5']. "';
        margin-right: '" 
    $style_row['news_6']. "';
        margin-bottom: '" 
    $style_row['news_7']. "';
        margin-left: '" 
    $style_row['news_8']. "';
    }\n"
    );
    echo (
    ".piccolibanner {
        border: '" 
    $style_row['piccolibanner_1']. "';
        padding: '" 
    $style_row['piccolibanner_2']. "';
        height: '" 
    $style_row['piccolibanner_3']. "';
        width: '" 
    $style_row['piccolibanner_4']. "';
    }\n"
    );
    echo (
    "table {
        font-family: '" 
    $style_row['table_1']. "';
        background-color: '" 
    $style_row['table_2']. "';
        background-image: '" 
    $style_row['table_3']. "';
        background-repeat: '" 
    $style_row['table_4']. "';
    }\n"
    );
    echo (
    ".contatore {
        font-family: '" 
    $style_row['contatore_1']. "';
        font-size: '" 
    $style_row['contatore_2']. "';
        color: '" 
    $style_row['contatore_3']. "';
    }\n"
    );
    echo (
    ".copyright {
        font-family: '" 
    $style_row['copyright_1']. "';
        font-size: '" 
    $style_row['copyright_2']. "';
        color: '" 
    $style_row['copyright_3']. "';
    }\n"
    );
    echo (
    ".strutturabanner {
        background-color: '" 
    $style_row['strutturabanner_1']. "';
        background-image: '" 
    $style_row['strutturabanner_2']. "';
        background-repeat: '" 
    $style_row['strutturabanner_3']. "';
    }\n"
    );
    echo (
    ".sottolink{
        background-color: '" 
    $style_row['sottolink_1']. "';
        background-image: '" 
    $style_row['sottolink_2']. "';
        background-repeat: '" 
    $style_row['sottolink_3']. "';
    }\n"
    );






    ?>
    poi imporatto nel pagina php dove sta la grafica

    Codice 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=windows-1252" />
    <
    title>Progetto Zero OpenSorce</title>
    <
    style type="text/css">
    @
    import url("style.php");
    </
    style>
    </
    head>

    <
    body>
    <
    div class="rosso">Prova</div>
    duc
    </body>
    </
    html
    Ma non funziona sapreste dirmi come mai? o.o' grazie sempre in anticipo per le rispsote

  2. #2
    Utente di HTML.it L'avatar di telegio
    Registrato dal
    Sep 2001
    Messaggi
    2,591
    ..forse perchè il file che devi importare DEVE essere un CSS...
    un file CSS non può contenere, secondo me, le impostazioni di mysql, l'header etc..

    secondo me puoi "fregare" in un modo la pagina però credo non sia quello che hai usato te :master:
    non l'ho provato ma a logica mi funziona.. possibile anche che non funzioni..

    Codice 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=windows-1252" />
    <title>Progetto Zero OpenSorce</title>
    <?php include ("file.php"); ?> 
    </head>

    <body>
    <div class="rosso">Prova</div>
    duc
    </body>
    </html>
    e il tuo file.php è

    Codice PHP:
    <style type="text/css">
    <?php
    // Imposto come pagina CSS il file;
    header("Content-type: text/css");
    include(
    'config.php');
    $style="SELECT * FROM style_zero";
    $query_sql=@mysql_query($style);
    $style_row = @mysql_fetch_array($query_sql);
    if(!
    $style_row) die("Errore MySQL: ".mysql_error().'"
    Query:
    "'
    .$query_sql);
    echo (
    "body {
        font-family: '" 
    $style_row['body_1'] ."';
        font-size: '" 
    $style_row['body_2'] . "';
        color: '" 
    $style_row['body_3'] . "';
        background-attachment: '" 
    $style_row['body_4'] . "';
        background-color: '" 
    $style_row['body_5'] . "';
        background-image: '" 
    $style_row['body_6'] . "';
        background-repeat: '" 
    $style_row['body_7']. "';
        background-position:  '" 
    $style_row['body_8'] . "';
        letter-spacing: '" 
    $style_row['body_9'] . "';
        text-align: '" 
    $style_row['body_10']. "';
        word-spacing: '" 
    $style_row['body_11']. "';
        margin-top: '" 
    $style_row['body_12']. "';
        margin-right: '" 
    $style_row['body_13']. "';
        margin-bottom: '" 
    $style_row['body_14']. "';
        margin-left: '" 
    $style_row['body_15']. "';
        cursor: '" 
    $style_row['body_16']. "';
    }\n"
    );
    echo (
    ".banner {
        background-color: '" 
    $style_row['banner_1']. "';
        background-repeat: '" 
    $style_row['banner_2']. "';
        height: '" 
    $style_row['banner_3']. "';
        width: '" 
    $style_row['banner_4']. "';
        margin-top: '" 
    $style_row['banner_5']. "';
        margin-right: '" 
    $style_row['banner_6']. "';
        margin-bottom: '" 
    $style_row['banner_7']. "';
        margin-left: '" 
    $style_row['banner_8']. "';
        padding-right: '" 
    $style_row['banner_9']. "';
    }\n"
    );

    echo (
    "input {
        font-family: '" 
    $style_row['input_1']. "';
        font-size: '" 
    $style_row['input_2']. "';
        color: '" 
    $style_row['input_3']. "';
        background-color: '" 
    .  $style_row['input_4']. "';
        text-align: '" 
    $style_row['input_5']. "';
        border: '" 
    $style_row['input_6']. "';
    }\n"
    );

    echo (
    "textarea {
        font-family: '" 
    $style_row['textarea_1']. "';
        font-size: '" 
    $style_row['textarea_2']. "';
        color: '" 
    $style_row['textarea_3']. "';
        background-color: '" 
    $style_row['textarea_4']. "';
        text-align: '" 
    $style_row['textarea_5']. "';
        border: '" 
    $style_row['textarea_6']. "';
    }\n"
    );
    echo (
    "a:link {
        font-family: '" 
    $style_row['link_1']. "';
        font-size: '" 
    $style_row['link_2']. "';
        color: '" 
    $style_row['link_3']. "';
        text-decoration: '" 
    $style_row['link_4']. "';
        text-align: '" 
    $style_row['link_5']. "';
    }\n"
    );
    echo (
    "a:visited {
        font-family:  '" 
    $style_row['visited_1']. "';
        font-size: '" 
    $style_row['visited_2']. "';
        color: '" 
    $style_row['visited_3']. "';
        text-decoration: '" 
    $style_row['visited_4']. "';
        text-align: '" 
    $style_row['visited_5']. "';
    }\n"
    );
    echo (
    "a:hover {
        font-family: '" 
    $style_row['hover_1']. "';
        font-size: '" 
    $style_row['hover_2']. "';
        color: '" 
    $style_row['hover_3']. "';
        text-decoration: '" 
    $style_row['hover_4']. "';
        text-align: '" 
    $style_row['hover_5']. "';
    }\n"
    );
    echo (
    "a:active {
        font-family: '" 
    $style_row['active_1']. "';
        font-size: '" 
    $style_row['active_2']. "';
        color: '" 
    $style_row['active_3']. "';
        text-decoration: '" 
    $style_row['active_4']. "';
        text-align: '" 
    $style_row['active_5']. "';
    }\n"
    );

    echo (
    ".titolo {
        font-family: '" 
    $style_row['titolo_1']. "';
        font-size: '" 
    $style_row['titolo_2']. "';
        font-weight: '" 
    $style_row['titolo_3']. "';
        color: '" 
    $style_row['titolo_4']. "';
        text-align: '" 
    $style_row['titolo_5']. "';
        margin-top: '" 
    $style_row['titolo_6']. "';
        margin-right: '" 
    $style_row['titolo_7']. "';
        margin-bottom: '" 
    $style_row['titolo_8']. "';
        margin-left: '" 
    $style_row['titolo_9']. "';
    }\n"
    );
    echo (
    ".contenuto {
        font-family: '" 
    $style_row['contenuto_1']. "';
        font-size: '" 
    $style_row['contenuto_2']. "';
        line-height: '" 
    $style_row['contenuto_3']. "';
        font-weight: '" 
    $style_row['contenuto_4']. "';
        color: '" 
    $style_row['contenuto_5']. "';
        text-align: '" 
    $style_row['contenuto_6']. "';
        margin-top: '" 
    $style_row['contenuto_7']. "';
        margin-right: '" 
    $style_row['contenuto_8']. "';
        margin-bottom: '" 
    $style_row['contenuto_9']. "';
        margin-left: '" 
    $style_row['contenuto_10']. "';
    }\n"
    );
    echo (
    "img {
        padding-top: '" 
    $style_row['img_1']. "';
        padding-right: '" 
    $style_row['img_2']. "';
        padding-bottom: '" 
    $style_row['img_3']. "';
        padding-left: '" 
    $style_row['img_4']. "';
        border: '" 
    $style_row['img_5']. "';
    }\n"
    );
    echo (
    ".calendario {
        font-family: '" 
    .  $style_row['calendario_1']. "';
        font-size: '" 
    $style_row['calendario_2']. "';
        color: '" 
    $style_row['calendario_3']. "';
        text-align: '" 
    .  $style_row['calendario_4']. "';
        margin-top: '" 
    $style_row['calendario_5']. "';
        margin-right: '" 
    $style_row['calendario_6']. "';
        margin-bottom: '" 
    $style_row['calendario_7']. "';
        margin-left: '" 
    $style_row['calendario_8']. "';
    }\n"
    );
    echo(
    ".rosso {
        font-family: '" 
    $style_row['rosso_1']. "';
        font-size: '" 
    $style_row['rosso_2']. "';
        color: '" 
    $style_row['rosso_3']. "';
    }\n"
    );
    echo (
    ".verde {
        font-family: '" 
    $style_row['verde_1']. "';
        font-size: '" 
    $style_row['verde_2']. "';
        color: '" 
    $style_row['verde_3']. "';
    }\n"
    );
    echo (
    ".news {
        font-family: '" 
    $style_row['news_1']. "';
        font-size: '" 
    $style_row['news_2']. "';
        color: '" 
    $style_row['news_3']. "';
        text-align: '" 
    $style_row['news_4']. "';
        margin-top: '" 
    $style_row['news_5']. "';
        margin-right: '" 
    $style_row['news_6']. "';
        margin-bottom: '" 
    $style_row['news_7']. "';
        margin-left: '" 
    $style_row['news_8']. "';
    }\n"
    );
    echo (
    ".piccolibanner {
        border: '" 
    $style_row['piccolibanner_1']. "';
        padding: '" 
    $style_row['piccolibanner_2']. "';
        height: '" 
    $style_row['piccolibanner_3']. "';
        width: '" 
    $style_row['piccolibanner_4']. "';
    }\n"
    );
    echo (
    "table {
        font-family: '" 
    $style_row['table_1']. "';
        background-color: '" 
    $style_row['table_2']. "';
        background-image: '" 
    $style_row['table_3']. "';
        background-repeat: '" 
    $style_row['table_4']. "';
    }\n"
    );
    echo (
    ".contatore {
        font-family: '" 
    $style_row['contatore_1']. "';
        font-size: '" 
    $style_row['contatore_2']. "';
        color: '" 
    $style_row['contatore_3']. "';
    }\n"
    );
    echo (
    ".copyright {
        font-family: '" 
    $style_row['copyright_1']. "';
        font-size: '" 
    $style_row['copyright_2']. "';
        color: '" 
    $style_row['copyright_3']. "';
    }\n"
    );
    echo (
    ".strutturabanner {
        background-color: '" 
    $style_row['strutturabanner_1']. "';
        background-image: '" 
    $style_row['strutturabanner_2']. "';
        background-repeat: '" 
    $style_row['strutturabanner_3']. "';
    }\n"
    );
    echo (
    ".sottolink{
        background-color: '" 
    $style_row['sottolink_1']. "';
        background-image: '" 
    $style_row['sottolink_2']. "';
        background-repeat: '" 
    $style_row['sottolink_3']. "';
    }\n"
    );



    ?> 
    </style>
    prova e fammi sapere che in caso lo uso pure io..
    ah... e se funziona ti spiego pure la logica.. :berto:

  3. #3
    Uhm.. a che pro avere il css spezzato in db?
    Per diventare scemi quando lo devi modificare?
    Piuttosto mettilo in un campo text nel db e lo leggi tutto di botto...
    Se lo fai per evitare che venga copiato, è inutile...
    ...::: DESIDERARE E' UMANO :::...
    ...::: POSSEDERE E' DIVINO :::...
    ...::: HAVE A NICE DAY :::...
    (¯`·.¸¸.->ĐĮ ĦΞŁŁ<-.¸¸.·`¯)
    http://www.djhellclub.com

  4. #4
    Utente di HTML.it L'avatar di telegio
    Registrato dal
    Sep 2001
    Messaggi
    2,591
    anche io avevo pensato la stessa cosa.. che poi è quello che fanno i CMS e i forum, mi pare..
    però visto che ha fatto tutto questo lavoro, almeno la soddisfazione che funziona..

  5. #5
    avevo già provato in questo modo

    Codice PHP:
    <title>Progetto Zero OpenSorce</title>
    <?php include ("file.php"); ?>
    Ma mostra tutto il codice della pagina partendo dal html

    allora ho provato in questo modo

    <style type="text/css">
    <?php
    include('style.php');
    ?>
    </style>

    Identico problema, però ho valutato una cosa, con l'import non è che non funziona, funziona solo la prima stringa di codice css, o meglio

    Codice PHP:
    cho ("body {
        font-family: '" 
    $style_row['body_1'] ."';
        font-size: '" 
    $style_row['body_2'] . "';
        color: '" 
    $style_row['body_3'] . "';
        background-attachment: '" 
    $style_row['body_4'] . "';
        background-color: '" 
    $style_row['body_5'] . "';
        background-image: '" 
    $style_row['body_6'] . "';
        background-repeat: '" 
    $style_row['body_7']. "';
        background-position:  '" 
    $style_row['body_8'] . "';
        letter-spacing: '" 
    $style_row['body_9'] . "';
        text-align: '" 
    $style_row['body_10']. "';
        word-spacing: '" 
    $style_row['body_11']. "';
        margin-top: '" 
    $style_row['body_12']. "';
        margin-right: '" 
    $style_row['body_13']. "';
        margin-bottom: '" 
    $style_row['body_14']. "';
        margin-left: '" 
    $style_row['body_15']. "';
        cursor: '" 
    $style_row['body_16']. "';
    }\n"
    ); 
    funziona solo font-family perchè notavo che il carattere diminutiva
    quindi è ; il problema, provo a mettere la virgola

  6. #6
    metti nella pagina html
    codice:
    <head>
    <link rel="stylesheet" type="text/css" href="./paginaphpcherestituisceilcss.php" />
    </head>
    e nel php che stampa l'importante è che ci deve essere in cima
    Codice PHP:
    header("Content-Type: text/css"); 
    poi sputi tutto fuori con echo


    dimmi se ti funzia, se no posta gli errori

    Perchè essere stupidi non è una menomazione ma un diritto di tutti!!!

  7. #7
    Errori non c'è ne sono , ma nemmeno cosi funziona allora mi è venuta un idea.

    Mettere tutto nella stessa pagina


    Codice 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=windows-1252" />
    <title>Progetto Zero OpenSorce</title>
    <?php
    include('config.php');
    $style="SELECT * FROM style_zero"
    $query_sql=@mysql_query($style);
    $style_row = @mysql_fetch_array($query_sql);
    if(!
    $style_row) die("Errore MySQL: ".mysql_error().'"
    Query:
    "'
    .$query_sql);
    ?>
    <style type="text/css">
    body {
        font-family: <?=$style_row['body_1'];?>;
        font-size: <?=$style_row['body_2'];?>;
        color: <?=$style_row['body_3'];?>;
        background-attachment: <?=$style_row['body_4'];?>;
        background-color: <?=$style_row['body_5'];?>;
        background-image: <?=$style_row['body_6'];?>;
        background-repeat: <?=$style_row['body_7'];?>;
        background-position:  <?=$style_row['body_8'];?>;
        letter-spacing: <?=$style_row['body_9'];?>;
        text-align: <?=$style_row['body_10'];?>;
        word-spacing: <?=$style_row['body_11'];?>;
        margin-top: <?=$style_row['body_12'];?>;
        margin-right: <?=$style_row['body_13'];?>;
        margin-bottom: <?=$style_row['body_14'];?>;
        margin-left: <?=$style_row['body_15'];?>;
        cursor: <?=$style_row['body_16'];?>;
    }
    #banner {
        background-color: <?=$style_row['banner_1'];?>;
        background-repeat: <?=$style_row['banner_2'];?>;
        height: <?=$style_row['banner_3'];?>;
        width: <?=$style_row['banner_4'];?>;
        margin-top: <?=$style_row['banner_5'];?>;
        margin-right: <?=$style_row['banner_6'];?>;
        margin-bottom: <?=$style_row['banner_7'];?>;
        margin-left: <?=$style_row['banner_8'];?>;
        padding-right: <?=$style_row['banner_9'];?>;
    }

    input {
        font-family: <?=$style_row['input_1'];?>;
        font-size: <?=$style_row['input_2'];?>;
        color: <?=$style_row['input_3'];?>;
        background-color: <?=$style_row['input_4'];?>;
        text-align: <?=$style_row['input_5'];?>;
        border: <?=$style_row['input_6'];?>;
    }

    textarea {
        font-family: <?=$style_row['textarea_1'];?>;
        font-size: <?=$style_row['textarea_2'];?>;
        color: <?=$style_row['textarea_3'];?>;
        background-color: <?=$style_row['textarea_4'];?>;
        text-align: <?=$style_row['textarea_5'];?>;
        border: <?=$style_row['textarea_6'];?>;
    }rrw
    a:link {
        font-family: <?=$style_row['link_1'];?>;
        font-size: <?=$style_row['link_2'];?>;
        color: <?=$style_row['link_3'];?>;
        text-decoration: <?=$style_row['link_4'];?>;
        text-align: <?=$style_row['link_5'];?>;
    }
    a:visited {
        font-family:  <?=$style_row['visited_1'];?>;
        font-size: <?=$style_row['visited_2'];?>;
        color: <?=$style_row['visited_3'];?>;
        text-decoration: <?=$style_row['visited_4'];?>;
        text-align: <?=$style_row['visited_5'];?>;
    }
    a:hover {
        font-family: <?=$style_row['hover_1'];?>;
        font-size: <?=$style_row['hover_2'];?>;
        color: <?=$style_row['hover_3'];?>;
        text-decoration: <?=$style_row['hover_4'];?>;
        text-align: <?=$style_row['hover_5'];?>;
    }
    a:active {
        font-family: <?=$style_row['active_1'];?>;
        font-size: <?=$style_row['active_2'];?>;
        color: <?=$style_row['active_3'];?>;
        text-decoration: <?=$style_row['active_4'];?>;
        text-align: <?=$style_row['active_5'];?>;
    }

    #titolo {
        font-family: <?=$style_row['titolo_1'];?>;
        font-size: <?=$style_row['titolo_2'];?>;
        font-weight: <?=$style_row['titolo_3'];?>;
        color: <?=$style_row['titolo_4'];?>;
        text-align: <?=$style_row['titolo_5'];?>;
        margin-top: <?=$style_row['titolo_6'];?>;
        margin-right: <?=$style_row['titolo_7'];?>;
        margin-bottom: <?=$style_row['titolo_8'];?>;
        margin-left: <?=$style_row['titolo_9'];?>;
    }
    #contenuto {
        font-family: <?=$style_row['contenuto_1'];?>;
        font-size: <?=$style_row['contenuto_2'];?>;
        line-height: <?=$style_row['contenuto_3'];?>;
        font-weight: <?=$style_row['contenuto_4'];?>;
        color: <?=$style_row['contenuto_5'];?>;
        text-align: <?=$style_row['contenuto_6'];?>;
        margin-top: <?=$style_row['contenuto_7'];?>;
        margin-right: <?=$style_row['contenuto_8'];?>;
        margin-bottom: <?=$style_row['contenuto_9'];?>;
        margin-left: <?=$style_row['contenuto_10'];?>;
    }
    img {
        padding-top: <?=$style_row['img_1'];?>;
        padding-right: <?=$style_row['img_2'];?>;
        padding-bottom: <?=$style_row['img_3'];?>;
        padding-left: <?=$style_row['img_4'];?>;
        border: <?=$style_row['img_5'];?>;
    }
    #calendario {
        font-family:<?=$style_row['calendario_1'];?>;
        font-size:<?=$style_row['calendario_2'];?>;
        color:<?=$style_row['calendario_3'];?>;
        text-align:<?=$style_row['calendario_4'];?>;
        margin-top:<?=$style_row['calendario_5'];?>;
        margin-right:<?=$style_row['calendario_6'];?>;
        margin-bottom:<?=$style_row['calendario_7'];?>;
        margin-left:<?=$style_row['calendario_8'];?>;
    }
    #rosso {
        font-family:<?=$style_row['rosso_1'];?>;
        font-size:<?=$style_row['rosso_2'];?>;
        color:<?=$style_row['rosso_3'];?>;
    }
    .verde {
        font-family:<?=$style_row['verde_1'];?>;
        font-size:<?=$style_row['verde_2'];?>;
        color:<?=$style_row['verde_3'];?>;
    }
    #news {
        font-family:<?=$style_row['news_1'];?>;
        font-size:<?=$style_row['news_2'];?>;
        color:<?=$style_row['news_3'];?>;
        text-align:<?=$style_row['news_4'];?>;
        margin-top:<?=$style_row['news_5'];?>;
        margin-right:<?=$style_row['news_6'];?>;
        margin-bottom:<?=$style_row['news_7'];?>;
        margin-left:<?=$style_row['news_8'];?>;
    }
    #piccolibanner {
        border:<?=$style_row['piccolibanner_1'];?>;
        padding:<?=$style_row['piccolibanner_2'];?>;
        height:<?=$style_row['piccolibanner_3'];?>;
        width:<?=$style_row['piccolibanner_4'];?>;
    }
    table {
        font-family:<?=$style_row['table_1'];?>;
        background-color:<?=$style_row['table_2'];?>;
        background-image:<?=$style_row['table_3'];?>;
        background-repeat:<?=$style_row['table_4'];?>;
    }
    contatore {
        font-family:<?=$style_row['contatore_1'];?>;
        font-size:<?=$style_row['contatore_2'];?>;
        color:<?=$style_row['contatore_3'];?>;
    }
    #copyright {
        font-family:<?=$style_row['copyright_1'];?>;
        font-size:<?=$style_row['copyright_2'];?>;
        color:<?=$style_row['copyright_3'];?>;
    }
    #strutturabanner {
        background-color:<?=$style_row['strutturabanner_1'];?>;
        background-image:<?=$style_row['strutturabanner_2'];?>;
        background-repeat:<?=$style_row['strutturabanner_3'];?>;
    }
    #sottolink{
        background-color:<?=$style_row['sottolink_1'];?>;
        background-image:<?=$style_row['sottolink_2'];?>;
        background-repeat:<?=$style_row['sottolink_3'];?>;
    }




    </style>
    </head>

    <body>
    <div class="verde" id="verde">Prova</div>
    duc

    <input type="text" />
    [url="#"]Prova[/url]
    </body>
    </html>
    Cosi funziona perfettament

    però visto che il mio foglio è diventato troppo lungo, voglio provare a fare un altra cosa

  8. #8
    Utente di HTML.it L'avatar di telegio
    Registrato dal
    Sep 2001
    Messaggi
    2,591
    ..che è moooolto simile a quello che avevo fatto io, solo che io la parte "lunga" l'avevo messa nel file esterno..


  9. #9
    Messo con il file esterno in questo modo:
    La pagina dove dev andare la grafica eccola, ho messo solo include
    Codice 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=windows-1252" />
    <title>Progetto Zero OpenSorce</title>

    <?php
    include('prova2.php');
    ?>
    </head>

    <body>
    <div class="verde" id="verde">Prova</div>
    duc

    <input type="text" />
    [url="#"]Prova[/url]
    </body>
    </html>
    La pagina dove vanno le classi eccola qua

    Codice PHP:
    <?php
    include('config.php');
    $style="SELECT * FROM style_zero"
    $query_sql=@mysql_query($style);
    $style_row = @mysql_fetch_array($query_sql);
    if(!
    $style_row) die("Errore MySQL: ".mysql_error().'"
    Query:
    "'
    .$query_sql);
    ?>
    <style type="text/css">
    body {
        font-family: <?=$style_row['body_1'];?>;
        font-size: <?=$style_row['body_2'];?>;
        color: <?=$style_row['body_3'];?>;
        background-attachment: <?=$style_row['body_4'];?>;
        background-color: <?=$style_row['body_5'];?>;
        background-image: <?=$style_row['body_6'];?>;
        background-repeat: <?=$style_row['body_7'];?>;
        background-position:  <?=$style_row['body_8'];?>;
        letter-spacing: <?=$style_row['body_9'];?>;
        text-align: <?=$style_row['body_10'];?>;
        word-spacing: <?=$style_row['body_11'];?>;
        margin-top: <?=$style_row['body_12'];?>;
        margin-right: <?=$style_row['body_13'];?>;
        margin-bottom: <?=$style_row['body_14'];?>;
        margin-left: <?=$style_row['body_15'];?>;
        cursor: <?=$style_row['body_16'];?>;
    }
    #banner {
        background-color: <?=$style_row['banner_1'];?>;
        background-repeat: <?=$style_row['banner_2'];?>;
        height: <?=$style_row['banner_3'];?>;
        width: <?=$style_row['banner_4'];?>;
        margin-top: <?=$style_row['banner_5'];?>;
        margin-right: <?=$style_row['banner_6'];?>;
        margin-bottom: <?=$style_row['banner_7'];?>;
        margin-left: <?=$style_row['banner_8'];?>;
        padding-right: <?=$style_row['banner_9'];?>;
    }

    input {
        font-family: <?=$style_row['input_1'];?>;
        font-size: <?=$style_row['input_2'];?>;
        color: <?=$style_row['input_3'];?>;
        background-color: <?=$style_row['input_4'];?>;
        text-align: <?=$style_row['input_5'];?>;
        border: <?=$style_row['input_6'];?>;
    }

    textarea {
        font-family: <?=$style_row['textarea_1'];?>;
        font-size: <?=$style_row['textarea_2'];?>;
        color: <?=$style_row['textarea_3'];?>;
        background-color: <?=$style_row['textarea_4'];?>;
        text-align: <?=$style_row['textarea_5'];?>;
        border: <?=$style_row['textarea_6'];?>;
    }
    a:link {
        font-family: <?=$style_row['link_1'];?>;
        font-size: <?=$style_row['link_2'];?>;
        color: <?=$style_row['link_3'];?>;
        text-decoration: <?=$style_row['link_4'];?>;
        text-align: <?=$style_row['link_5'];?>;
    }
    a:visited {
        font-family:  <?=$style_row['visited_1'];?>;
        font-size: <?=$style_row['visited_2'];?>;
        color: <?=$style_row['visited_3'];?>;
        text-decoration: <?=$style_row['visited_4'];?>;
        text-align: <?=$style_row['visited_5'];?>;
    }
    a:hover {
        font-family: <?=$style_row['hover_1'];?>;
        font-size: <?=$style_row['hover_2'];?>;
        color: <?=$style_row['hover_3'];?>;
        text-decoration: <?=$style_row['hover_4'];?>;
        text-align: <?=$style_row['hover_5'];?>;
    }
    a:active {
        font-family: <?=$style_row['active_1'];?>;
        font-size: <?=$style_row['active_2'];?>;
        color: <?=$style_row['active_3'];?>;
        text-decoration: <?=$style_row['active_4'];?>;
        text-align: <?=$style_row['active_5'];?>;
    }

    #titolo {
        font-family: <?=$style_row['titolo_1'];?>;
        font-size: <?=$style_row['titolo_2'];?>;
        font-weight: <?=$style_row['titolo_3'];?>;
        color: <?=$style_row['titolo_4'];?>;
        text-align: <?=$style_row['titolo_5'];?>;
        margin-top: <?=$style_row['titolo_6'];?>;
        margin-right: <?=$style_row['titolo_7'];?>;
        margin-bottom: <?=$style_row['titolo_8'];?>;
        margin-left: <?=$style_row['titolo_9'];?>;
    }
    #contenuto {
        font-family: <?=$style_row['contenuto_1'];?>;
        font-size: <?=$style_row['contenuto_2'];?>;
        line-height: <?=$style_row['contenuto_3'];?>;
        font-weight: <?=$style_row['contenuto_4'];?>;
        color: <?=$style_row['contenuto_5'];?>;
        text-align: <?=$style_row['contenuto_6'];?>;
        margin-top: <?=$style_row['contenuto_7'];?>;
        margin-right: <?=$style_row['contenuto_8'];?>;
        margin-bottom: <?=$style_row['contenuto_9'];?>;
        margin-left: <?=$style_row['contenuto_10'];?>;
    }
    img {
        padding-top: <?=$style_row['img_1'];?>;
        padding-right: <?=$style_row['img_2'];?>;
        padding-bottom: <?=$style_row['img_3'];?>;
        padding-left: <?=$style_row['img_4'];?>;
        border: <?=$style_row['img_5'];?>;
    }
    #calendario {
        font-family:<?=$style_row['calendario_1'];?>;
        font-size:<?=$style_row['calendario_2'];?>;
        color:<?=$style_row['calendario_3'];?>;
        text-align:<?=$style_row['calendario_4'];?>;
        margin-top:<?=$style_row['calendario_5'];?>;
        margin-right:<?=$style_row['calendario_6'];?>;
        margin-bottom:<?=$style_row['calendario_7'];?>;
        margin-left:<?=$style_row['calendario_8'];?>;
    }
    #rosso {
        font-family:<?=$style_row['rosso_1'];?>;
        font-size:<?=$style_row['rosso_2'];?>;
        color:<?=$style_row['rosso_3'];?>;
    }
    .verde {
        font-family:<?=$style_row['verde_1'];?>;
        font-size:<?=$style_row['verde_2'];?>;
        color:<?=$style_row['verde_3'];?>;
    }
    #news {
        font-family:<?=$style_row['news_1'];?>;
        font-size:<?=$style_row['news_2'];?>;
        color:<?=$style_row['news_3'];?>;
        text-align:<?=$style_row['news_4'];?>;
        margin-top:<?=$style_row['news_5'];?>;
        margin-right:<?=$style_row['news_6'];?>;
        margin-bottom:<?=$style_row['news_7'];?>;
        margin-left:<?=$style_row['news_8'];?>;
    }
    #piccolibanner {
        border:<?=$style_row['piccolibanner_1'];?>;
        padding:<?=$style_row['piccolibanner_2'];?>;
        height:<?=$style_row['piccolibanner_3'];?>;
        width:<?=$style_row['piccolibanner_4'];?>;
    }
    table {
        font-family:<?=$style_row['table_1'];?>;
        background-color:<?=$style_row['table_2'];?>;
        background-image:<?=$style_row['table_3'];?>;
        background-repeat:<?=$style_row['table_4'];?>;
    }
    contatore {
        font-family:<?=$style_row['contatore_1'];?>;
        font-size:<?=$style_row['contatore_2'];?>;
        color:<?=$style_row['contatore_3'];?>;
    }
    #copyright {
        font-family:<?=$style_row['copyright_1'];?>;
        font-size:<?=$style_row['copyright_2'];?>;
        color:<?=$style_row['copyright_3'];?>;
    }
    #strutturabanner {
        background-color:<?=$style_row['strutturabanner_1'];?>;
        background-image:<?=$style_row['strutturabanner_2'];?>;
        background-repeat:<?=$style_row['strutturabanner_3'];?>;
    }
    #sottolink{
        background-color:<?=$style_row['sottolink_1'];?>;
        background-image:<?=$style_row['sottolink_2'];?>;
        background-repeat:<?=$style_row['sottolink_3'];?>;
    }




    </style>
    Funziona perfettamente

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 © 2026 vBulletin Solutions, Inc. All rights reserved.