Object 的操作方式:
function sqlparser( sqlstr ){
str = db.query( sqlstr )
for each ( i in str ) {
for each ( j in i ) {
write( j + "-" )
}
}
}
db = new Database("sqlite", "/etc/etc/core.db")
sqlstr = "SELECT * from network_ddns"
sqlparser( sqlstr )
<%
function sqlupdate( sqlstr ){
write( sqlstr )
db = new Database("sqlite", "/etc/etc/core.db")
db.query(sqlstr)
}
if( request.method == "POST" ){
// T1 = params['t1']
// T2 = params['t2']
// write( "t1=" + T1 + "t2=" + T2 );
sql = "UPDATE network_interface set Ipv4_DHCP='" + params['t1'] + "', IPv4_Manual_Address='" + params['t2'] "' "
sqlupdate( sql )
}
%>
<form method="POST" action="">
<table class="inputForm" border=0>
<tr>
<td><b>Name</b></td>
<td><input name="t1" type="text" value="good"></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><input name="t2" type="text" value="bad"></td>
</tr>
</table>
<input type="submit" name="ok" value="Ok">
</form>
</body>
</html>
沒有留言:
張貼留言