0

I'm trying to update some text on a html page via jQuery ajax presently. This page's script calls an ajax request to a file in subfolder via jquery and displays that text. I need to be able to update this file with text from a different html page.

I tried php, and found I didn't have file permissions to probably the ftp account or the webserver settings. Since php is the most popular method for file writing on a webserver, I haven't tried any other method.

I could try MYSQL + PHP for this, although I don't intend to put the root password in a text/php file.

I tried using Google Apps Spreadsheet with JSON output, and later found that JSON output was deactivated by Google (I guess).

Therefore, I was hoping to find a convenient way to get textual data from some source, and be able to update the textual data without any restrictions.

RBT
  • 24,161
  • 21
  • 159
  • 240
mk117
  • 753
  • 2
  • 13
  • 26

1 Answers1

0

On most webservers, you will find at least one directory which is writable for PHP scripts. Else, you can place a file anywhere on the server and change the owner and write permissions, so that your PHP scripts will be able to write into that file. Please contact your webserver admin for details.

MySQL passwords in PHP files are no issue, as long as you put your PHP file outside of the directory that servers as root directory for your website. E.g. if your root is set to /var/www/user1/website1/, you can put a script inside /var/www/user1/, the PHP script shall be allowed to read that. This is the usual approach.

craesh
  • 3,665
  • 3
  • 23
  • 29