开发者

Echoing html and $_POST

echo "<p id='xlday'>'$_POST['day']'</p>";

Hi can anyo开发者_运维问答ne help me solve this problem, should be a simple one but i'm struggling for some reason! Thanks


echo "<p id='xlday'>".$_POST['day']."</p>";


echo "<p id='xlday'>".$_POST['day']."</p>";

or

echo "<p id='xlday'>{$_POST['day']}</p>";

or

echo "<p id='xlday'>${_POST['day']}</p>";

or

echo "<p id='xlday'>$_POST[day]</p>";



I'll also add

echo "<p id='xlday'>", $_POST['day'], "</p>";

with the mention that it does not actually concatenate the strings, but rather outputs them one at a time.


Do like this:

echo "<p id='xlday'>".$_POST['day']."</p>";


You can also do like:

echo "{$_REQUEST['day']}

";

However we prefer output buffering.

http://www.suite101.com/content/output-buffer-in-php-a26768

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜