freak Posted December 19, 2007 Report Posted December 19, 2007 Kā, lai izdara, lai varētu formas elementā text vērtība saturēt gan " ,gan ' šadas pēdiņas. Piemēram: $x=" aa \" aaa ' aa "; print "<input type=text name=a1 value='$x' "; Šajā piemērā value tiks izvadīta nepareizi.
Paulinjsh Posted December 19, 2007 Report Posted December 19, 2007 echo '<input type="text" name="a1" value="'.$x.'" />';
Ghenis Posted December 19, 2007 Report Posted December 19, 2007 (edited) http://www.w3.org/TR/html4/types.html#type-cdata <?php $x=htmlentities (" aa \" aaa ' aa "); ?> <input type="text" name="a1" value="<?php echo $x;?>" /> Edited December 19, 2007 by Ghenis
PheliX Posted December 20, 2007 Report Posted December 20, 2007 pietiks ar htmlspecialchars() http://lv.php.net/manual/en/function.htmlspecialchars.php
Recommended Posts