SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fopen is giving error

    Hi
    all

    I tried to open the file to write content in the folder

    below is the code
    $fo = fopen("/zeeproject/phpforms/vehiclecollection.txt", "w+") or die("can't open file");

    it is giving erro can't open file

    The path which i have given is inside joomla. on linux

    please help me out

    Thanks
    MD.Samiuddin

  2. #2
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you say its in joomla... The script that contrains the above code, where is it located on the linux file system (directly from the root of the drive)?
    I'll do anything to avoid working on my own code

    Are you using: if (isset($_POST['submit'])) ?
    IE has a bug and does not always send the value.

  3. #3
    SitePoint Member
    Join Date
    Mar 2011
    Location
    Tyne & Wear
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe a silly question, but does the file already exist? and does the user account running PHP have write acccess to the folder/file your trying to write to?

    If you dont have write permissions, you will need to run a chmod on the directory.

  4. #4
    SitePoint Zealot Amit Yaron's Avatar
    Join Date
    Jan 2011
    Location
    Hod Haharon, Israel
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What error do you get? You can check in the server's error log. For example, in my computer the error log can be found in '/var/log/apache2/error.log'.


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
  •