www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Parse error: parse error, unexpected T_VARIABLE

  1. #1
    Join Date
    May 2006
    Location
    North of the South Pole
    Posts
    590

    resolved [RESOLVED] Parse error: parse error, unexpected T_VARIABLE

    Code:
    $j = 0;
    line 175 while(file_exists('single_forum|'.stripslashes($_POST['forum']).'|'.$j.'|.html')){
    include('single_forum|'.stripslashes($_POST['forum']).'|'$j'|.html');
    $j = $j + 1;
    };
    $k = fopen($newforumname, 'w') or die("can't open file");
    fwrite($messageformated, $k);
    fclose($k);
    Parse error: parse error, unexpected T_VARIABLE in [path to php] on line 175

    This code is for the forum I'm trying to make. The messages will be called "single_forum|[forum name]|[message number]|.html". The variable "$j" is the massage number. It starts as 0. Then, I check to see if the post with $j exists. If it does, I write it to the PHP. Then I increase $j and start over again. If it doesn't exist, I create it. It seems like it should work fine. But, it gives me that ugly error. I've checked for semicolons (I always forget them) but they seem to all be there. What's my problem?

  2. #2
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,739
    $j on line 176 needs proper concatenation.
    PHP Code:
    .$j
    Also you have a spare delimiter on line 178 after the curly (not that PHP will care).
    Last edited by bokeh; 06-02-2006 at 02:12 PM.

  3. #3
    Join Date
    May 2006
    Location
    North of the South Pole
    Posts
    590
    Thanks!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles