here it is
add.php
Code:
<html
<head>
<title>Ask a Question</title>
</head>
<body>
<form name="form1" method="post" action="question.php">
<table>
<tr>
<td>E-mail</td>
<td><input name="email" type="text" id="email" value="somebody@somewhere.com" onfocus="if (this.value == 'somebody@somewhere.com') this.value = '';" onblur="if (this.value == '') this.value = 'somebody@somewhere.com'"></td>
</tr>
<tr>
<td>Name</td>
<td><input name="name" type="text" id="name" value="John Doe" onfocus="if (this.value == 'John Doe') this.value = '';" onblur="if (this.value == '') this.value = 'John Doe'"></td>
</tr>
<tr>
<td>Question</td>
<td><input name="question" type="text" id="question" value="Question" onfocus="if (this.value == 'Question') this.value = '';" onblur="if (this.value == '') this.value = 'Question'"></td>
</tr>
<tr>
<td colspan=2><center><input type=submit value=Submit></center></td>
</tr>
</table>
</body>
</html>
question.php
Code:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$question = $_POST['question'];
$name = stripslashes($name);
$email = stripslashes($email);
$question = stripslashes($question);
$date = date("F j, Y");
$time = date("H:j:s");
$time1 = md5($time);
$time1 = sha1($time1);
$time1 = substr($time1, 0, 5)
$name1 = $time1.'.html';
$file_chmod = "created/$name1";
$file = fopen("created/$name1", "w+");
chmod($file_chmod, 0755);
if (($file) == 'True' OR '1'){
$message = "Email: $email <br> Name: $name <br> Question: $question<br> Time Created: $time";
$write_question = fwrite($file, $message);
}else{
echo "Whoops, the file wasn't created. Contact the administrator of the site";
}
fclose($file);
?>
that should work, if not post and the errors will get fixed