ok, i've changed "button" to "submit" and tryed implementing the code provided by msgcrap and but still nothing.
heres what i've got so far (keeping in mind this is being used for a weblog, and this code is for the admin 'panel');
THE FORM, which should pass the information to add.php;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
</head>
<body><form action="add.php" method="post"><input name="new_news" type="text" value="enter text here" maxlength="500" /><input name="Submit" type="submit value="Submit" /></form>
</body>
</html>
and, add.php, that should capture the information passed from the form and write it into the news.txt file, but isn't.
<?php
$Submit = $_POST["Submit"];
$post = $_POST["new_news"];
$post = ereg_replace('[^A-Za-z 0-9,./?><";:\~!\'\"\/@#[](){}]', "", $post);
if ($Submit == "Yes") {
$filename = "../news.txt";
$fp = fopen( $filename,"r+");
$old_data = fread($fp, 80000);
fclose( $fp );
$date = (date ("(g:i A) l - d F Y"));
$input = "<p align=\"left\">$date<br>$post<br></p>";
$new = "$input$old_data";
$fp = fopen( $filename,"w");
if(!$fp) die("&error =Failed to write!");
fwrite($fp, $new, 800000);
fclose( $fp );
}
?>
😕