Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Inserire codice php in tabella html

    Ciao ragazzi ho un problema;
    Sto utlizzando uno script per annunci online e nel modificare il template trovo queta difficoltà:
    Ho riportato tutta la mia grafica che avevo sviluppato nela pagina html ed ora voglio inserire il codice php che mi mostra le categorie dentro il tag <td> di una tabella html,ma quando vado a pubblicare e visualizzare la pagina trovo sempre che esce prima la pagina e sotto,al di fuori della tabella,la categorie create dallo script,e non riesco ad includerle nella tabella.Quale puo essere il problema,e la soluzione?

  2. #2
    Utente di HTML.it L'avatar di Il_Drugo
    Registrato dal
    May 2006
    Messaggi
    1,220
    Senza vedere il codice è dura...


  3. #3
    <head>
    <title>Bacheca Web </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>


    <center>
    <table width="880" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td></td>
    </tr>
    </table>
    <table width="780" border="0" cellspacing="0" cellpadding="0" height="120" background="i/barratop.gif">
    <tr>
    <td width="210" align="center">[img]i/headpic.gif[/img]</td>
    <td width="570" align="left">
    <script language="javascript">
    var uri = 'http://impit.tradedoubler.com/imp/js/12487937/1229052?' + new String (Math.random()).substring (2, 11);
    document.write('<sc'+'ript language="JavaScript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
    </script>
    </td>
    </tr>
    </table>
    <table width="780" border="0" cellspacing="1" cellpadding="1" bgcolor="#12913C">
    <tr bgcolor="#FFFFFF">
    <td width="780" valign="top" bgcolor="#FFFFFF"><script type="text/javascript"><!--
    google_ad_client = "pub-4478511713776299";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text";
    google_ad_channel ="";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></td></table></center>
    <table width=780><td><?php
    /*
    This is a template file for the classifieds application.
    If you are not a programmer, it won't be easy for you to modify it.
    If you are a programmer it will be really easy to modify.

    We think there is no need for very deep explanation what and where
    you should change. The names of the functions and variables show
    their role.

    All functions have some input parameters and produce a string called $s
    which will be sent back to the caller function as a return value.

    Feel free to modify the functions and give a better look to your
    application. Don't forget to change the styleheet in the style.css
    if you want to modify your colors.
    */
    $catColors[0][0]="#999900";
    $catColors[0][1]="#cccc66";
    $catColors[1][0]="#ff9900";
    $catColors[1][1]="#ffcc99";
    $catColors[2][0]="#cc6600";
    $catColors[2][1]="#e6b380";
    $catColors[3][0]="#cc9933";
    $catColors[3][1]="#ffcc66";
    $catSp="7";


    function templateShowMenu($menu)
    {
    /*
    Description:
    The menu items will be displayed.
    Input parameter:
    Array. The elements of the array are the menu items.
    */
    global $xi;

    $s="";
    $s.="<center><table border=0 width='780' cellpadding='0' cellspacing='0'>";
    $s.="<tr valign='middle'>";
    $first=TRUE;
    foreach($menu as $id=>$menuPoint) {
    if (!$first) {
    $s.="<td bgcolor='ffffff'>\n";
    $s.="";
    $s.="</td>";
    $s.="<td bgcolor='ffffff' align='center' valign='middle'>";
    $s.="[img]$xi/menusep.gif[/img]";
    $s.="</td>";
    $s.="<td bgcolor='ffffff'>\n";
    $s.="\n";
    $s.="</td>";
    }
    $s.="<td bgcolor='ffffff' class='mainmenu' nowrap>";
    $s.=$menuPoint;
    $s.="</td>\n";
    $first=FALSE;
    }
    $s.="</td></tr>";
    $s.="</table>";
    return $s;
    }
    function templateMain($navBarText,$userMenuStr,$adminMenuSt r,$userStatus,
    $infoText,$gorumcontent)
    {
    /*
    Description:
    This is the main show function.
    Input parameter:
    The names of the parameter show which part of the page contained
    in the strings.
    $gorumcontent is the main part of the page generated by the program.
    */
    global $xi;
    $s="";

    $s.=vertSpacer("0");
    $s.=$userMenuStr;
    if ($adminMenuStr) {
    $s.=vertSpacer("0");

    }
    if ($navBarText) {

    $s.="<center><table width='780' border='0' cellpadding='0' cellspacing='0'>";
    $s.="<tr>";

    $s.="<td class='navBar'>$navBarText";
    $s.="</td></tr></table>";
    }

    if ($navBarText) {
    $s.=vertSpacer();
    }
    else {
    $s.=vertSpacer(0);
    }
    $s.=$gorumcontent;
    $s.=vertSpacer("0");

    return $s;
    }


    function templateShowCat($catArr,$adListStr)
    {
    /*
    Description:
    Displays the categories.
    Input parameter:
    $catArr: Array. The elements of the array are the category objects.
    The format of the objects is described in the
    function templateShowOneCat.
    $adListStr: The string to add new items to the category.
    */
    global $xi,$catColors;
    $s="";
    $colNum=4;
    $s.="<center><table width='780' bgcolor='#12913C' cellpadding='1' cellspacing='1'>";
    $s.="<tr>";
    $i=0;
    foreach($catArr as $item) {
    if (($i % $colNum) == 0) $s.="<tr>";
    $s.="<td bgcolor='ffffff'>[img]$xi/b.gif[/img]</td>";
    $s.="<td bgcolor='ffffff' valign='top'>";
    $s.=templateShowOneCat($item);
    $s.="</td>\n";
    if ((($i+1) % $colNum) == 0) {
    $s.="</tr>\n<tr><td colspan='$colNum'>[img]$xi/b.gif[/img]</td></tr>\n";
    }
    $i++;
    }
    while ((($i+1) % $colNum) == 0) {
    $s.="<td></td></tr>\n";
    $i++;
    }
    $s.="</tr>";
    $s.="</table>\n";
    $s.=vertSpacer();
    $s.=$adListStr;
    return $s;
    }

    function templateShowOneCat($cat)
    {
    /*
    Description:
    Displays one category.
    Input parameter:
    $cat: Object.
    Fields: title, description, pic.
    */
    $s="";
    $s.="<table border='0'>";
    $s.="<tr><td class='categ'>$cat->title</td></tr>\n";
    $s.="<tr><td class='catdesc'>$cat->description</td></tr>\n";
    if ($cat->pic) {
    $s.="<tr><td class='catdesc'>$cat->pic</td></tr>\n";
    }
    $s.="</table>\n";
    return $s;
    }

    ?>
    </td></table>

  4. #4
    scrivi l'output che ti dà

  5. #5
    Visualizza correttamente la directory delle categorie,ma al di fuori della tabella,come se lo script fosse inserito dopo la pagina html e nn neltag <td>

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