[SOLVED] unexpected T_ENCAPSED_AND_WHITESPACE,
Moderator: General Moderators
[SOLVED] unexpected T_ENCAPSED_AND_WHITESPACE,
Hi,
Im getting error parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
and the line where it is pointing is
as follows
echo "<input type=\"hidden\" name=\"to.$i\" value=\"$_POST['to'.$i]\">";
but I dont find this wrong as per my knowledge,but vi editor and browser show there is an error here.
Can someone help me.
Dude81
Im getting error parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
and the line where it is pointing is
as follows
echo "<input type=\"hidden\" name=\"to.$i\" value=\"$_POST['to'.$i]\">";
but I dont find this wrong as per my knowledge,but vi editor and browser show there is an error here.
Can someone help me.
Dude81
Here is the thing.
Hey I counted all the braces but still no result this is the thing
Code: Select all
<form name="preview_form" action="tinvite_health.php" method="POST">
<?
$message_header = nl2br($_REQUEST["message_header"]);
$message_footer = nl2br($_REQUEST["message_footer"]);
for($i=1;$i<=10;$i++)
{
echo $_POST['to'.$i];
echo "<br>";
{
echo "<input type=\"hidden\" name=\"to.$i\" value=\"$_POST['to'.$i]\">";
echo "<input type=\"hidden\" name=\"message_header\" value=\"$message_header\">";
echo "<input type=\"hidden\" name=\"message_footer\" value=\"$message_footer\">";
}
}
?>- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
<form name="preview_form" action="tinvite_health.php" method="POST">
<?
$message_header = nl2br($_REQUEST["message_header"]);
$message_footer = nl2br($_REQUEST["message_footer"]);
for($i=1;$i<=10;$i++)
{
echo $_POST['to'.$i];
echo "<br>";
echo "<input type=\"hidden\" name=\"to.$i\" value=\"$_POST['to'.$i]\">";
echo "<input type=\"hidden\" name=\"message_header\" value=\"$message_header\">";
echo "<input type=\"hidden\" name=\"message_footer\" value=\"$message_footer\">";
}
?>Not solved yet
Certainly I was doing a mistake there, but it doesnt seem the error.
The same error message repeats still
dude81
The same error message repeats still
dude81
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
<form name="preview_form" action="tinvite_health.php" method="POST">
<?
$message_header = nl2br($_REQUEST["message_header"]);
$message_footer = nl2br($_REQUEST["message_footer"]);
for($i=1;$i<=10;$i++)
{
echo $_POST['to'.$i];
echo "<br>";
echo "<input type=\"hidden\" name=\"to.$i\" value=\"$_POST['to'.$i]\">";
}
echo "<input type=\"hidden\" name=\"message_header\" value=\"$message_header\">";
echo "<input type=\"hidden\" name=\"message_footer\" value=\"$message_footer\">";
?>Code: Select all
tags around your php code [/color]- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
<form name="preview_form" action="tinvite_health.php" method="POST">
<?
$message_header = nl2br($_REQUEST["message_header"]);
$message_footer = nl2br($_REQUEST["message_footer"]);
for($i=1;$i<=10;$i++)
{
echo $_POST['to'.$i];
echo "<br>";
echo "<input type=\"hidden\" name=\"".'to'.$i."\" value=\"".$_POST['to'.$i]."\">";
}
echo "<input type=\"hidden\" name=\"message_header\" value=\"$message_header\">";
echo "<input type=\"hidden\" name=\"message_footer\" value=\"$message_footer\">";
?>Concatenation in PHP
feyd | forgot to quote 'to' in that bit.
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
Code: Select all
echo "<input type=\"hidden\" name=\"to.$i\" value=\"$_POST['to'.$i]\">";If you want to write it as it is you should surround it with {}, which you should have done in 1st place.