Gå til innhold

Tom_

Medlemmer
  • Innlegg

    79
  • Ble med

  • Besøkte siden sist

Innlegg skrevet av Tom_

  1. <?php
    
    echo "<html><body>";
    
           echo "<table width='100' align='center'>";
           for($i=0; $i<=5; $i=$i+1)
           {
                   if($i % 2 == 0)
                   {
                           echo "<tr>";
                           echo "<td style='background-color:red'>";
                           echo $i;
                           echo "</td>";
                           echo "</tr>";
                   }
                   else
                   {
                           echo "<tr>";
                           echo "<td style='background-color:green'>";
                           echo $i;
                           echo "</td>";
                           echo "</tr>";
                   }
           }
           echo "</table>";
    
    echo "</body></html>";
    
    ?>
    

  2. Thomas sitt forslag var bra :thumbup: , her er et annet:

     

    $mnd = array("Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember");
    
    $num = date('n');
    
    echo date('d.').$mnd[$num-1].date('.Y'); // 05.Mars.2012
    

  3. Du må bare escape " :thumbup:

     

    echo "<a href=\"javascript:confirmGo('Are you sure you want to go to google?','http://www.google.com')\">go to google</a>";
    

     

    Alternativt:

     

    $q = "Are you sure you want to go to google?";
    $url = "http://www.google.com";
    
    echo "<a href=\"javascript:confirmGo('$q','$url')\">go to google</a>";
    

×
×
  • Opprett ny...