Results 1 to 2 of 2

Thread: fwrite problem!

  1. #1
    Join Date
    Feb 2005

    fwrite problem!

    I have this PHP file, with the below code what it does is
    it makes another file named members.php and puts this in it:
    <?PHP echo "hi"; ?>
    But I want it to put this into it instead:
    echo "hi";
    so pretty much the same only with new lines
    but when I make another of this like
    $stuff .= "\n";
    $stuff .= "<BR>";
    It just puts the <BR> or \n into the PHP file, and not making spaces but just directly puts it in..

    Anyone know how I can make spaces in it?? Thx in advance!!

    $stuff = "<?PHP";
    $stuff .= " echo 'hi';";
    $stuff .= "?>";

    $file = fopen("members.php", 'a');
    fwrite($file, $stuff);

    The thing is.. I made this login system for this dude.. pretty simple stuff, but now he want me to fix it so each member can edit their profile, like addinig their name, adress, phone etc.
    I plan to just write all this info to a PHP file using the switch statement. So when a user is logged on, lets say user "johndoe" in his membersarea it can be a link "edit profiile" which is a hyperlink to members.php?member=johndoe which takes him to the area with his info.. but I need to be able to have fwrite write the whole switch statement, and add new ones as they sign up. Thats why I cant have one long line, but need to make new lines but if I do $stuff .= "<BR>"; then <BR> is just written in the middle of the PHP file instead of making it a space..
    Last edited by UrlGuy; 06-25-2005 at 06:09 PM.

  2. #2
    echo "hi";
    $file = fopen("members.php", 'a');
    fwrite($file, $stuff); 
    HostNodeList Web Host Directory, DEV.INTOEX.COM - products for online business

    Experienced web-developer | PHP | Smarty | Zend | Databases | Graphic design - looking for long-time relationship

Posting Permissions

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