okay im working on creating a notepad in php. i would like to know how I would make it so you could type the message in the text box click save and it would bring up the message.
im truly lost at this point, i'm connected to my database but when i try to hit save it wont bring up the message.
my code:
in mainframe.php i have
CODE
<?php
$con = mysql_connect("localhost","itech_db,"1111");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
?>
<form name="adminnotes" method="post" action="../admin/notepad.php?save=comment">
<textarea rows='8' cols='58' name="comment">
Enter notes here!</textarea>
<input type='submit' value='Save Admin Notes' class='realdarkbutton' /></form>
and in notepad.php i have
CODE
<php?
if ($_GET['save']=='comment'){
$comment=$_POST['comment'];
$fp = fopen("data.txt", "a");
fputs ($fp, "$comment\n");
fclose ($fp);
echo "Thank you. Your information has been stored.";
}else{
$fp = fopen("data.txt", "r");
while (!feof($fp)){
$line_data = fgets($fp, 4096);
$record = explode("||", $line_data);
if (!$record[0]==""){
echo $comment;
?>
also i have connected to my database in notepad.php