Jump to content

What is the chance for doing this !


manalnor

Recommended Posts

Hello friends,

 

if we have php file (lang.php) where lang are stored

 

Point 1

 

<?
$a[1]['en'] = "Good Day";
$a[2]['en'] = "Hello";
?>

 

then we have file that shows it using the following code

 

 

Point 2

 

<form action="processscript.php" method="post">
<textarea rows="5" cols="80" name="content">
<?
$fn = "lang.php";
print htmlspecialchars(implode("",file($fn)));
?>
</textarea>
<input type="submit" value="Save">
</form>

 

Now this should shows the content of lang.php in textarea where you can edit

 

and here is the action file processscript.php

 

Point 3

 

<?
$fn = "lang.php";
$content = stripslashes($_POST['content']);
$fp = fopen($fn,"w") or die ("Error opening file in write mode!");
fputs($fp,$content);
fclose($fp) or die ("Error closing file!");
echo "Done";
?>

 

this mean i can change inside the lang.php then save it

 

now the question at Point 2 should show the enter of lang.php

is there any chance or way that it shows only the words

 

i mean it will show it in textarea as

 

<?
$a[1]['en'] = "Good Day";
$a[2]['en'] = "Hello";
?>

 

is there any chance i make it show like this

 

Good Day
Hello

 

and in same time i can edit it and saved as it should be

 

for example if i did Good Day to Good Night then saved it

will be saved as

 

 

<?
$a[1]['en'] = "Good Night";
$a[2]['en'] = "Hello";
?>

 

 

hope you got what i meaning.

 

thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/197298-what-is-the-chance-for-doing-this/
Share on other sites

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.