YourPadre Posted August 18, 2009 Report Share Posted August 18, 2009 Sveiki tauta! Vai ir nepieciešama (būtu vēlama) kautkāda apstrāde pirs teksta vai citas informācijas ievadīšanas MYSQL tabulās. Un vai tas pats attiecās us $_GET super mainīgo? Quote Link to comment Share on other sites More sharing options...
tas_pats Posted August 18, 2009 Report Share Posted August 18, 2009 (edited) Pirms ievietošanas datubāzē noteikti apstrādā ar mysql_real_escape_string Pēc tam izvadot no db dabūto tekstu html struktūrā izmantoju htmlspecialchars. Edited August 18, 2009 by tas_pats Quote Link to comment Share on other sites More sharing options...
YourPadre Posted August 19, 2009 Author Report Share Posted August 19, 2009 Pirms ievietošanas datubāzē noteikti apstrādā ar mysql_real_escape_string Pēc tam izvadot no db dabūto tekstu html struktūrā izmantoju htmlspecialchars. Skaidrs, un kas ir ar GET variabļiem? Quote Link to comment Share on other sites More sharing options...
marcis Posted August 19, 2009 Report Share Posted August 19, 2009 (edited) Tas pats arī. mysql_query("INSERT INTO `tabula` (lauks) VALUES ('".mysql_real_escape_string($_GET['var']).")"'); // stringiem mysql_query("INSERT INTO `tabula` (lauks) VALUES (".intval($_GET['var']).")"); // veseliem skaitļiem mysql_query("INSERT INTO `tabula` (lauks) VALUES (".floatval($_GET['var']).")"); // decimāldaļskaitļiem Un nedaudz lasāmvielas. Edited August 19, 2009 by marcis 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.