A server with the specified hostname could not be found.

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

  1. raviraj_vdy

    raviraj_vdy

    Member

    Joined:
    May 14, 2009
    Messages:
    275
    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

    New Member

    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

    Member

    Joined:
    May 14, 2009
    Messages:
    275
    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

    New Member

    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

    Member

    Joined:
    Aug 29, 2007
    Messages:
    51
    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

    Member

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