Search Unity

  1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

A server with the specified hostname could not be found.

Discussion in 'Editor & General Support' started by raviraj_vdy, Jan 26, 2012.

  1. raviraj_vdy

    raviraj_vdy

    Joined:
    May 14, 2009
    Posts:
    309
    Hi guys

    I am trying to register an user to my server post highscore but when I build run it over iPhone or iPod or iPad it giving me this error(Enters the if part)

    were as if I am doing the same thing from the unity3d Editor it works properly !(Enters the else part)

    why could this be happening Iam using the following method

    Code (csharp):
    1.  
    2.         string registerUserURL= "http://abcd.com/abcd/createuser.php?username="+userName+"&password="+passWord+"&email="+emailId;
    3.                
    4.         WWW registerUser_post = new WWW(registerUserURL);
    5.  
    6.         yield return registerUser_post; // Wait until the download is done
    7.        
    8.         if (registerUser_post.error != null)
    9.         {
    10.             Debug.Log("There was an error loging In the user: " + registerUser_post.error);
    11.         }
    12.         else
    13.         {
    14.             Debug.Log(registerUser_post.text);
    15.            
    16.             severResponse = registerUser_post.text;
    17.         }  
    18.  
    The above code is in a function that I call as soon as the user clicks the register button

    Any suggestions pls

    Thanks
    Raviraj C. Vaidya
     
  2. Innoxious

    Innoxious

    Joined:
    Mar 13, 2012
    Posts:
    3
    bumping this thread, I'm having exactly the same problem and no solution until now:-|
     
  3. raviraj_vdy

    raviraj_vdy

    Joined:
    May 14, 2009
    Posts:
    309
    Got it its the problem with the "@" sign that we pass in the email Id so the solution for this is use it some thing like this

    string registerUserURL= "http://abcd.com/abcd/createuser.php?username="+userName+"&password="+passWord+"&email="+WWW.EscapeURL(emailId);

    This converts the string into a URL friendly format.
     
  4. Innoxious

    Innoxious

    Joined:
    Mar 13, 2012
    Posts:
    3
    Wow thanks a lot, that works. I initially put the "EscapeURL" but I thought the string will not be similar as the URL parameters. Many thanks! =D
     
  5. Rob4507

    Rob4507

    Joined:
    Aug 29, 2007
    Posts:
    53
    Thank you raviraj_vdy!

    This one caught me too. It's funny how the simple things cause the most havok.
     
  6. raviraj_vdy

    raviraj_vdy

    Joined:
    May 14, 2009
    Posts:
    309
    Thank you all. good to know that the solutions is helping.