CSI: PHP

"Looking at your tweets I cannot even fathom what your job is. CSI:PHP?" — @grmpyprogrammer

doBuildEditTableList

| Comments

My favorite parts are the relative links in to the stylesheet and the image. Write once, use only in a very specific subdirectory. Genius.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

Function doBuildEditTableList($dbn){

    require "../config.inc";
    global $conn;

    $dbquery = "SELECT mytablename FROM updatetables ";
    mssql_select_db($dbn, $conn);
    $result = mssql_query($dbquery);
        print "<html><head>";
        print "<link rel=stylesheet type=text/css href='../$stylesheet' >";
        print "";
        print "</head><body>";
        print "<a href=$web><img align=center height=24 width=75 src=..$img/home.jpg alt='Return to Menu'></a>";
        print"<table class='form' align='center' width=75%>";
        print"<tr><td align='center' class='arow'>Edit Tables</td></tr>";
        print"<tr><td align='center' class='brow'>Select the table that you want to update:</td></tr></table>";
        print"<table class='form' align='center' width=75%>";
        While ($row = mssql_fetch_assoc($result)){
            foreach($row as $Key => $Value){ //foreach($row as $value)
                print "<tr><td align='center' class='form'><a class='blacklink' href=$script?req=list&table=$Value>$Value</a></td></tr>";
            }
        }
    print "</table></html>";
}

Comments