I am having this really annoying problem on a php-site I am programming and hoping to tap into the well of knowledge that is stackoverflow to help overcome it.
The logic of the login verification is like this.
-
You register and a mail is sendt to you. The mail contains an url with your username and an id that will be matched up to an id stored under your user name in a table. (Via $_GET)
-
If the function finds 1 row with matching id and user name it will change verified to “yes” for that user.
This all works fine, until you use names with æ ø or å in them. Like Jørgen. The mail verification function was altered to accomodate for this, turning the url into something like
http://www.myphppage.com/index.php?login=j%F8rgen&id=62185505683314306498
I’ve made the php-function that checks sql print login and it prints correctly as Jørgen on the html-page. In the program mysql workbench, the name also displays correctly in the table.
If i try to select * from database.user_reg WHERE login='{$login}’ however, it doesn’t match and mysql_num_rows returns 0. If i try the same with just the id though, it matches and returns 1 like it should. I think the fault must lie in the query somewhere.
My index-page uses charset=iso-8859-1
and my Database uses Latin-1_general ci
Help is appreciated
-Johann
Use base64_encode() function.
and then …