Page 1 of 1

Form Data ignored

Posted: Wed May 21, 2003 4:31 am
by TheSam
Hi Everyone!

I'm new to this board and PHP but hopefully I can be of service to someone in the future :)

My problem is that I have a PHP file, editor.php, which outputs a HTML page with an HTML edit box which reads the code of "index.php" and displays it in a textarea.
The textarea is part of a form which points to the editor.php file.
(print '<form name="editor" method="post" action="editor.php">';)
When the editor.php recieves the form data it writes it to index.php and therefore we have a functional online PHP Editor :).

My problem is that it works great on my NT4 Server but when I try to use it on another server the editor.php acts like it hasn't recieved any form data, it just reloads and nothing is changed in the file.

Can someone help me with this?

Posted: Wed May 21, 2003 4:37 am
by []InTeR[]
Does the script has rights to change the index.php?

Ow, and this is a huge security hole! :twisted: :twisted:

Posted: Wed May 21, 2003 4:47 am
by TheSam
The folder access will be password protected by a .htaccess file.

I've tried messing around with the file permissions, what should they look like for the two files?

--Update:
btw, I have this code in the script:
if ($_POST[w]) { //Check if "write" button was used
if ($_POST

Code: Select all

 != $html) {
print "\n<p>Failed to write to file!</p>";
}
else
{
print "\n<p>File written successfully!</p>";
}
}

If it had recieved any POST Data at all it should have said something, which it does on my server, but not on the other one.