Difference between revisions of "Example datanavigation rsp"

From Lianjapedia
Jump to: navigation, search
m
m
Line 12: Line 12:
 
<body>
 
<body>
 
<%
 
<%
// Open the database
+
    // Open the database
open database southwind
+
    open database southwind
? "<br>"
+
    ? "<br>"
 
 
// Use the table
+
    // Use the table
use customers
+
    use customers
 
 
// Display the data in a table
+
    // Display the data in a table
 
%>
 
%>
 
<table>
 
<table>
 
<tr>
 
<tr>
 
<%
 
<%
for i = 1 to fcount()
+
    for i = 1 to fcount()
? "<td>" + field(i) + "</td>"
+
        ? "<td>" + field(i) + "</td>"
next
+
    next
? "</tr>"
+
    ? "</tr>"
scan
+
    scan
? "<tr valign='top'>"
+
        ? "<tr valign='top'>"
for i = 1 to fcount()
+
        for i = 1 to fcount()
? "<td>"
+
            ? "<td>"
? &(field(i))
+
            ? &(field(i))
? "</td>"
+
            ? "</td>"
next
+
        next
? "</tr>"
+
        ? "</tr>"
endscan
+
    endscan
use
+
    use
close databases
+
    close databases
 
%>
 
%>
 
</table>
 
</table>

Revision as of 05:59, 3 September 2013

Name

example.rsp

Description

Example Visual FoxPro Server Page (.rsp).

Code

<%@ Language=VFP %>
<html>
<body>
<%
    // Open the database
    open database southwind
    ? "<br>"
 
    // Use the table
    use customers
 
    // Display the data in a table
%>
<table>
<tr>
<%
    for i = 1 to fcount()
        ? "<td>" + field(i) + "</td>"
    next
    ? "</tr>"
    scan
        ? "<tr valign='top'>"
        for i = 1 to fcount()
            ? "<td>"
            ? &(field(i))
            ? "</td>"	
        next
        ? "</tr>"
    endscan
    use
    close databases
%>
</table>
</body>
</html>