Jump to content
php.lv forumi

kkas nav


ray

Recommended Posts

daļa koda:

$nosaukums = htmlentities($_REQUEST['nosaukums'], ENT_QUOTES);
$nosaukums = wordwrap($nosaukums, 40, " ", 1);

 

Ja formas laukā ievada burtu ar mikstinājumu vai garumzīmi, tad izlec paziņojums:

Data too long for column 'nosaukums' at row 1

 

nesaprotu, kur ir kļūda, jo db lauka tips ir TEXT un collation ir utf8_general_ci.

Link to comment
Share on other sites

set names ir izpildīts un ar konekcijas charset tu domāji <meta http-equiv="Content-Type" content="text/html; charset=utf-8">?

 

ja $nosaukums = $_REQUEST['nosaukums'], tad viss izpildās bez problēmām.

Edited by ray
Link to comment
Share on other sites

ray --> manualis manualis un velreiz manualis ;)

---------

Like htmlspecialchars(), it takes an optional third argument charset which defines character set used in conversion. Support for this argument was added in PHP 4.1.0. Presently, the ISO-8859-1 character set is used as the default .

---------

$nosaukums = htmlentities($_REQUEST['nosaukums'], ENT_QUOTES, UTF-8);

 

un kaapeec neizmanto htmlspecialchars() ? gribi VISUS simbolus parverst par 'Html kodu' ?

Link to comment
Share on other sites

×
×
  • Create New...