You are here: Re: Newbie problem with $_POST « PHP Programming Language « IT news, forums, messages
Re: Newbie problem with $_POST

Posted by Chris on 02/27/06 21:31

Here is some sample code from my script.

<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
error_reporting(0);
$filename = $_GET['textfilename'];
$contents = $_POST['writevar'];
$filetype = strstr($filename, '.txt');
if ($filetype <> '.txt') {
echo 'Error. Cannot open file.';
exit;
}
touch($filename);
chmod($filename,0777);
if (!$handle = fopen($filename, 'w')) {
echo "Error. Cannot open file.";
fclose($handle);
exit;
}
if (fwrite($handle, $contents) === FALSE) {
echo "Error. Cannot write to file.";
fclose($handle);
exit;
}
echo "Success";
fclose($handle);
?>

<joelbyrd@gmail.com> wrote in message
news:1141068188.676297.326530@e56g2000cwe.googlegroups.com...
> To help you out, we need some code.
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация