Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    262
    Thanks
    23
    Thanked 1 Time in 1 Post

    Post Parse Error : unexpected T variable in ...

    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.


    PHP Code:

    $logInTracker
    ="files/successLog.html"
    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
        
    if($logSuccess=="1"){


    $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;
        
    $count++;



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





        }

            
    // 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)

    Thanks!

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Come on... you have to comment double-quotes you want displayed inside of double-quotes.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    Regular Coder
    Join Date
    Feb 2006
    Posts
    262
    Thanks
    23
    Thanked 1 Time in 1 Post
    Resolved


  •  

    Posting Permissions

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