query-string

URL Rewrite with Query String

让人想犯罪 __ 提交于 2019-12-13 05:35:56
问题 I am writing a rewrite rule in IIS with type Redirect. I want the new url to have a query string parameter value added newly to it. The old url does not have any query string values. What is the best way to achieve this? Old url: abc.com/2017/Sample-Page New Url: test.abc.com/2017/Sample-Page?redirect=y <rule name="rewrite with query string" stopProcessing="true"> <match url="(.*)2017/Sample-Page(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="abc.com" /> </conditions> <action type=

ASP.NET Web Api 2 - Attribute Based Routing - How do I force a parameter to query string only?

若如初见. 提交于 2019-12-13 04:34:17
问题 I am working on a Web Api 2 project and I am using attribute based routing. Here is a sample route: [Route("{id:int}", Name = "GetEmployeeById")] [HttpGet] public IHttpActionResult GetEmployee(int id) { ... } This works with the following URLs: ://host/employee/12345 ://host/employee?id=12345 What I would prefer is that the first form (the parameter in the URI), would not be allowed, and only the second form (query string) would work. What I've Tried Mostly, I've tried searching the web for a

How to detect the REQUEST_URI ALONG WITH ANCHOR TAG in a php script

▼魔方 西西 提交于 2019-12-13 04:19:42
问题 One of my script is being called as script.php?l=addr#anchor I found, using SESSION [REQUEST_URI] or QUERY_STRING , gives script.php?l=addr Is there a way to get the #anchor too using php? Thanks in advance 回答1: The anchor is not usually available serverside. It is a guide to the browser. If you really want to know what anchor is called, and you have control of the site you can add &anchor=anchor at the end of your url. If you don't have control of the place where your script is called, I don

Pass 2D array in querystring to JSP

喜夏-厌秋 提交于 2019-12-13 04:18:34
问题 I would like to create a 2D array in the query string and pass it to JSP. I could append strings, but I couldn't find the syntax to append two dimensional arrays. Example: http://localhost:8080/queryWithQueryString?twodArray[0][0]=storeid&twodArray[0][1]=101 How can I achieve this? 回答1: You can just use that as-is. The parameter name will arrive literally in exact that form. JSP doesn't have any special treatment for this (unlike for example PHP). So you'd need to parse it yourself . String[]

htaccess rewrite querystring and remove empty value

陌路散爱 提交于 2019-12-13 03:55:21
问题 first, sorry for my bad English. I try to rewrite url generated from Form Get and redirect that. my url is like this: http://www.mysite.com/properties?action=search&agreement=for-rent&category=my-category&type=&zone=my-zone&city=my-city and I have this .htaccess configured: 11. RewriteCond %{QUERY_STRING} ^action=(?:[a-zA-Z\-]*)&(?:.*)=([a-zA-Z\-]*)&(?:.*)=([a-zA-Z\-]*)&(?:.*)=([a-zA-Z\-]*)&(?:.*)=([a-zA-Z\-]*)&(?:.*)=([a-zA-Z\-]*)$ 12. RewriteRule (.*) %{REQUEST_URI}/%1/%2/%3/%4/%5/? [R=301

HTML datalist with fallback causes duplicate query string parameters

ε祈祈猫儿з 提交于 2019-12-13 02:27:08
问题 I'm trying to implement a datalist element with a built-in fallback for older browsers, as demonstrated on the w3 datalist element spec: <form action="http://example.com/" method="GET"> <label> Sex: <input name="sex" list="sexes" /> </label> <datalist id="sexes"> <label> or select from the list: <select name="sex"> <option value="" /> <option>Female</option> <option>Male</option> </select> </label> </datalist> <input type="submit" /> </form> However, the combination of an <input type="text">

FlashVars QueryString

社会主义新天地 提交于 2019-12-12 23:33:22
问题 I'm unclear on the proper format for passing a QueryString Value using FlashVars, this is what I'm trying <param name="FlashVars" value="part=<%= Request.QueryString["part"] %>" /> but this causes a parse/encode error and the swf doesnt load, same if I use single quotes ie <param name="FlashVars" value="part=<%= Request.QueryString['part'] %>" /> Any takers? Cheers 回答1: If you are working with HTML, use the variable itself: <param name="FlashVars" value="part=valueOfPartGoesHere&anotherPart

Encryption to alphanumeric in System.Security.Cryptography

孤街醉人 提交于 2019-12-12 22:40:55
问题 I have a project which requires encryption of customer ids. The encrypted value is used as a query string value for a website which then returns a personalized form for completion. The problem I'm having is that the website we are working with has a security policy which disallows non-alphanumeric characters from a query string. I'm currently trying to get confirmation of exactly which characters are being blocked, but the ideal solution would be to use an encryption algorithm which returns

Request url parameter

梦想的初衷 提交于 2019-12-12 16:32:15
问题 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 and remove www.example.com or is there a more efficient way? 回答1: You need to URL encode your URL parameter, otherwise it will be read as separate querystring

mvc3: html.beginform search returning empty querystring

浪子不回头ぞ 提交于 2019-12-12 14:09:34
问题 In an MVC3 app, i have the following View: @using (Html.BeginForm("Index", "Search", new {query = @Request.QueryString["query"]}, FormMethod.Post)) { <input type="search" name="query" id="query" value="" /> } When i type in the url "/Search?query=test", Request.Querystring in my Index action reads out the search-value perfectly well (i have my routes set to ignore the Action in the url). When i type it in the seachbox, it hits the right action and controller (so the routing seems fine) but