SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2001
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to create and write a file via PHP?

    Hi, I figured out that my hosting won't allow me to do a mod-rewrite or any 404 redirect trick. So, I thought creating a seperate file for each of my product would be my last resort.

    Anyway, I wish to know how to create a file and write something into it via PHP? I don't know the functions necessary to do so.

    Thanks.

  2. #2
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To write a file, your basic functions are fopen, fread, and fwrite, read the docs in PHP, they have pretty detail explanations on how to use them:

    http://php.net/manual/en/function.fopen.php

    http://php.net/manual/en/function.fread.php

    http://php.net/manual/en/function.fwrite.php

    Good luck.


Bookmarks

Posting Permissions

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