Jump to content

Updateing a php file via another php file


Rawns

Recommended Posts

Ive createad a php file called index.php in a secure folder on my server. On the page is a text area called "textarea" and an update button called "update". When the page opens I want a main news file called mainnews.php to automaticly open into the text area so I can update it online. How would I go about doing this?
Link to comment
https://forums.phpfreaks.com/topic/8576-updateing-a-php-file-via-another-php-file/
Share on other sites

[!--quoteo(post=369342:date=Apr 27 2006, 09:10 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 27 2006, 09:10 PM) [snapback]369342[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Use file_get_contents or fopen, for example:
[code]<?php

$file = file_get_contents("mainnews.php");

echo '<textarea name="textarea">' . $file . '</textarea>';

?>[/code]
[/quote]

Works fine! Thank you :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.