PDA

View Full Version : Parse error: parse error, unexpected T_VARIABLE


shane.carr
06-02-2006, 07:31 PM
$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?

shane.carr
06-02-2006, 08:33 PM
Nevermind, I found my problem.

Sorry if I gave anybody a problem!