freak Posted December 19, 2007 Report Share 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. Link to comment Share on other sites More sharing options...
Paulinjsh Posted December 19, 2007 Report Share Posted December 19, 2007 echo '<input type="text" name="a1" value="'.$x.'" />'; Link to comment Share on other sites More sharing options...
Ghenis Posted December 19, 2007 Report Share 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 Link to comment Share on other sites More sharing options...
PheliX Posted December 20, 2007 Report Share Posted December 20, 2007 pietiks ar htmlspecialchars() http://lv.php.net/manual/en/function.htmlspecialchars.php Link to comment Share on other sites More sharing options...
Recommended Posts