Jump to content

Introduceti Din Php Un Text Intr-un Fisier .txt


gaby

Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.