dezkit Posted August 4, 2008 Share Posted August 4, 2008 <?php if (isset($_POST['submit'])) { file_put_contents('test.php', $_POST['textarea']); header("Location: edit.php "); } else { $index = file_get_contents("test.php"); ?> <html> <title>Read Data</title> <form name="change" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <textarea name="textarea" cols="80" rows="20"><?php echo htmlentities($index); ?></textarea> <input type="submit" name="submit"> </form> </html> <?php } ?> Link to comment https://forums.phpfreaks.com/topic/118013-show-files-in-page/page/2/#findComment-607160 Share on other sites More sharing options...
DarkWater Posted August 4, 2008 Share Posted August 4, 2008 What? You don't need the header call, nor do you need the link. O_O Link to comment https://forums.phpfreaks.com/topic/118013-show-files-in-page/page/2/#findComment-607161 Share on other sites More sharing options...
dezkit Posted August 4, 2008 Share Posted August 4, 2008 yes he does. Link to comment https://forums.phpfreaks.com/topic/118013-show-files-in-page/page/2/#findComment-607163 Share on other sites More sharing options...
DarkWater Posted August 4, 2008 Share Posted August 4, 2008 No he doesn't, he's already on the page, because that's where the form submits to. O_O Link to comment https://forums.phpfreaks.com/topic/118013-show-files-in-page/page/2/#findComment-607165 Share on other sites More sharing options...
ngreenwood6 Posted August 4, 2008 Author Share Posted August 4, 2008 Reply what is your suggestion darkwater. I want to thank everyone for their contribution and let it be known that this is one of the best communities out there for helping noobs with their coding. I will be making a contribution very shortly. Link to comment https://forums.phpfreaks.com/topic/118013-show-files-in-page/page/2/#findComment-607167 Share on other sites More sharing options...
DarkWater Posted August 4, 2008 Share Posted August 4, 2008 Well, you're already on the page because that's where the form submits to...So you should need to link or send a header. Just remove the else { line and its closing brace. Link to comment https://forums.phpfreaks.com/topic/118013-show-files-in-page/page/2/#findComment-607168 Share on other sites More sharing options...
ngreenwood6 Posted August 4, 2008 Author Share Posted August 4, 2008 Thanks that works perfectly. However I have found that if I close out of the page and go back to it it doesnt show my changes unless I hit refresh, but when i submit them it does. Anyone know how to make it refresh the page on return? Link to comment https://forums.phpfreaks.com/topic/118013-show-files-in-page/page/2/#findComment-607174 Share on other sites More sharing options...
ngreenwood6 Posted August 4, 2008 Author Share Posted August 4, 2008 Anyone? Link to comment https://forums.phpfreaks.com/topic/118013-show-files-in-page/page/2/#findComment-607179 Share on other sites More sharing options...
dezkit Posted August 4, 2008 Share Posted August 4, 2008 can you elaborate please Link to comment https://forums.phpfreaks.com/topic/118013-show-files-in-page/page/2/#findComment-607187 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.