Current location: Hot Scripts Forums » Programming Languages » PHP » PHP File Edit Script - Wont work on NT IIS Server


PHP File Edit Script - Wont work on NT IIS Server

Reply
  #1 (permalink)  
Old 05-11-04, 03:52 AM
mcpaton mcpaton is offline
New Member
 
Join Date: May 2004
Location: Australia
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
PHP File Edit Script - Wont work on NT IIS Server

I've got this script that I found, and doctored up to suit my needs.. tested it on a Linux server and it all works fine. Uploaded it onto my NT server, and it wont run anymore...

The edit_file.php wont load the contents into the text area, and when i try and save the file, the edit_process.php says it can't open the text file. I have read/write/execute permissions on the directory, and files in it, so I'm kind of stumped. I'd appreciate any help...
Attached Files
File Type: zip Test.zip (2.3 KB, 127 views)
Reply With Quote
  #2 (permalink)  
Old 05-11-04, 07:39 PM
mcpaton mcpaton is offline
New Member
 
Join Date: May 2004
Location: Australia
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Here'a the code if it's any help...


filename is input from a select box on a form on the previous page...

-----

<textarea cols='90' rows='20' name='Post' tabindex='3' class='form'>
<?
$fn = $_POST['filename'];
print htmlspecialchars(implode("",file($fn)));
?>
</textarea>

----

server is Win2000 with IIS... wont read in the file at all...

then, I try and save the edited file in the page that i submit the first one to:

-------


<?
$fn = $_POST['filename'];
$Post = stripslashes($_POST['Post']);
$fp = fopen($fn,"w") or die ("Error opening file in write mode!");

fputs($fp,$Post);
fclose($fp) or die ("Error closing file!");
echo "<meta http-equiv=\"refresh\" content=\"0; url=edit_success.htm\" />\n";
?>


----

it all worked on Linux server, but not on windows... I'd appreciate any help!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP code to edit a text file mdhall Script Requests 12 12-23-10 04:03 AM
Need Help how to save file in server in PHP JTran PHP 1 04-21-04 07:29 AM
How to write a php script to load a text file into a table automatically? xmxpcom PHP 2 02-12-04 08:37 AM
Affiliate script (PHP) whtiebear Job Offers & Assistance 2 12-21-03 12:12 AM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 04:28 PM


All times are GMT -5. The time now is 10:32 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.