+ Reply to Thread
Results 1 to 4 of 4
Like Tree2Likes
  • 1 Post By NightFox
  • 1 Post By t2t2t

Thread: PHP writing to a file outside a directory

  1. #1
    NightFox is offline x10Hosting Member NightFox is an unknown quantity at this point
    Join Date
    Jan 2009
    Posts
    3

    PHP writing to a file outside a directory

    Hey all its me again :eek4:

    I have a form that submits data to a file however this form is located in an admin folder, and the file is stored in a data folder. I would like to write to the file in the data folder from the form in the admin folder. Is this possible? (I can already write to a file just not the one i need)

    Folder hierrachy:
    www-->
    admin --> 'Form'
    images
    data --> 'news.txt'
    Sry for botherin everyone again, just want to learn this asap

    Regards

    NightFox
    Edit:
    Nevermind guys i found out how to do it

    '../data/news.txt'
    Last edited by NightFox; 01-22-2009 at 04:36 AM. Reason: Automerged Doublepost
    dinomirt96 likes this.

  2. #2
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: PHP writing to a file outside a directory

    or.

    /home/cpanelusername/public_html/data/news.txt/
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  3. #3
    Parsa44 is offline x10 Sophmore Parsa44 is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    232

    Re: PHP writing to a file outside a directory

    How would i solve this:

    www-->

    admin --> 'Folder1' --> 'Page.txt'
    images --> 'folder2' --> 'Page2.txt'

    from page.txt to page2.txt

  4. #4
    t2t2t's Avatar
    t2t2t is offline x10 Elder t2t2t is an unknown quantity at this point
    Join Date
    Sep 2006
    Location
    Europe, Estonia
    Posts
    690

    Re: PHP writing to a file outside a directory

    .. means go up a folder, so each time you use it, it goes up a folder:

    ../../images/folder2/Page2.txt
    karimirt47 likes this.
    This post has been marked spam 52 times.


+ Reply to Thread

Similar Threads

  1. Replies: 3
    Last Post: 11-13-2008, 01:20 AM
  2. It works! ...
    By bpakidz in forum Programming Help
    Replies: 4
    Last Post: 09-07-2008, 11:12 PM
  3. Replies: 2
    Last Post: 08-17-2008, 08:30 PM
  4. php errors galore
    By DMG Online in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 05-17-2008, 06:23 AM
  5. php version
    By loveispoison in forum Free Hosting
    Replies: 10
    Last Post: 11-21-2007, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers