Results 1 to 4 of 4

Thread: Parse error: syntax error

  1. #1
    Join Date
    Jul 2011
    Posts
    58
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Parse error: syntax error

    PHP Code:
    <?php
    session_start
    ();
    unset(
    $_SESSION['uname']);
    unset(
    $_SESSION['utype']);
    header('location:signin.html');
    ?>
    I am getting the following error when I run above code-
    "Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ')' in D:\xampp\htdocs\...\signout.php on line 3"
    Pls Help

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I don't see anything wrong. Retype the above code to be sure that it doesn't contain any invisible characters (perhaps from cutting and pasting).

    If not, it's only 4 lines, so you should be able to figure out what's going on by commenting each line out individually-- //line. You might want to disable (comment out) the redirect while you're testing.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    not directly related, but
    Code:
    header('location:signin.html');
    needs to be
    Code:
    header('Location: http://example.com/path/to/signin.html');
    note the spacing, capitalization, and absolute URI (relative URIs don't work reliably in all browsers; see note #6).

  4. #4
    Join Date
    Jul 2011
    Posts
    58
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Sorry,this question was wrongly posted.

    Actually I was modifying another program & running this program!!!
    lol

    p.s. :@Moderator -Why is there no option of deleting a question wrongly posted?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •