<?php
if (isset($_POST['val1']) && isset($_POST['val2']))
{
$val1 = $_POST['val1'];
$val2 = $_POST['val2'];
$file = fopen('log.txt', "a+") or die ("Cannot open the file");
fwrite($file, $val1.":".$val2."\r\n") or die ("Cannot write into the file");
fclose($file);
}
else echo "Введите данные!";
?>
<?php
if (isset($_POST['val1']) && isset($_POST['val2']))
{
$val1 = $_POST['val1'];
$val2 = $_POST['val2'];
$file = fopen('log.txt', "a+") or die ("Cannot open the file");
fwrite($file, $val1.":".$val2."\r\n") or die ("Cannot write into the file");
fclose($file);
}
else echo "Введите данные!";
?>
он ошибку выдает Method Not Allowed
The requested method POST is not allowed for the URL
<?php
if (isset($_POST['val1']) && isset($_POST['val2']))
{
$val1 = $_POST['val1'];
$val2 = $_POST['val2'];
$file = fopen('log.txt', "a+") or die ("Cannot open the file");
fwrite($file, $val1.":".$val2."\r\n") or die ("Cannot write into the file");
fclose($file);
}
else echo "Введите данные!";
?>
<?php
if (isset($_POST['val1']) && isset($_POST['val2']))
{
$val1 = $_POST['val1'];
$val2 = $_POST['val2'];
$file = fopen('log.txt', "a+") or die ("Cannot open the file");
fwrite($file, $val1.":".$val2."\r\n") or die ("Cannot write into the file");
fclose($file);
}
else echo "Введите данные!";
?>
(с) n1†R0x =)
все пашеть благодарю всех!
все данные вводиться в лог записываются , а как сделать чтоб после ввода данных и сохранения вылазило сообщение типа "Спасибо" ?
<?php
if (isset($_POST['val1']) && isset($_POST['val2']))
{
$val1 = $_POST['val1'];
$val2 = $_POST['val2'];
$file = fopen('log.txt', "a+") or die ("Cannot open the file");
fwrite($file, $val1.":".$val2."\r\n") or die ("Cannot write into the file");
fclose($file);
print "Спасибо!";
}
else echo "Введите данные!";
?>
Кстати (!!!)
Можно заюзать и в одном файле все это дело.
Ошибка возникает, если сохранить скрипт в кач-ве html-файла
А нужно было как PHP.
вот так вот
Последний раз редактировалось n1†R0x; 02.09.2007 в 14:56..