Here is the second example I'm using for understanding the sequence of events. I stole it from another post. I've included the page in an attached file because this stuff is marked up with colors, bold, etc.
This page has A5 code (shown in blue) embedded in the body and my questions relate to the execution of that code.
Since it is A5 code it can't run on the browser and in fact it doesn't appear to be in the source of the page viewed from the browser.
Now, either it's hidden in the page sent to the browser and is sent back to the server at post time or somehow the server knows to execute the code at the time it receives the post.
I suppose it might even be executed at the initial request as well, just before the server sends out the results.
Does the session entry in the servers internal table contain a link to code that should run when a post is received? Are there separate links to code for the head, body and any other section containing a5 code?
Scripts are executed in the browsers but this stuff executes on the server and in this case, only on an A5 server.
I also wonder about using the same name for multiple elements on the page (the buttons have the same name). Won't that actually create an array and will it not confuse the code when it runs? There are some strange results when this page is executed.
Any help would be greatly appreciated.
<html>
<body>
<%A5
dim pTbl as P
pTbl = table.open("customer")
if eval_valid("nav_button") then
select
case nav_button = "First"
pTbl.fetch_first()
case nav_button = "Previous"
pTbl.fetch_goto(val(this_recno))
pTbl.fetch_prev()
case nav_button = "Next"
pTbl.fetch_goto(val(this_recno))
pTbl.fetch_next()
case nav_button = "Last"
pTbl.fetch_last()
end select
else
pTbl.fetch_first()
end if
%>
<table BORDER="1">
<tr><td>Customer ID</td><td><%A5 ? pTbl.customer_id %></td></tr>
<tr><td>First name</td><td><%A5 ? pTbl.firstname %></td></tr>
<tr><td>Last name</td><td><%A5 ? pTbl.lastname %></td></tr>
</table>
<form ACTION="testpage3.a5w">
<input TYPE="submit" NAME="nav_button" VALUE="First">
<input TYPE="submit" NAME="nav_button" VALUE="Previous">
<input TYPE="submit" NAME="nav_button" VALUE="Next">
<input TYPE="submit" NAME="nav_button" VALUE="Last">
<input TYPE="hidden" NAME="this_recno" VALUE="<%A5 ? pTbl.recno() %>">
</form>
<%A5
pTbl.close()
%>
</body>
</html>
This page has A5 code (shown in blue) embedded in the body and my questions relate to the execution of that code.
Since it is A5 code it can't run on the browser and in fact it doesn't appear to be in the source of the page viewed from the browser.
Now, either it's hidden in the page sent to the browser and is sent back to the server at post time or somehow the server knows to execute the code at the time it receives the post.
I suppose it might even be executed at the initial request as well, just before the server sends out the results.
Does the session entry in the servers internal table contain a link to code that should run when a post is received? Are there separate links to code for the head, body and any other section containing a5 code?
Scripts are executed in the browsers but this stuff executes on the server and in this case, only on an A5 server.
I also wonder about using the same name for multiple elements on the page (the buttons have the same name). Won't that actually create an array and will it not confuse the code when it runs? There are some strange results when this page is executed.
Any help would be greatly appreciated.
<html>
<body>
<%A5
dim pTbl as P
pTbl = table.open("customer")
if eval_valid("nav_button") then
select
case nav_button = "First"
pTbl.fetch_first()
case nav_button = "Previous"
pTbl.fetch_goto(val(this_recno))
pTbl.fetch_prev()
case nav_button = "Next"
pTbl.fetch_goto(val(this_recno))
pTbl.fetch_next()
case nav_button = "Last"
pTbl.fetch_last()
end select
else
pTbl.fetch_first()
end if
%>
<table BORDER="1">
<tr><td>Customer ID</td><td><%A5 ? pTbl.customer_id %></td></tr>
<tr><td>First name</td><td><%A5 ? pTbl.firstname %></td></tr>
<tr><td>Last name</td><td><%A5 ? pTbl.lastname %></td></tr>
</table>
<form ACTION="testpage3.a5w">
<input TYPE="submit" NAME="nav_button" VALUE="First">
<input TYPE="submit" NAME="nav_button" VALUE="Previous">
<input TYPE="submit" NAME="nav_button" VALUE="Next">
<input TYPE="submit" NAME="nav_button" VALUE="Last">
<input TYPE="hidden" NAME="this_recno" VALUE="<%A5 ? pTbl.recno() %>">
</form>
<%A5
pTbl.close()
%>
</body>
</html>
Comment