Jump to content

Introduceti Din Php Un Text Intr-un Fisier .txt


Recommended Posts

Posted

1. Deschideti Notepad si salvati fisierul sub numele de text.txt

2. Creati un fisier .php si plasati codul de mai jos in el.

<center><strong>TexT</strong> 
<?php
if($_POST['update']) {
$newmsg = stripslashes($_POST['message']);
$file = fopen("text.txt","r+");
ftruncate($file,0);
$writedate = fwrite($file,$newmsg);
fclose($file);
}
$messages = fopen("text.txt","r+");
$message = fread($messages,100000);
fclose($messages);
?>

<form action="<? $php_self ?>" method="post">
<textarea name="message" rows="4" cols="40"><?=$message?>
</textarea>

<input type="submit" name="update" value="Update" />
</form>
</center>[/html]

3. Uploadati ambele fisiere pe host, [color=red]dati [b]CHMOD 777[/b] pe fisierul [b]text.txt[/b][/color]

Dupa ce apasati pe butonul update tot ce e scris in textbox va aparea in text.txt

Te-ai inregistrat? Ne-ar placea sa te prezinti.

Cum pot sustine forumul?
Cumpara de la eMag folosind acest link.
--------------------
oG2BN9d.gifse1WdXd.gifQG6MtmI.gifRHYjDzD.gifG5p1wui.gif

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.