Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying the content of a file online 1

Status
Not open for further replies.

mirweb

Programmer
Joined
Aug 26, 2002
Messages
2
Location
AL
1. If the file is writable by all (owner, group, others) i can modify it. I suppose this is dangerous because who has shell access can modify the file. (we are talking about UNIX). Exist some way to modify it if the file isn't writable by all?

2. When I modified the file appear three "\" a the code before '"'. How can I avoid this?

Thanks in advance.
 
1. Your web server runs as a user. That user needs write permissions to the file.

2. I think there are some parts of this question were stripped by the TGML system. Could you repost this question, turning off the "Process TGML" checkbox?

Want the best answers? Ask the best questions: TANSTAAFL!!
 
1."Your web server runs as a user. That user needs write permissions to the file."
I read this but i don't understand. How can I change the permissions of this user. (I am new in PHP)

2. The second it means:

the file is: <img border=&quot;0&quot;>
After is : <img border=\\\&quot;0\\\&quot;>
 
1. Every program runs as some user. If you invoke a program on your *nix machine, that program runs as the user you logged in as. *nix daemons have the ability to be run by some user but then to change the user they run as. Apache does this.

Typically, root must start Apache, and it begins running as root. Apache then reads its configuration file, reads the &quot;User&quot; and &quot;Group&quot; configuration directives, then switches itself to run as that user and group.

PHP runs under Apache as Apache's user and group. So for PHP to write to a file, that file's user and/or group owners must be writable by the user and/or group Apache runs as.


2. I recommend that you use the PHP function stripslashes() on the function. PHP is likely adding those slashes deliberately to make sure that the quotes don't interfere with anything.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top