Welcome!

hello ..

welcome to my blog!

feel free to drop comments ..

it would be appreciated =)

Thursday 4 August 2011

Sample masterpiece: A script

     As a minor web programmer, i enjoy developing websites. It always amaze me to see the output of the scripts i try to run ..
    
  Here's a simple php script and its corresponding output.

  <html>
 <?php
    echo"<table border=1>";
    echo"<th>Number</th><th>Column1</th><th>Column2</th>";
    for($i=1;$i<=10;$i++){
     echo"<tr><td>$i</td><td>data$i</td><td>data$i</td></tr>";
                                                           }echo"</table>";
                                                           ?> </html>
  the output of this one would be:
NumberColumn1Column2
1data1data1
2data2data2
3data3data3
4data4data4
5data5data5
6data6data6
7data7data7
8data8data8
9data9data9
10data10data10

     In this program i use a for loop to minimize my codes. if you want make the output more presentable then you could put some attribute to it, like a color, alignment, and also border ..

No comments:

Post a Comment