#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Gig Harbor, Washington, USA
    Posts
    29
    Rep Power
    0
    Here's the problem. I got my last post figured out but there is a little bug I want to squash.

    I have an options section for my news updater which allows you to change the poster name, the poster email, and the file in which posts go to.

    So in options.php3 this is what it looks like after the user has submitted the form:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <?
    }
    else
    {

    $fp = fopen("variables.txt","r+");

    $write_to_file = "
    <?
    $name = "$edit_name";
    $email = "$edit_email";
    $file = "$edit_file";
    ?>";

    fwrite($fp, "");
    fwrite($fp, $write_to_file, strlen($write_to_file));
    fclose($fp);

    }
    ?>
    [/code]

    So what is the problem you ask? Check out http://worldzone.net/arts/swanicke/variables.txt and you will see that there is some useless code at the end.

    This usless code is showing up at the top of every single admin page for my script! I have no idea why it's not being deleted and overwrited like the rest of the code in variables.txt.

    What's wrong?

    ------------------
    chris swanicke
    swanicke@defected.net
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Hderabad,Andhra Pradesh,India
    Posts
    10
    Rep Power
    0
    hi
    try out putting 'w' or 'w+' inplace of
    'r+' in fopen().


    anitha
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Gig Harbor, Washington, USA
    Posts
    29
    Rep Power
    0
    Ahhhh thank you Anitha.. my script of a lifetime is complete I am getting Core PHP Programing in a few days so t should be getting even better

    ------------------
    chris swanicke
    swanicke@defected.net

Similar Threads

  1. adjusting time duration from a drop down menu
    By spyghost in forum HTML Programming
    Replies: 9
    Last Post: March 1st, 2004, 02:05 AM
  2. time in - time out
    By newbiex in forum PHP Development
    Replies: 2
    Last Post: February 9th, 2004, 02:04 AM
  3. Adding time to time
    By bizantium in forum PHP Development
    Replies: 2
    Last Post: February 4th, 2004, 10:43 AM
  4. Adding minutes to time and other calcs
    By Jez433 in forum PHP Development
    Replies: 5
    Last Post: January 21st, 2004, 06:00 PM
  5. how to get entry and exit page time
    By umi8330 in forum PHP Development
    Replies: 2
    Last Post: December 24th, 2003, 12:56 AM

IMN logo majestic logo threadwatch logo seochat tools logo