回应html和$ _POST

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

Hi can anyone 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>";

Do like this:

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.

You can also do like:

echo "{$_REQUEST['day']}

";

However we prefer output buffering.

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