![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 325 Pomógł: 33 Dołączył: 31.05.2008 Ostrzeżenie: (0%) ![]() ![]() |
Chciałem napisać skrypt, który zapisuje dane z formularza do pliku, a następnie odczytuje je na nowej stronie, ale coś nie chce działać. Sprawdzicie co jest źle?
index.php Kod <BR><html><BR><head><BR> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2" /><BR></head><BR><body></P> <P><?<BR>echo ("<form action=wpis.php method=post> ");<BR>echo ("Imie:");<BR>echo ("<input type=text name=imie value=> ");<BR>echo ("E-mail:");<BR>echo ("<input type=text name=mail value=> ");<BR>echo ("Tresc:");<BR>echo ("<textarea name=tresc rows=10 cols=40></textarea> ");<BR>echo ("<input type=submit value=wyslij>");<BR>echo ("</form>");<BR>?></P> <P></form><BR></body><BR></html><BR> wpis.php Kod <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2" /> <meta http-equiv="refresh" content="3;URL=odczyt.php"> </head> <body> <? $imie=$__POST['imie']; $mail=$__POST['mail']; $tresc=$__POST['tresc']; $asd= $imie.$mail.$tresc; echo ("$asd"); $file=fopen("plik.txt", "w"); fwrite($file, $asd, 999); fclose($file); ?> </body> </html> odczyt.php Kod <html>
<head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2" /> </head> <body> <? $aaa=fopen("plik.txt", "w"); $dane = fread($aaa, 999); fclose($aaa); echo ("$dane"); ?> </body> </html> |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.08.2025 - 02:02 |