Parse error: parse error, unexpected T_DO in c:\sarah\easyphp\www\login.php on line 66

i keep getting this error, im new to this and not sure how to fix it, please help. the line is:

unset ($_GET['do']);

thanks😕

    That looks correct to me. Check before that line - could there be a quote mark left open by mistake? If so, PHP may think that string lasts all through unset($_GET[ and then ends at the first quote. Then it detects a DO loop which it doesn't like as it thinks there should be a ; after the quote.

      /if (!ereg("[A-Za-z' -]{1,50}$",$value))
      {
      unset($_GET['do']);
      $message_new = "$field is not a valid name.
      Please try again.";
      include("login_form.inc");
      exit();
      }
      /

        case "new":
        foreach($POST as $field => $value)
        {
        if ($field != "fax")
        {
        if ($value == "")
        {
        unset($
        GET['do']);

        this is before, the above post is below the $_GET line.

        thanks for your help

        thanks

        delightful

          Originally posted by delightful
          /if (!ereg("[A-Za-z' -]{1,50}$",$value))
          {
          unset($_GET['do']);
          $message_new = "$field is not a valid name.
          Please try again.";
          include("login_form.inc");
          exit();
          }
          /

          there's a hanging ' after the lower case z

            its the above one i need

            case "new":
            foreach($POST as $field => $value)
            {
            if ($field != "fax")
            {
            if ($value == "")
            {
            unset($
            GET['do']);

              That shouldn't matter as it's within double quotes, but you could try escaping it anyway.

              I'm not quite sure what the first snippit (ereg(...) is about but the second snippet looks correct. Could there be anything even before that?

                have a look at the attached file.

                you may be able to see something i cant

                cheers

                  i have another problem now.

                  Parse error: parse error, unexpected $end in c:\sarah\easyphp\www\login.php on line 148

                  this line is ?> so surely that shouldnt be right.

                  also how do i include a background picture

                    actually no problem, i seem to have been missing double quotes in places, i have now fixed them.

                      Write a Reply...