Wednesday, 15 August 2012

PHP String Concatenate issue -



PHP String Concatenate issue -

output of below php string not correct. it's displaying additional ( "> ) @ end. please help wrong doing?

$part2 = htmlentities('<input type="hidden" name="custom" value="<?php print($_session["muser"]."-".$_session["mpass"]);?>">'); print $part2;

thanks, kra

if you're in php mode, should utilize string concatenation instead of <?php ?> syntax; illustration splits html creation , escaping part.

$html = '<input type="hidden" name="custom" value="' . htmlspecialchars($_session["muser"] . "-" . $_session["mpass"]) . '">'; $part2 = htmlentities($html); print $part2;

php

No comments:

Post a Comment