View Full Version : Parse Error : unexpected T variable in ...

07-03-2007, 05:55 AM
Good day to you all,
Here I'm block again in from of this piece of code.

It give me an error like :
Parse Error : unexpected T variable in ...

which it is line 16 in the piece of code.

function success($logSuccess,$logInTracker,$loginName,$goHere)
$date=date ("l dS of F Y h:i:s A");
$register_globals = (bool) ini_get('register_gobals');
if ($register_globals) $ip = getenv(REMOTE_ADDR);
else $ip = $_SERVER['REMOTE_ADDR'];

// If webmaster wants to log successful logins

$good = "<tr><td bgcolor="#ffffff" class="black" align="center"><table border=0 align="center" width="100%" cellspacing="1" cellpading=\"0\"><tr><td bgcolor="#339933" class="black" align="center"><b class="black">" .$loginName . "</b></td></tr><tr><td bgcolor="#339933" class="black" align="center">" . $date . "</td></tr><tr><td bgcolor="#339933" class="black" align="center">" . $ip . "</td></tr></td></tr></table>";

$lines=file($logInTracker); //load the lines to an array
$insert_line = 60; //the line to insert at...could be a post variable
$insert_text = "$good" ; //this could be a post variable, but at any case make sure to append the var with the new line, otherwise it will run together
$temp=""; //start a temp variable to work with
$count=1; //initialize a counter

foreach($lines as $line){
$temp .= ($count != $insert_line) ? $line : $insert_text . $line;

$log=fopen($logInTracker, 'w');
$write = fwrite($log, $temp);


// If no log or after log then go here
Header("Location: $goHere");

My goal here is to add a html line into the html page ($LogInTracker)


07-03-2007, 06:05 AM
Come on... you have to comment double-quotes you want displayed inside of double-quotes. :rolleyes:

07-03-2007, 06:56 AM
Escape is the better word to use rather than comment. It seems that you have dove in head first into php without really doing any research yourself. I suggest you start reading the manual and doing tutorials as many of your questions are simple enough that they can be answered by yourself just from reading the manual.

07-04-2007, 02:35 AM