- Create a new document in Dreamweaver
- Save it into your blog folder, name it blog.php
- Switch to code view and erase everything
- Paste in the following code into the document:
<?php
{
$date = date("F j, Y");
$conn = mysql_connect("localhost", "wetsoxor_student", "coyote");
mysql_select_db("wetsoxor_davinci", $conn) or die(mysql_error());
$sql="insert into blog values ('david', '$_POST[email]', '$date', '$_POST[comment]', '$_POST[name]')";
$result=mysql_query($sql, $conn) or die(mysql_error());
print "Thanks";
}
?>
- Replace david in line 6 with your name
- Save the Document
- Open index.htm(l)
- Locate the Form Tag in the code view
- Change it so it looks like below:
<form id="form1" name="form1" method="post" action="blog.php">
- Check each of your field tags, they should look like this:
<input type="text" name="name" id="name" />
<input name="email" type="text" id="email" size="20" />
<textarea name="comment" id="comment2" cols="17" rows="5"></textarea>
(Your size, cols and rows may be different)
- Upload index.html & blog.php
- Test your form online. If you do not receive an error message, it probably worked
![$array[caption]](/newimages/$array[photo])
";
}
} else {
print "No results.";
}
?>
Home
![$array[caption]](/newimages/$array[photo])
";
}
} else {
print "No results.";
}
?>
Classes
![$array[caption]](/newimages/$array[photo])
";
}
} else {
print "No results.";
}
?>
Instructor
![$array[caption]](/newimages/$array[photo])
";
}
} else {
print "No results.";
}
?>
Robotics