PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$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
// FWRITE LINE BELOW IS THE LINE CAUSNG ERROR, BEFORE THAT FCLOSE WAS FOR SOME REASON.
fwrite("/article/article[$i].txt")
// Close the file handle
fclose($dude);
}
}
$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
// FWRITE LINE BELOW IS THE LINE CAUSNG ERROR, BEFORE THAT FCLOSE WAS FOR SOME REASON.
fwrite("/article/article[$i].txt")
// Close the file handle
fclose($dude);
}
}
$dude = fopen($fileName, 'w') or die("can't open file");
// what to write
$write = $_POST['name'].''. $_POST['email'].''. $_POST['article'] .'';
// open the file or kill the script and show error
$numBytes = fwrite($dude, $write);
// Write to the file with fwrite now
// FWRITE LINE BELOW IS THE LINE CAUSNG ERROR, BEFORE THAT FCLOSE WAS FOR SOME REASON.
fwrite("/article/article[$i].txt")
// Close the file handle
fclose($dude);
}
}
<?php
$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']);
/*********************************************
* The above line was causing the error with
* the phantom double quote just before the closing
* parenthesis
*********************************************/
// Write to the file with fwrite now
// FWRITE LINE BELOW IS THE LINE CAUSNG ERROR, BEFORE THAT FCLOSE WAS FOR SOME REASON.
fwrite("/article/article[$i].txt")
// Close the file handle
fclose($dude);
?>
$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
// FWRITE LINE BELOW IS THE LINE CAUSNG ERROR, BEFORE THAT FCLOSE WAS FOR SOME REASON.
fwrite("/article/article[$i].txt")
// Close the file handle
fclose($dude);
}
}
Think you have missed the semicolon after your --> fwrite("/article/article[$i].txt") ?! It should have been,
$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
fwrite(article/article[$i].txt)
// Close the file handle
fclose($dude);
}
}
?>
$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
fwrite(article/article[$i].txt)
// Close the file handle
fclose($dude);
}
}
?>
<?php
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
fwrite(article/article[$i].txt);
// Close the file handle
fclose($dude);
?>
it said I couldn't concoctanate .txt, I did this because I wanted to have [$i] a for loop that iterates (supposedly) each new article that is submitted, I created a variable $ext to handle the .txt file.
Parse error: parse error, unexpected T_STRING in /nfs/cust/8/25/05/650528/web/add_art.php on line 41
$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] . $ext);
// Close the file handle
fclose($dude);
?>
akimm wrote:it said I couldn't concoctanate .txt, I did this because I wanted to have [$i] a for loop that iterates (supposedly) each new article that is submitted, I created a variable $ext to handle the .txt file.
Parse error: parse error, unexpected T_STRING in /nfs/cust/8/25/05/650528/web/add_art.php on line 41
$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] . $ext);
// Close the file handle
fclose($dude);
?>
$dude = fopen($fileName, 'w') or die("can't open file");
// open the file or kill the script and show error
$write = ''. $_POST['name'] . $_POST['email'] . $_POST['article'] .'';
// create what to write
// I suggest this instead of putting it directly in the fwrite();
$numBytes = fwrite($dude, $write);
// Write to the file with fwrite now
$ext = '.txt';
fwrite("article/article . [$i] . $ext");
// Close the file handle
fclose($dude);
?>