Brian, you could in theory, send it back to the original code, and select case the problem. Now, the same page handles all of the control, and you are not bouncing back and forth between pages.
SOmething like:
if request("fix")="yes" then
do something
end if
if request("fix")="maybe" then
do something else
end if
Or better yet:
TheVariable = request("fix")
Select case TheVariable:
Case: Fix
do something
Case: maybe
something else
end case
Then, your query could even drill down to a specific query type. Just saying.
I spent 3 years developing a construction back end for managing projects and materials, and have over 608 ASP pages linked together in this manner.
<%'******copyright 2004
dbsource="\\db\s1.mdb"
response.buffer=true%>
<%dim whnum, fromnum, partnum, Sdesc, strpartnumber
Sdesc=request("desc")
whnum=request("n")
fromnum=request("type")
partnum=request("p")
strpartnumber=request("partnumber")
%>
<%
dim sCWHnum(), sGWHnum(100), sMWHnum(100)
dim sCpart(), sGpart(100), sMpart(100)
dim sCdesc(), sGdesc(100), sMdesc(100)
dim sChand(), sGhand(100), sMhand(100)
dim x,t,u,v,w,y,z
dim AC, AG, AM, AF, AH
dim strcastle
Set CONN = CreateObject("ADODB.CONNECTION")
Set RC = CreateObject("ADODB.recordset")
strcxn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbsource & ";Persist Security Info=False"
conn.Open strcxn
'######get the part
if whnum <> "" then
strcastle = "SELECT tblinventory.[wh#], tblinventory.[part #], tblinventory.Description FROM tblinventory WHERE (((tblinventory.[wh#])=" & whnum & "));"
end if
if partnum <> "" then
strcastle = "SELECT * from tblinventory WHERE [part #] ='" & partnum & "';"
end if
if Sdesc<>"" then
strcastle = "SELECT [wh#], [part #], description from TBLINVENTORY WHERE [description] LIKE '" & Sdesc & "' ORDER BY [part #];"
end if
if strpartnumber<>"" then
strcastle = "SELECT ID, LOT, cname from TBLCURRENTbath WHERE [cname] LIKE '" & strpartnumber & "';"
end if
RC.open strcastle, CONN
if not RC.EOF then
AC=0
RC.MOVEFIRST
DO WHILE NOT RC.EOF
redim preserve sCWHnum(AC+1)
redim preserve sCPart(AC+1)
redim preserve sCdesc(AC+1)
'redim preserve sChand(AC+1)
sCWHnum(AC)=RC(0)
sCPart(AC)=RC(1)
sCdesc(AC)=RC(2)
'sChand(AC)=RC(3)
AC=AC+1
RC.MOVENEXT
LOOP
else
response.write("<h3><font color=red>No Records Match. <a href=javascript:history.back()>Back</a>")
end if
RC.CLOSE
conn.close
set RC=nothing
set CONN=nothing
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Parts Lookup</title>
</head>
<body>
<TABLE style="border:none;">
<TR>
<td valign=top><h3>List</h3><a href="javascript:history.back();" onmouseover="window.status='Go Back 1 page in history'; return true" onmouseout="window.status=''; return true">Back</a></td>
<td>
<%if strpartnumber<>"" then%>
<table border=1 cellspacing=0>
<tr><td align=center nowrap></TD><TD nowrap>Part ID#</TD><td nowrap>LOT</TD><td>Part Number (Common Name)</TD></TR>
<%for t = 0 to AC-1%>
<tr><td align=center> </TD><TD>
<a href="changeorder.asp?part=<%=sCWHnum(t)%>&slot=<%=sCPart(t)%>" target=_blank><%=sCWHnum(t)%></a> </TD><TD><%=sCpart(t)%> </TD><TD><font size=2><%=sCdesc(t)%> </TD></TR>
<TR><TD colspan=4><a href="cp.asp?wh=<%=sCWHnum(t)%>">Pick</a></TD></TR>
<%next%>
</table>
<%else%>
<table border=1 cellspacing=0>
<tr><td align=center nowrap>Cost</TD><TD nowrap>WH #</TD><td nowrap>Part #</TD><td>Description</TD></TR>
<TR><TD colspan=4><h3><%=partnum%></H3></td></tr>
<%for t = 0 to AC-1%>
<tr><td align=center> </TD><TD><a href="edit_inventory.asp?Submit=Submit&whnumber=<%=sCWHnum(t)%>"><%=sCWHnum(t)%></a> </TD><TD><%=sCpart(t)%> </TD><TD><font size=2><%=sCdesc(t)%> </TD></TR>
<TR><TD colspan=4><a href="cp.asp?wh=<%=sCWHnum(t)%>">Pick</a></TD></TR>
<%next%>
</table>
<%end if%>
</td>
</tr>
</table>
<p> </p>
</body>
</html>
- Posts
- 999
- Registration date
- Saturday January 17, 2015
- Status
- Moderator
- Last seen
- August 11, 2019
195 -Am I right in thinking that this isnt php.or html? I only know a little of these two languages so anything else is a little outside my scope and understanding.
I have got a little further, but Im sure this isnt right as it doesnt allow me to select the second link with the session being correct - it passes the first session found regardless of the link chosen. I have used sessions (which are declared in both pages) to do this. It looks like this ...
if (in_array('Problem A', $row, true)) {
$_SESSION['ProblemType'] = 'Problem A';
echo '<a href="mydata2.php">Problem A'." - (".$row["qty"].")</a> <br />";
}
if (in_array('Problem B', $row, true)) {
$_SESSION['ProblemType'] = 'Problem B';
echo '<a href="mydata2.php">Problem B'." - (".$row["qty"].")</a> <br />";
}
if (in_array('Problem C', $row, true)) {
$_SESSION['ProblemType'] = 'Problem C';
echo '<a href="mydata2.php">Problem C'." - (".$row["qty"].")</a> <br />";
}
Am I flogging a dead hoarse with this approach?
- Posts
- 12936
- Registration date
- Monday June 3, 2013
- Status
- Moderator
- Last seen
- September 3, 2019
1342 -