1. Submit bugs to enter our 5.4 Beta Sweepstakes. Read more about it here.
  2. Unity 5.4 public beta is now available for all users. Grab the build and visit the 5.4 beta forum.
  3. Missing a module? More about the new installer in 5.3 here.
  4. 4.7.1 released for Xcode 7.3 support. Thread here.

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
    Messages:
    293
    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
    Messages:
    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
    Messages:
    293
    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
    Messages:
    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
    Messages:
    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
    Messages:
    293
    Thank you all. good to know that the solutions is helping.