1. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  2. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  3. All Unity Pro perpetual license customers: your special offer to subscribe is ready! Click here.
    Dismiss Notice
  4. Unity 5.5 is now released.
    Dismiss Notice
  5. Check out all the fixes for 5.5 in patch releases 1 & 2.
    Dismiss Notice
  6. Unity 5.6 beta is now available for download.
    Dismiss Notice
  7. Get prepared for the Tizen Mobile App Incentive Program! Read more about the upcoming program here.
    Dismiss Notice
  8. Enter the Microsoft Developer Challenge for a chance to win prizes. Read more about it here.
    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
    Messages:
    303
    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:
    303
    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:
    303
    Thank you all. good to know that the solutions is helping.