lamerz Posted October 2, 2005 Report Share Posted October 2, 2005 Sveicināti! Nepieciešams uzglabāt simbolu virkni txt failā (sql utml. nav pieejams) un vēlāk attēlot lappusē. Viss ir ok līdz simbolu virknē parādās ' vai ", kas pārvēršas par \' vai \". kā ar šo problēmu cīnīties? Link to comment Share on other sites More sharing options...
bubu Posted October 2, 2005 Report Share Posted October 2, 2005 Atvērt php.ini atrast rindu magic_quotes_gpc u nuzstādīt off. Link to comment Share on other sites More sharing options...
LorDRameX Posted October 2, 2005 Report Share Posted October 2, 2005 pie ievietoshanas http://lv.php.net/addslashes un pie izvadiishanas ? http://lv.php.net/stripslashes nederees? Link to comment Share on other sites More sharing options...
php_Stopp Posted October 2, 2005 Report Share Posted October 2, 2005 $text = str_replace("\\\"", "\"", $text); $text = str_replace("\\'", "'", $text); Link to comment Share on other sites More sharing options...
bubu Posted October 2, 2005 Report Share Posted October 2, 2005 Un kāda jēga sarežģīt visu? Link to comment Share on other sites More sharing options...
Venom Posted October 3, 2005 Report Share Posted October 3, 2005 if (get_magic_quotes_gpc()) { function sslash(&$item) { if(is_array($item)) array_walk($item,'sslash'); else $item=stripslashes($item); } array_walk($_GET,'sslash'); array_walk($_POST,'sslash'); array_walk($_COOKIE,'sslash'); } Link to comment Share on other sites More sharing options...
Analgiins Posted October 3, 2005 Report Share Posted October 3, 2005 (edited) vispaar pie funkcijas get_magic_quotes_gpc() komentos ir daudz labu skriptu, kas stripo slashus Edit: resp., ko vaidzeetu ielikt koda saakumaa Edited October 3, 2005 by Analgiins Link to comment Share on other sites More sharing options...
php_Stopp Posted October 4, 2005 Report Share Posted October 4, 2005 Un kāda jēga sarežģīt visu? 23709[/snapback] man piem nav sava servera, un es esu paarliecinaats, ka 1/2+ php.lv memberiem taada nav, un taatad php.ini failu editeet nevar Link to comment Share on other sites More sharing options...
Kavacky Posted October 4, 2005 Report Share Posted October 4, 2005 ini_set() ? Link to comment Share on other sites More sharing options...
bubu Posted October 4, 2005 Report Share Posted October 4, 2005 Kavacky: kāda jēga mainīt ini uzstādījumus, ja magic_quotes jau ir saliktas pirms skripta darbības uzsākšanas? php_Stopp: Es to par sarežģīšanu teicu par taviem str_replace! Kāda jēga sarežģīt ja ir jau gatava funkcija - stripslashes()! Link to comment Share on other sites More sharing options...
php_Stopp Posted October 5, 2005 Report Share Posted October 5, 2005 aa ;) ok Link to comment Share on other sites More sharing options...
lamerz Posted October 7, 2005 Author Report Share Posted October 7, 2005 liels paldies!!! Link to comment Share on other sites More sharing options...
Recommended Posts