Parse error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spelaben
    New Member
    • Mar 2010
    • 3

    Parse error

    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:
    Code:
    echo "<form id="form1" name="form1" method="post" action="start.php?action=<?php echo $Action; ?>&lan= <?php echo $_GET['lan']; ?>&invite=submit">

    line 91:
    Code:
    echo "			  <font color=\"#FFFFFF\" face=\"Trebuchet MS\">\n";
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    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:

    Code:
    echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"start.php?action=" .$Action. "&lan=" .$_GET['lan']. "&invite=submit\">";
    Regards,

    Jeff

    Comment

    • spelaben
      New Member
      • Mar 2010
      • 3

      #3
      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

      Code:
      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...

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        I’m 99.99% sure you don’t intend to print out the if statement, do you?

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          what error? lines 3 to 11 don’t need an echo statement either.

          Comment

          • spelaben
            New Member
            • Mar 2010
            • 3

            #6
            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

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #7
              Originally posted by spelaben
              can be closed
              denied ;)

              Comment

              • johny10151981
                Top Contributor
                • Jan 2010
                • 1059

                #8
                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.

                Comment

                • Dormilich
                  Recognized Expert Expert
                  • Aug 2008
                  • 8694

                  #9
                  Originally posted by johny10151981
                  is this acceptable? i didnt understand anything.
                  no, it isn’t. but an infraction has already been given. it basically says, that errors remained.

                  Comment

                  Working...