Parse error | | | Join Date: Mar 2010
Posts: 3
| |
hi all, i keep getting this error and i'm new to php. i really don't get the error here:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in ...index.php on line 90
line 90: - echo "<form id="form1" name="form1" method="post" action="start.php?action=<?php echo $Action; ?>&lan= <?php echo $_GET['lan']; ?>&invite=submit">
line 91: - echo " <font color=\"#FFFFFF\" face=\"Trebuchet MS\">\n";
| |
best answer - posted by numberwhun |
Looking at the first line, there are a couple of things wrong right off the bat:
1. You are using double quotes inside of the echo's double quotes, without escaping them.
2. You are trying to use PHP code inside of PHP code (inside of a PHP echo).
This is a much better way to write that statement: -
echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"start.php?action=" .$Action. "&lan=" .$_GET['lan']. "&invite=submit\">";
-
Regards,
Jeff
|  | | | Join Date: May 2007 Location: New Hampshire, USA
Posts: 2,818
| | | re: Parse error
Looking at the first line, there are a couple of things wrong right off the bat:
1. You are using double quotes inside of the echo's double quotes, without escaping them.
2. You are trying to use PHP code inside of PHP code (inside of a PHP echo).
This is a much better way to write that statement: -
echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"start.php?action=" .$Action. "&lan=" .$_GET['lan']. "&invite=submit\">";
-
Regards,
Jeff
| | | | Join Date: Mar 2010
Posts: 3
| | | re: Parse error
thank you very much! it worked
but now i get the next error and i tried lots of things but again can't get it fixed :(
Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in index.php on line 98 - echo " <input type=\"text\" name=\"addy\" id=\"search_box\" class='search_box'/>\n";
-
echo " <input type=\"submit\" value=\"Send Invite\" class=\"search_button\" /><br />\n";
-
echo "
-
echo " if ($_GET['invite'] == submit){
-
echo " $invitation = $_POST['addy'];
-
echo " if ($invitation == ""){
-
echo " echo '<SCRIPT LANGUAGE="JavaScript"> alert ("Put something in the Emailfield!") </SCRIPT>';
-
echo " }else{
-
echo " include("invite.php");
-
echo " }
-
echo " }
line 98 is with the first if...
|  | | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 5,234
| | | re: Parse error
I’m 99.99% sure you don’t intend to print out the if statement, do you?
|  | | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 5,234
| | | re: Parse error
what error? lines 3 to 11 don’t need an echo statement either.
| | | | Join Date: Mar 2010
Posts: 3
| | | re: Parse error
i removed all echos from those lines and now it works, only removed the echos before the if previously >_>
sorry and thanks for the help! can be closed
|  | | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 5,234
| | | re: Parse error |  | | | Join Date: Jan 2010 Location: Japan
Posts: 167
| | | re: Parse error
hey, sehe gerade, dass du aus deutschland kommst. also ich bin ein anfänger und ich nehme mal an du meinst das mit dem echo? muss das vorm if weg? wenn ja, das hab ich schon probiert und dann kommt wieder ein anderer fehler...
is this acceptable? i didnt understand anything.
|  | | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 5,234
| | | re: Parse error @johny10151981
no, it isn’t. but an infraction has already been given. it basically says, that errors remained.
|  | | | | |