1 : #!/bin/wel¢Ò
2 : ¢Ò
3 : /* viewvisit.wel¢Ò
4 : ¢Ò
5 : Á¢¼Ó ±â·Ï¿¡ ´ëÇÑ ¸ñ·Ï º¸±â(¼±¤Çö)¢Ò
6 : ¢Ò
7 : Copyright (c) 2000/01/10 by Wesoft¢Ò
8 : All Rights Reserved.¢Ò
9 : ¢Ò
10 : */¢Ò
11 : ¢Ò
12 : whois_program= "/cgi-bin/whois/whois.wel"; // whois¸¦ ¼³Ä¡Çϼ¼¿ä~~¢Ò
13 : ¢Ò
14 : INPUT_FORM=¢Ò
15 : {[¢Ò
16 : /"<html>¢Ò
17 : <body bgcolor={$Qbcolor} onLoad='document.input.Qpasswd.focus()'>¢Ò
18 : <center>¢Ò
19 : <br>¢Ò
20 : <table border=2 cellspacing=0 width=500 bgcolor=#c0c0c0>¢Ò
21 : <tr><td>¢Ò
22 : <table border=1 cellspacing=1 bgcolor=#d0d0d0 width=100%>¢Ò
23 : <tr><td align=center bgcolor=#000080>¢Ò
24 : <font color=#ffffff><b>¹æ¹® ±â·Ï º¸±â</b></font></td></tr>¢Ò
25 : <tr><td height=150>¢Ò
26 : <table border=0 cellspacing=0 width=100%>¢Ò
27 : <form name='input' method='POST' action='viewvisit.wel'>¢Ò
28 : <tr><td width=50% align=right><b>µ¥ÀÌÅͺ£À̽º¸í: </b></td>¢Ò
29 : <td><input type=text name='Qdb' value='{$Qdb}' width=16></td></tr>¢Ò
30 : <tr><td width=50% align=right><b>Å× ÀÌ ºí ¸í: </b></td>¢Ò
31 : <td><input type=text name='Qtable' value='{$Qtable}' width=16></td></tr>¢Ò
32 : <tr><td width=50% align=right><b>¾Ï È£: </b></td>¢Ò
33 : <td><input type=password name='Qpasswd' value='' width=16></td></tr>¢Ò
34 : <tr><td colspan=2 align=center>¢Ò
35 : <br><input type='submit' value=' ±â ·Ï º¸ ±â '></td></tr>¢Ò
36 : </table></td></tr></form>¢Ò
37 : </table>¢Ò
38 : <table border=1 cellspacing=1 bgcolor=#d0d0d0 width=100%>¢Ò
39 : <tr><td align=center bgcolor=#000080>¢Ò
40 : <font color=#ffffff><b>Query º¯¼ö ¼³¸í</b></font></td></tr>¢Ò
41 : <tr><td>¢Ò
42 : <table border=0 cellspacing=0 width=100%>¢Ò
43 : <tr><td><pre><font size=2>¢Ò
44 : Qhost -----> ¿¬°áÇÒ mSQL ¼¹öÀÇ ÁÖ¼Ò(ÃʱⰪ: {$Qhost})¢Ò
45 : Qdb -------> data base name(ÃʱⰪ: {$Qdb})¢Ò
46 : Qtable ----> table name(ÃʱⰪ: {$Qtable})¢Ò
47 : Qbcolor ---> º»¹®ÀÇ ¹è°æ»ö(ÃʱⰪ: {$Qbcolor})¢Ò
48 : Qtext -----> º»¹®ÀÇ ±ÛÀÚ»ö(ÃʱⰪ: {$Qtext})¢Ò
49 : Qpasswd ---> ¾ÏÈ£</font></pre></td></tr>¢Ò
50 : </table></td></tr>¢Ò
51 : </table></td></tr>¢Ò
52 : </table>¢Ò
53 : </center>¢Ò
54 : </body>¢Ò
55 : </html>¢Ò
56 : "/¢Ò
57 : ]}¢Ò
58 : ¢Ò
59 : OUTPUT_FORM=¢Ò
60 : {[¢Ò
61 : qstr= "select * from " ~ Qtable;¢Ò
62 : socket= msqlConnect(Qhost);¢Ò
63 : if(socket==MSQL_ERR)¢Ò
64 : {¢Ò
65 : print("mSQL ¼¹ö '", Qhost, "'¸¦ ¿¬°áÇÒ ¼ö ¾ø½À´Ï´Ù!!!\n");¢Ò
66 : return(-1);¢Ò
67 : }¢Ò
68 : if(msqlSelectDB(socket, Qdb)==MSQL_ERR)¢Ò
69 : {¢Ò
70 : print("µ¥ÀÌÅÍ º£À̽º '", Qdb,"'¸¦ °³¹æÇÒ ¼ö ¾ø½À´Ï´Ù!!!\n");¢Ò
71 : return(-1);¢Ò
72 : }¢Ò
73 : if(msqlQuery(socket, qstr)==MSQL_ERR)¢Ò
74 : {¢Ò
75 : print("Query ¿¡·¯: ", qstr, "\n");¢Ò
76 : return(-1);¢Ò
77 : }¢Ò
78 : ¢Ò
79 : result= msqlStoreResult();¢Ò
80 : rows_count= msqlNumRows(result);¢Ò
81 : fields_count= msqlNumFields(result);¢Ò
82 : server= getenv("SERVER_NAME");¢Ò
83 : print("<font color=#f0f000>");¢Ò
84 : print("<b>http://", server, "</b> (", date(3), " ", time(3), ")");¢Ò
85 : print("</font><br>\n");¢Ò
86 : print("<table border=1 cellspacing=0 bgcolor=#ffffff width=90%>\n");¢Ò
87 : ¢Ò
88 : for(i=0; i<rows_count; i++)¢Ò
89 : {¢Ò
90 : row= msqlFetchRow(result);¢Ò
91 : print("<tr align=center>\n<td align=right>", i+1, "</td>\n");¢Ò
92 : for(j=0; j<fields_count; j++)¢Ò
93 : {¢Ò
94 : print("<td");¢Ò
95 : if(j<=1) print(" align=left");¢Ò
96 : print(">");¢Ò
97 : field= row[j];¢Ò
98 : if(j<=1) print("<a href='", whois_program, "?domain=",¢Ò
99 : field, "' target='viewvisit'>");¢Ò
100 : print(field);¢Ò
101 : if(j<=1) print("</a>");¢Ò
102 : print("</td>");¢Ò
103 : }¢Ò
104 : print("\n</tr>\n");¢Ò
105 : }¢Ò
106 : print("</table>\n");¢Ò
107 : ¢Ò
108 : msqlFreeResult(result);¢Ò
109 : msqlClose(socket);¢Ò
110 : return(0);¢Ò
111 : ]}¢Ò
112 : ¢Ò
113 : Qhost= ""; // host nameÀÇ ÃʱⰪ¢Ò
114 : Qdb= "visit"; // data base nameÀÇ ÃʱⰪ¢Ò
115 : Qtable= "visit"; // table nameÀÇ ÃʱⰪ¢Ò
116 : Qbcolor= "#000000"; // º»¹® ¹è°æ»ö ÃʱⰪ¢Ò
117 : Qtext= "#0000f0"; // º»¹® ¹®ÀÚ»ö ÃʱⰪ¢Ò
118 : ¢Ò
119 : varcnt= htmlquery("GET") + htmlquery("POST");¢Ò
120 : print("Content-type: text/html\n\n");¢Ò
121 : if(varcnt==0) parser(INPUT_FORM);¢Ò
122 : else¢Ò
123 : {¢Ò
124 : print("<html>\n<head></head>\n");¢Ò
125 : print("<body bgcolor=", Qbcolor, " text=", Qtext, "><center>");¢Ò
126 : passwd= decode(cgipasswd, "", "@cgipasswd");¢Ò
127 : if(Qpasswd!=passwd)¢Ò
128 : {¢Ò
129 : print("¾ÏÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù!");¢Ò
130 : }¢Ò
131 : else¢Ò
132 : {¢Ò
133 : rt= parser(OUTPUT_FORM);¢Ò
134 : if(rt!=0) print("ºñÁ¤»óÀûÀ¸·Î Á¾·áµÇ¾ú½À´Ï´Ù.!!!");¢Ò
135 : }¢Ò
136 : print("</center></body></html>\n");¢Ò
137 : print("<!-- Runtime: ", runtime()/1000000.0, "sec -->");¢Ò
138 : }¢Ò
139 : ¢Ò
140 : //////////////////////////// ÇÁ·Î±×·¥ Á¾·á /////////////////////////////¢Ò
|