Dooling Posted May 28, 2010 Report Share Posted May 28, 2010 Sveiki! Man no $_GET vajag nolasīt padotās vērtība. Izmantoju f-ju urldecode(), lai nolasītu vērtības, ar latīņu burtiem viss strādā, bet kad ievada kirilicas burtus tad uzrādās �. Izmantoju UTF-8 encodingu lapai. Kur varētu būt problēma un kā lai atrisina, lai kirilicas burtus arī varētu nolasīt saprotamā veidā. Quote Link to comment Share on other sites More sharing options...
codez Posted May 28, 2010 Report Share Posted May 28, 2010 nolasīt vērtību no $_GET var: $a=$_GET['a']; Quote Link to comment Share on other sites More sharing options...
Dooling Posted May 28, 2010 Author Report Share Posted May 28, 2010 nolasīt vērtību no $_GET var: $a=$_GET['a']; Labi izteikšos savādāk, ar piemēru http://www.lapa.com/index.php?var=Молот Man patreiz nolasa šādi $_GET['var'] ����� , bet vajadzētu Молот Quote Link to comment Share on other sites More sharing options...
Леший Posted May 28, 2010 Report Share Posted May 28, 2010 Nu problēma ir ar encodingiem. Quote Link to comment Share on other sites More sharing options...
Dooling Posted May 28, 2010 Author Report Share Posted May 28, 2010 Nu problēma ir ar encodingiem. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> Fails arī saglabāts UTF-8 bez BOM Es nesaprotu, kur varbūt problēma ar encodingu. Quote Link to comment Share on other sites More sharing options...
Valis Posted May 28, 2010 Report Share Posted May 28, 2010 Browserim paziņo: header('Content-Type: text/html; charset=utf-8'); Quote Link to comment Share on other sites More sharing options...
codez Posted May 28, 2010 Report Share Posted May 28, 2010 jāiet pameklēt tā kristāla lode. Quote Link to comment Share on other sites More sharing options...
Dooling Posted May 28, 2010 Author Report Share Posted May 28, 2010 (edited) <?php session_start(); header('Content-Type: text/html; charset=utf-8'); include("include/conf/mysql.php"); include("include/lib.php"); echo $var = urldecode($_GET['var']); ?> Links - http://www.lapa.com/index.php?var=Молот FF - izvada �����, saite rādās http://www.lapa.com/index.php?var=%CC%EE%EB%EE%F2 IE - izvada ���, saite rādās http://www.lapa.com/index.php?var=Молот Chrome - izvada Молот, saite rādās http://www.lapa.com/index.php?var=Молот Opera - izvada ���, saite rādās http://www.lapa.com/index.php?var=%CC%EE%EB%EE%F2 Safari - izvada Молот, saite rādās http://www.lapa.com/index.php?var=Молот Var mainīgo ir iespēja manuāli mainīt ar roku, piemērām, no http://www.lapa.com/index.php?var=Молот uz http://www.lapa.com/index.php?var=Мечь Edited May 28, 2010 by Dooling Quote Link to comment Share on other sites More sharing options...
codez Posted May 28, 2010 Report Share Posted May 28, 2010 nu ko tu tur āksties? kam tev tas urldecode? izvadi vienkārši: echo $_GET['var']; Quote Link to comment Share on other sites More sharing options...
Dooling Posted May 28, 2010 Author Report Share Posted May 28, 2010 nu ko tu tur āksties? kam tev tas urldecode? izvadi vienkārši: echo $_GET['var']; Tas pats. Quote Link to comment Share on other sites More sharing options...
briedis Posted May 28, 2010 Report Share Posted May 28, 2010 Jap, būtu jāpalasa manuālis un jāsaprot, kam tad tas urlencode vispār domāts :) Quote Link to comment Share on other sites More sharing options...
codez Posted May 28, 2010 Report Share Posted May 28, 2010 tu iekopē ar šādu ?var=Молот linku adressbarā un tad testē, izskatās, ka tev tos linkus arī nepareizi ģenerē. Quote Link to comment Share on other sites More sharing options...
Dooling Posted May 31, 2010 Author Report Share Posted May 31, 2010 tu iekopē ar šādu ?var=Молот linku adressbarā un tad testē, izskatās, ka tev tos linkus arī nepareizi ģenerē. Es adressbārā arī kopēju ?var=Молот, bet FF, Opera, linku pārvērš ?var=%CC%EE%EB%EE%F2, bet man vajag atpakaļ dabūt Молот, nevis %CC%EE%EB%EE%F2 Quote Link to comment 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.