Jump to content
Xtreme .Net Talk

Reading the variables in a http://www.site.com?x=value1&y=value2


Recommended Posts

Posted

I have a small project where my website is supposed to accept specific values from another site to authenticate the users. I have no problems with authenticating, I just need to know how to get the variables passed down to me, and send back a confirmation to the originator. The code behind my website is VB.NET

 

Example:

 

Server 1 sends the user to my site with a link

 

http://www.website.com/enter.aspx?id1=value1&id2=value2

 

I want my server to get the values for id1 and id2, do what it has to do, then send back to server 1 the following

 

http://www.server1.com/received.aspx?id1=newValue&id2=newValue

 

Im not sure how to use the httpRequest or request("fieldName") to acheive this.

 

Any pointers or examples?

 

Thanks

Laredo512

* using VS.NET Pro 2003 *

Posted

Thanks!

 

Now that I know how to get the variables, I have a follow up on the posting back to server 1 side.

 

When this user is authenticated, the goal is to redirect the user within my site (thats not a problem, I use forms authentication for that) and at the same time I want my server to send back the confirmation to server 1 (the originator) that my server processed the request sucessfully via a URL like:

 

http://server1.com/responseok.aspx?id1=variable

 

If I use Response.Redirect, won't that send the user back to server1? Is there another way?

 

Thanks for any input...

Laredo512

* using VS.NET Pro 2003 *

Posted

 

Server 1 sends the user to my site with a link

 

http://www.website.com/enter.aspx?id1=value1&id2=value2

 

I want my server to get the values for id1 and id2, do what it has to do, then send back to server 1 the following

 

http://www.server1.com/received.aspx?id1=newValue&id2=newValue

 

how about this?

 

enter.aspx.cs:

 

// if id1 is a string

id1 = Request.QueryString["id1"];

 

// if id2 is an integer

id2 = int.Parse(Request.QueryString["id2"]);

 

// do what you want

 

// redirect

Server.Redirect ("http://www.server1.com/received.aspx?id1="+id1+"&id2="+id2.ToString());

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...