skepsis80 Posted April 21, 2011 Share Posted April 21, 2011 Hi everybody, I wrote a web service and I need to pass parameters through url in order to make a record in a mysql db. The problem is that when I insert greek characters in url it translates it to something like this http://xxxxxx.xx/test3.php?name=%CD%E9%EA%EF%F2&pass=234 and I got an error. Does anybody have a suggestion? Please help because I search for this many hours and still nothing. Thanks for your time Quote Link to comment https://forums.phpfreaks.com/topic/234357-greek-characters-in-php-parameters/ Share on other sites More sharing options...
requinix Posted April 21, 2011 Share Posted April 21, 2011 That URL looks correct. What error do you get? Quote Link to comment https://forums.phpfreaks.com/topic/234357-greek-characters-in-php-parameters/#findComment-1204616 Share on other sites More sharing options...
silkfire Posted April 21, 2011 Share Posted April 21, 2011 Is "%CD%E9%EA%EF%F2" what you get in the database? You need to decode the URL-encoded URL. Quote Link to comment https://forums.phpfreaks.com/topic/234357-greek-characters-in-php-parameters/#findComment-1204621 Share on other sites More sharing options...
skepsis80 Posted April 28, 2011 Author Share Posted April 28, 2011 Hi everybody, the error that Iget is Not Acceptable An appropriate representation of the requested resource /test3.php could not be found on this server. Quote Link to comment https://forums.phpfreaks.com/topic/234357-greek-characters-in-php-parameters/#findComment-1207679 Share on other sites More sharing options...
skepsis80 Posted April 28, 2011 Author Share Posted April 28, 2011 For better understanding the code is something like this <?php $user_id = $_GET['name']; $pass = $_GET['pass']; mysql_connect("localhost", "xxxx", "xxxxxxxx") or die(mysql_error()); // Connects to your Database mysql_select_db("database1") or die(mysql_error()); $query = "INSERT INTO test(name,password) VALUES('$user_id', '$pass')"; mysql_query($query); Print "ok"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/234357-greek-characters-in-php-parameters/#findComment-1207684 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.