PHP writing to a file outside a directory

NightFox

New Member
Messages
3
Reaction score
0
Points
0
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:

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
or.

/home/cpanelusername/public_html/data/news.txt/
 

Parsa44

New Member
Messages
232
Reaction score
0
Points
0
How would i solve this:

www-->

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

from page.txt to page2.txt
 

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
.. means go up a folder, so each time you use it, it goes up a folder:

../../images/folder2/Page2.txt
 
Top