urlencode

Using mod_rewrite to convert paths with hash characters into query strings

瘦欲@ 提交于 2020-01-01 01:29:47
问题 I have a PHP project where I need to send a hash character (#) within the path of a URL. (http://www.example.com/parameter#23/parameter#67/index.php) I thought that urlencode would allow that, converting the hash to %23 But now I see that even the urlencoded hash forces the browser to treat everything to the right as the URL fragment (or query). Is there a way to pass a hash through, or do I need to do a character substitution prior to urlencode? Edit to add (Sep 19 2017): It turns out that I

How to know if a URL is decoded/encoded?

梦想与她 提交于 2020-01-01 01:15:17
问题 I am using Javascript method decodeURIComponent to decode an encoded URL. Now I am having an issue, that sometimes the URL is get encoded twice during redirection between servers, sometimes it is encoded only once. I want to check that if the URL is still encoded after calling the method decodeURIComponent . How can I do that? Any pointer would be very helpful to me. Update - 1 If I recursively call a method and check that if the given URL still contains "%", if it contains "%" then decode it

PHP get url with special characters without urlencode:ing them!

浪尽此生 提交于 2019-12-31 02:57:10
问题 I would like file_get_contents to get a url that looks like this: http://wapedia.mobi/sv/Gröt The problem is that it requests (can't post entire link, sorry): ...wapedia.mobi/sv/Gr%C3%B6t which you can see has been urlencoded, that page does not give me any results. How can I do this? 回答1: According to the PHP manual, you must specifically encode a URL if it contains special characters. This means the function itself should do no special encoding. Most likely your URL is being encoded before

In Ruby/Rails, how can I encode/escape special characters in URLs?

旧街凉风 提交于 2019-12-30 01:55:10
问题 How do I encode or 'escape' the URL before I use OpenURI to open(url) ? We're using OpenURI to open a remote url and return the xml: getresult = open(url).read The problem is the URL contains some user-input text that contains spaces and other characters, including "+", "&", "?", etc. potentially, so we need to safely escape the URL. I saw lots of examples when using Net::HTTP, but have not found any for OpenURI. We also need to be able to un-escape a similar string we receive in a session

In Ruby/Rails, how can I encode/escape special characters in URLs?

泄露秘密 提交于 2019-12-30 01:55:02
问题 How do I encode or 'escape' the URL before I use OpenURI to open(url) ? We're using OpenURI to open a remote url and return the xml: getresult = open(url).read The problem is the URL contains some user-input text that contains spaces and other characters, including "+", "&", "?", etc. potentially, so we need to safely escape the URL. I saw lots of examples when using Net::HTTP, but have not found any for OpenURI. We also need to be able to un-escape a similar string we receive in a session

php javascript url encoding

你说的曾经没有我的故事 提交于 2019-12-29 18:36:21
问题 I have a html text. I had encoded it in php using urlencode function. I want to decode that text in the javascript. when i use unescape function in javascript it replaces all the special characters back but sapce is replaced by '+'. how can i do it correctly so that space is replaced as space itself??? 回答1: Try using rawurlencode instead - urlencode does some things differently for "historical" reasons. See http://us.php.net/manual/en/function.urlencode.php for more information. 回答2: PHP

Urlencode in Objective-C

别说谁变了你拦得住时间么 提交于 2019-12-28 06:39:09
问题 i'm trying to make url encode for long string by using this function NSData *PostData = [MyString dataUsingEncoding:NSUTF8StringEncoding]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://xxxxxxx.com/save.php"]]; [request setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"]; [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; [request setHTTPBody:PostData]; [request setHTTPMethod:@"POST"]; but i miss

facebook error 'Error validating verification code'

ぐ巨炮叔叔 提交于 2019-12-28 02:27:24
问题 very strange error. i use gide http://developers.facebook.com/docs/authentication/. so i create request to fb and pass redirect_uri. i use test site on localhost. so if i pass redirect_uri=http://localhost/test_blog/index.php it works fine, but if i pass redirect_uri=http://localhost/test_blog/index.php?r=site/oauth2 it don't want work. i try to use redirect_uri= . urlencode('http://localhost/test_blog/index.php?r=site/oauth2) but not work. i try to explaine. i success get code, but when i

Android HTTP Request for CakePHP URL

﹥>﹥吖頭↗ 提交于 2019-12-25 18:25:37
问题 I have a website which was created with cakephp. I want to pass some values formed in my App to this website. When I enter the exact same URL in the browser it works. The URL is something like: www.something.com/function/add/value So I'm very confused if this is a GET or a POST method? And how I can do that? The thing is that I can NOT change this URL or put some POST or GET PHP script there to get the values. So I basically just have to call the URL with those params. This is my code:

jQuery Ajax Call on URL with Pound (Number) Sign

杀马特。学长 韩版系。学妹 提交于 2019-12-25 03:32:49
问题 I'm trying to do a jQuery Ajax call to a URL that has a # sign in it. For example: https://www.foo.com/myapp/app/#ptc1/tcomp/infoPage?oid=VR:wt.doc.WTDocument:1272991906 However, the URL being called by the Ajax call is being truncated to just "https://www.foo.com/myapp/app/". It appears as this is because jQuery treats the # sign as an anchor designator and strips everything after it off of the URL. So, I tried using both encodeUriComponent and doing a straight up replace to convert the #