Form Data ignored

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TheSam
Forum Newbie
Posts: 2
Joined: Wed May 21, 2003 4:31 am

Form Data ignored

Post 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?
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

Does the script has rights to change the index.php?

Ow, and this is a huge security hole! :twisted: :twisted:
TheSam
Forum Newbie
Posts: 2
Joined: Wed May 21, 2003 4:31 am

Post 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.
Post Reply