Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Assign variables as URL parameters?

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,136
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Assign variables as URL parameters?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Assign variables as URL parameters? - 6/7/2001 10:27:01 AM   
  eak_guy

 

Posts: 15
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
I have a search.asp with textfields that you fill in and submit it through a form.
then the results.asp ask for the criteria with "Request.Form (fieldsname)"and
displays the results.
I also have edit_results.asp which according the id of the record alloud you to
change the values of the fields.Then the new data submitted and I WANT TO
"response.Redirect(results.asp)" through a form with parameters the criteria that
user made the query before.The changes applied but the redirection didn't work
because the variables in results wait for request.form and not any
URLparameter.Could someone tell me how to be able to apply to the same
varaibles,values from url and the same time from the textfields?
 
 
Post #: 1
 
 Re: Assign variables as URL parameters? - 6/7/2001 10:28:31 AM   
  Therarez

 

Posts: 12
Score: 0
Joined: 5/22/2001
From: Mexico
Status: offline
tack them on the end of the url:

mypage.htm?var1=value1&var2=value2

then access var1 in the server script like so:

var1 = Request.QueryString("var1")

(in reply to eak_guy)
 
 
Post #: 2
 
 Re: Assign variables as URL parameters? - 6/7/2001 10:29:35 AM   
  eak_guy

 

Posts: 15
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
this is from result.asp <form name="form1" method="post"
action="jobsearchresults.asp?ln=<% =title1%>,em=<%=
loc1%>,cat=<%=categ1%>,dd1=<%=dapo1%>,dd2=<%=dapa%>,
dd3=<%=dapb%>,dd4=<%=dapc%>,dd5=<%=dapd%>,dd6=<%=dape%>">
this is from results.aspdim ln,em,cat,dd1,dd2,dd3,dd4,dd5,dd6,ddapo,ddews

ddapo=""
ddews=""

ln=Cstr(Request.Form("jobfield"))
em=Cstr(Request.Form("locfield"))
cat=Cstr(Request.Form("categfield"))

dd1=Cstr(Request.Form("d1"))
dd2=Cstr(Request.Form("d2"))
dd3=Cstr(Request.Form("d3"))
dd4=Cstr(Request.Form("d4"))
dd5=Cstr(Request.Form("d5"))
dd6=Cstr(Request.Form("d6"))


set Rset0 = Server.CreateObject("ADODB.Recordset")
Rset0.ActiveConnection = "dsn=xxxx;uid=xx;"

dim whereclause
whereclause=""

if (ln<>"") then
whereclause=whereclause + " jtitle LIKE '%"+Cstr(ln)+"%'"
end if

if(em<>"") then
if whereclause="" then
whereclause=whereclause + " jlocation LIKE '%"+Cstr(em)+"%'"
else
whereclause=whereclause + " AND jlocation LIKE '%"+Cstr(em)+"%'"
end if
end if

if(cat<>"") then
if whereclause="" then
whereclause=whereclause + " jobcategID = '"+Cstr(cat)+"'"
else
whereclause=whereclause + " AND jobcategID= '"+Cstr(cat)+"'"
end if
end if

if ((dd3<>"errordate") AND (dd4<>"errordate") AND (dd6<>"errordate")) then
ddapo=dd5&"/"&dd4&"/"&dd6

if whereclause="" then
whereclause=whereclause + " jendate >= '" & ddapo &"'"
else
whereclause=whereclause + " AND jendate >= '"& ddapo &"'"
end if
end if

if ((dd1<>"errordate") and (dd2<>"errordate") and (dd3<>"errordate")) then
ddews=dd2&"/"&dd1&"/"&dd3
if whereclause="" then
whereclause=whereclause + " jendate <= '" & ddews & "'"
else
whereclause=whereclause + " AND jendate <= '"& ddews & "'"
end if
end if

if whereclause="" then
Rset0.Source = "SELECT * FROM dbo.JOBOPP"
else
Rset0.Source = "SELECT * FROM dbo.JOBOPP WHERE" + whereclause
end if

Rset0.CursorType = 0
Rset0.CursorLocation = 2
Rset0.LockType = 3
Rset0.Open
Rset0_numRows = 0
Response.Write(Rset0.Source)
if ((Rset0.EOF)AND (Rset0.BOF)) then
error="1"
else
error="0"
end if

%>


PLEASE WHERE is the mistake?

(in reply to eak_guy)
 
 
Post #: 3
 
 Re: Assign variables as URL parameters? - 6/7/2001 10:30:51 AM   
  Therarez

 

Posts: 12
Score: 0
Joined: 5/22/2001
From: Mexico
Status: offline
Don't forget to URLEncode the variables values at first

(in reply to eak_guy)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Assign variables as URL parameters? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts