query-string

URL Rewriting/Redirects with Querystring?

We have a situation where I have a bunch of urls with query params that are used to bascially redirect to various sites, kind of like a short URL or index. Ex: www.mysite.com/abc?x=123 which redirects to www.google.com www.mysite.com/abc?x=456 which redirects to www.yahoo.com and so on... The issue is that there isn't an actual pag...

RewriteRule on special querystring

My URLS the page names example: ?Contact- or ?Product- some have a longer querystring example: ?Contact-&go=Admin domain.com/?Contact-&go=Admin I would like a RewriteRule to use domain.com/Contact/Admin thanks ...

Passing parameters to a WPF Page via its Uri

In the context of a navigation-style WPF application (NavigationWindow, not XBAP): Is it possible for a Hyperlink's NavigateUri to contain extra parameters, like path data or a querystring? E.g., is there some way I could set my NavigateUri to /Product.xaml/123 or /Product.xaml?id=123, and have my Product.xaml page be able to see that i...

Passing query parameters to a C# CGI program in Apache on Windows

I'm running a C# program as a CGI script in Apache on Windows, which works just fine. However, I'm now trying to pass it query parameters, e.g. http://localhost/cgi-bin/csharp_program.exe?hello=kitty&goodbye=world I understand that my query parameters will be passed in the QUERY_STRING environment variable, e.g. `hello=kitty&goo...

Request url parameter

Hi, I have a page where I am recieving an url in a parameter like this: www.example.com?url=www.myurl.com?urlparameter1=hey The problem is that when I try to retrieve the parameter "url", I only receive "www.myurl.com" instead of "www.myurl.com?urlparameter1=hey". What is the best way to receive the url, is it to extract the whole url...

Multiple Variables into 1 in a URL

I am looking to have a list of arguments passed across in an a URL. $url['key1']=1; $url['key2']=2; $url['key3']=3; $url['key4']=4; $url['key5']=5; $url['key6']=6; $url['key7']=7; Please Note I am trying to pass this in the URL in 1 GET variable. I know this would be better done by ?key1=1&key2=2&key3=3...etc but for reasons that are ...

ClickOnce: How do I pass a querystring value to my app *through the installer*?

My company currently builds separate MSI's for all of our clients, even though the app is 100% the same across the board (with a single exception, an ID in the app.config). I would like to show them that we can publish in once place with ClickOnce, and simply add a query string parameter for each client's installer. Example: http://mys...

Request Object not decoding UrlEncoded

C#, ASP.NET 3.5 I create a simple URL with an encoded querystring: string url = "http://localhost/test.aspx?a=" + Microsoft.JScript.GlobalObject.escape("áíóú"); which becomes nicely: http://localhost/test.aspx?a=%E1%ED%F3%FA (that is good) When I debug test.aspx I get strange decoding: string badDecode = Request.QueryString[...

Process a Bunch of Different Input Strings (QueryString)

I have a webpage that is a Search page. There are a few pre-defined searches that need to be in place. The method I have taken to handle this, along with normal searches, is to have the QueryString force the search. There is a search querystring, currently about 10 or so different "searches". I then have a ProcessSearch method with...

How can I preserve the QueryString semantics when converting an MFC CHttpServer based web server to ASP.Net?

In a legacy MFC CHttpServer based web server, we have a command parsing map something like this: BEGIN_PARSE_MAP(MyHttpServer, CHttpServer) ON_PARSE_COMMAND(MyPage, MyHttpServer, ITS_I4 ITS_I4 ITS_I4 ITS_I4 ITS_PSTR ITS_PSTR ITS_PSTR ITS_I4) ON_PARSE_COMMAND_PARAMS("intParam1=11 intParam2=12 intParam3=13 intParam4=14 strParam5=s...

Drupal 5: Posting query string variables to a module page - Page not found

I've build a page using a custom module, and given it a nice url such as /sage/notify, and using the hook_menu set it to run my function to handle that page. All was working great until I tried to pass a querystring variable into the page /sage/notify?test=true At this point I was told that the page can't be found. Does anyone know aw...

Compress about 1000 bytes of text for a QueryString

I want to create a mechanism (in C#) where text from a QueryString is displayed on a website. For example, in C# I might literally do; public void Page_Load(blah) { litSomething.text = Reques.QueryString["msg"]; } Assume that the message is written in English (allowing UTF8 would be nice), and is no longer than say 1000 char...

Passing hidden field from one page to another in querystring

I want to pass a query in a hidden filed from 1 page to another by querystring. Can anyone help me out with the logic? ...

Regex to pull out querystring variables and values

I am using Javascript and trying to break out query string variables from their values. I made a regex that works just fine IF there are no other ampersands except for denoting variables, otherwise the data cuts off at the ampersand. example: ajax=10&a=test&b=cats & dogs returns a = "test", b = "cats " I cannot encode the ampersands b...

Action with set of fixed parameters in url and a set of optional parameters either from post or from querystring

In my route collection I have routes.MapRoute( "Recalculate", "{siteLanguage}/Formula.mvc/relcalculate/{identifierString}/{formulaId}/{wratio}/{customRecalcString}", new { controller = "Formula", action = "Recalculate", wratio = "", customRecalcString = "" } ); The action it maps to is public ActionResult Recalculate(string ide...

301 Redirect. Need help. Having a hard time.

I'm trying to use mod_rewrite to redirect URLs and can't get anything to work. Here is what I'm hoping to do: Old URL: http://www.example.com/asp.pl?%5Fpuri=astore.amazon.com%2Fthegi02-20%2Fdetail%2FB0001L0DFA%2Fassid Needs to redirect to: www.example.com Anyone know of any way to do that? ...

Send data through the QueryString with ASP.NET

hi I want to send a string to another page named Reply.aspx using the QueryString. I wrote this code on first page that must send the text to Reply.aspx: protected void FReplybtn_Click(object sender, EventArgs e) { String s = "Reply.aspx?"; s += "Subject=" + FSubjectlbl.Text.ToString(); Response.Redirect(s); } I wrote th...

Send string with QueryString in Repeater Control in ASP.net

I use a Repeater Control for showing the data in my WebSite. I use a HyperLink in the Repeater Control for showing one field of my table in the database. When you click, I want that link go to another page and send a string to that [page] with a QueryString. I don't know how I do that - can you explain how to do it? I am using Linq in...

String operation in PHP

I'm now dealing with uri like /page.html?k1=1&k2=2 $str = preg_replace('/[&\?]' . $k . '=[^&]*/',"",$str); The above aims to delete $k related part in uri,but will also delete ? wrongly. How to do the right thing? ...

How to encrypt query strings in aspx.net?

Title I hope says it all: How do I encrypt query strings in aspx.net? P.S. I realize that this does not offer security. I'm just looking to obfuscate a puzzle. P.P.S Though I marked CKret's answer as the correct one (for the question as worded I believe his is the most correct answer). However, for myself, I'm just going to try ChoasP...