Parse error: parse error, unexpected $ in /nfs/cust/8/25/05/650528/web/add_art.php on line 45
Code: Select all
<?php
if ($_POST['name'] = "" &&
$_POST['email'] = "" &&
$_POST['article'] ="")
{
echo "Please fill out all form fields";
}
// recognize what i want from user
$user = $_POST['name'] . $_POST['email'] . $_POST['article'];
// start an iteration that will add 1,2,3,4,5,6 and so on to each article added
for ($i=0;$i<count($i);$i++){
if ($user) {
$fileName = "/article/article1.txt";
// This can be anything (including file names generated with a loop like
//the one above)
$dude = fopen($fileName, 'w') or die("can't open file");
// open the file or kill the script and show error
$numBytes = fwrite($dude, $_POST['name'] . $_POST['email'] . $_POST['article']);
// Write to the file with fwrite now
$ext = '.txt';
fwrite(article/article . $i . txt);
// Close the file handle
fclose($dude);
}
?>