Search Results

Search found 18568 results on 743 pages for 'url shortener'.

Page 114/743 | < Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >

  • How to redirect by checking for a particular previous url

    - by Bearish_Boring_dude
    I have the following piece of code in my controller def index session[:previous_url] = URI(request.referer).path if session[:previous_uri] != new_path redirect_to registration_path(id: current_user.associate_username) end end However this does not actually work and i get a bad URI error. I just want to check if the request came from a particular page and if not redirect it to another page. I would also like to know if there is a better way for doing this?.Thank you

    Read the article

  • Unable to fetch Json data from remote url

    - by user3772611
    I am cracking my head to solve this thing. I am unable to fetch the JSON data from remote REST API. I need to fetch the JSOn data nd display the "html_url" field from the JSON data on my website. I saw that you need the below charset and content type for fetching JSON. <html> <head> <meta charset="utf-8"> <meta http-equiv="content-type" content="application/json"> </head> <body> <p>My Instruments page</p> <ul></ul> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script type="text/javascript"> $(document).ready(function () { alert("Inside the script"); $.getJSON(" https://pki.zendesk.com/api/v2/help_center/sections/200268985/articles.json", function (obj) { alert("Inside the getJSON"); $.each(obj, function (key, value) { $("ul").append("<li>" + value.html_url + "</li>"); }); }); }); </script> </body> </html> I referred to following example on jsfiddle http://jsfiddle.net/2xTjf/29/ The "http://date.jsontest.com" given in this example also doesn't work in my code. The first alert is pops but not the other one. I am a novice at JSON/ Jquery. i used jsonlint.com to find if it has valid JSON, it came out valid. I tested using chrome REST client too. What am I missing here ? Help me please ! Thanks in anticipation.

    Read the article

  • Get image url from rss Cdata

    - by zOro
    Hi , I start testing android , trying to get image from xml my Image is hosting inside xmlnode <a href="http://www.site.com/id/?id=41564"><img src="http://www.site.com//news/images/2010/03_march/imagestock/thumb/22.jpg" align="left" /></a> more text comes here i trying to get the http://www.site.com//news/images/2010/03_march/imagestock/thumb/22.jpg and displaying it ... Can you help me with that ? Thanks zOro..

    Read the article

  • Retrieving content of a txt file from URL to Android

    - by eightx2
    I would like to be able to retrieve contents of a .txt file from the internet, and load it in an EditText. I tried using the code on this page: Reading Text File From Server on Android It didn't work, as you might have guessed. I've read on numerous sites about this type of problem, but I can't get anything to work. Someone suggested AndroidHttpClient (http://developer.android.com/reference/android/net/http/AndroidHttpClient.html), but I simply can't find any examples with this. As I'm a newbie in Android programming, I would love if someone could please give me a small example.

    Read the article

  • FTP exception 501 "pathname" more than 8 characters

    - by BigMac66
    I am trying to access a file via a URI using the FTP protocol. For obvious security reasons I had to make some changes but this is where the problems seem to be coming from. My URI is as follows: ftp://user:[email protected]/u/Bigpathname/XYZ/ABC/BigPathname/bigpathname/xyz/abc/MY_LOG.LOG And I see this exception: sun.net.ftp.FtpProtocolException: CWD Bigpathname:501 A qualifier in "Bigpathname" is more than 8 characters This is really confusing as I can access the file from a Windows 7 command line with the CD command just fine. Both one directory at a time and as a full path. I found one article mentioning that MVS file names must be 8 or fewer characters but this does not explain how I can get to these same files from my command line! They do exist there is data there that I can download manual but I can not get there via a URI in Java. PS I use .toURL().openStream() to get files on my local machine just fine, it only fails when I try to get them from my server. EDIT October 1st I am able to access files on the MVS host using FileZilla and the basic FTP client from the Windows 7 command line - but I still cannot get them from a URI/URL. I downloaded a very basic Java built FTP client and tried accessing the same file in my program from there and the path works but because my file name has a dot in it "MY_LOG.LOG" I am getting File does not exist 501 Invalid data set name "MY_LOG.LOG". Use MVS Dsname conventions. I am utterly perplexed by this...

    Read the article

  • apache mod_rewrite making permanent url problem

    - by Yc Zhang
    In file .htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^\/*get_post\/(.*)$ get_post.php?slug=$0 [L] </IfModule> If I type http://example.com/get_post/abcde, I get an empty array of $_GET variable. How can I achieve the effect like this: http://example.com/get_post?slug=abcde

    Read the article

  • Force language change from custom account creation script through url

    - by jax
    I have made a custom 'Account Creation' script so that users can login from my phone application. What I want is to be able to change the responses from the server depending on their locale. So when I request a page I would add lang=en or lang=zh etc. This works http://mysite.com/phone/my_custom_account_creation.php?lang=en Response: <resource classification="error" code="Error (Code: 500)"> <message>Please enter your name:</message> </resource> This does not work: http://mysite.com/phone/my_custom_account_creation.php?lang=zh Response: <resource classification="error" code="Error (Code: 500)"> <message>Please enter your name:</message> </resource> If I go into Joomla at set the default language to chinese, it works. <resource classification="error" code="Error (Code: 500)"> <message>????????</message> </resource> but http://mysite.com/phone/my_custom_account_creation.php?lang=en does not work, instead it continues to show the chinese version. What might I be able to do here?

    Read the article

  • curl issue with URL not connecting

    - by bmucklow
    So I'm not a very good network person so I was hoping someone could point me in the right direction to figuring out what I am doing wrong. I am trying to use curl to post a SOAP message. I am running the following: curl -d "string of xml message" -H "Content-Type:text/xml; charset=utf-8" ":/" This results in a 'Connection refused' message. So I try pinging ip by itself...no problems. Then I think maybe I need http://:/ so I tried pinging http:// and I get: unknown host http:// yet if I ping the IP by itself I get no issues. Any thoughts on where to start debugging this issue?

    Read the article

  • How to submit new url's to google ?

    - by stighy
    Hi guys, i've a questions. Hope you can help me : i would like to know what's the best way to submit new urls to google. My website create a dynamic sitemap but i don't know if i have to submit each time to google, or if google get my sitemap daily Thanks in advance

    Read the article

  • Download HTML from website URL in objective C (iphone)

    - by Jonathan
    I'm trying to get the HTML data of a website so that I can parse it. I have parsing bit sorted out but using the following code doesn't seem to work: NSData *data = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString:@"http://thewebsite.net"]]; Is this the way I should be doing it or is there another way?

    Read the article

  • jQuery pass url variable into load function

    - by Adi
    Hi, I'm trying to use load to reload a portion of the current page (long story why) but am having an issue with the variable syntax. Here is the snippet of code: var pathname = window.location.pathname; $('#menu').load("/cms.php #menu"); I woudl like to replace /cms.php with the variable, but am having issues with the corrent syntax. Any help/advice would be much appricated. A.

    Read the article

  • Hide index.php from web site URL

    - by Gusepo
    Hi, I'm using htaccess rewrite engine to make urls look nice, from www.mysite.com/index.php?pag=home to www.mysite.com/pag/home it works fine with this rule RewriteRule ^pag/([^/]+)$ index.php?pag=$1 [L,QSA,NC] but when I go to www.mysite.com it redirects me to www.mysite.com/index.php is there a way to redirect to www.mysite.com/pag/home? I tried redirect 301 /index.php http://www.mysite.com/pag/home but when i try to go to www.mysite.com the browser gives my "page do not exsist error"

    Read the article

  • how to return url in form file in strut

    - by Najmi
    hai all, i have one problem regarding to return the form file value is validation fail. i have one form that have a few field to be fullfil by the user and one attachment field.if one of the field is blank the system will give the error when submit the form..my problem is, all the field will have the value that we entered before this but for form file it disappear.

    Read the article

  • Silverlight Windows Phone 7: Load Images From URL

    - by Lennie De Villiers
    Hi, I got the code below that is trying to load an image from the web into an Image control, when I run it I get an error on the given line that no network access is allowed: private void button1_Click(object sender, RoutedEventArgs e) { WebClient webClientImgDownloader = new WebClient(); webClientImgDownloader.OpenReadCompleted += new OpenReadCompletedEventHandler(webClientImgDownloader_OpenReadCompleted); webClientImgDownloader.OpenReadAsync(new Uri("http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/80000/5000/100/85108/85108.strip.print.gif", UriKind.Absolute)); } void webClientImgDownloader_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { BitmapImage bitmap = new BitmapImage(); bitmap.SetSource(e.Result); // ERROR HERE! image1.Source = bitmap; } Silverlight for Windows Phone 7

    Read the article

  • Using ASP.NET Redirect without string URL?

    - by David Dietrich
    For instance, what I have right now is the following: Page.Response.Redirect("Default.aspx", false); Needing to hardcode the string just seems odd to me. The Default.aspx page is already in my project. So is there a way to do the redirect something like the following: Page.Response.Redirect(Default.aspx, false); Where Default.aspx is just the web form. I'd think that this way it would be obvious if there was a problem such as you deleted the web form but didn't update the redirects. Is this possible? Or is there another way entirely I should be looking at this? I suppose I could do something with a static property on the class, but I am wondering if there is a built in thing for this?

    Read the article

  • Image URL has the contentType "text/html"

    - by user1503025
    I want to implement a method to download Image from website to laptop. public static void DownloadRemoteImageFile(string uri, string fileName) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); if ((response.StatusCode == HttpStatusCode.OK || response.StatusCode == HttpStatusCode.Moved || response.StatusCode == HttpStatusCode.Redirect) && response.ContentType.StartsWith("image", StringComparison.OrdinalIgnoreCase)) { //if the remote file was found, download it using (Stream inputStream = response.GetResponseStream()) using (Stream outputStream = File.OpenWrite(fileName)) { byte[] buffer = new byte[4096]; int bytesRead; do { bytesRead = inputStream.Read(buffer, 0, buffer.Length); outputStream.Write(buffer, 0, bytesRead); } while (bytesRead != 0); } } } But the ContentType of request or response is not "image/jpg" or "image/png". They're always "text/html". I think that's why after I save them to local, they has incorrect content and I cannot view them. Can anyone has a solution here? Thanks

    Read the article

  • Parsing an WebService URL in Flex

    - by theband
    [Bindable]public var xmlData:Object = new Object(); [Bindable]public var headingData:Object = new Object(); private function getHeadings(evt:ResultEvent):void{ //xmlData = ObjectUtil.toString(evt.result); //ObjectUtil.toString(evt.result) xmlData = evt.result; headingData = xmlData.root.survey; } <mx:WebService id="srv" wsdl="http://domainame/Service.asmx?WSDL"> <mx:operation name="GetClientDetails_ParameterDetails" resultFormat="object" result="getHeadings(event);" /> </mx:WebService> I am able to parse an simple XML and create the components, but i am not able to do when i call an webService. The Method name which fetches the XML is the same. Am i doing something wrong in receiving the XML in Flex.

    Read the article

< Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >