1. Create a new document in Dreamweaver
  2. Save it into your blog folder, name it blog.php
  3. Switch to code view and erase everything
  4. 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";
}
?>

  1. Replace david in line 6 with your name
  2. Save the Document
  3. Open index.htm(l)
  4. Locate the Form Tag in the code view
  5. Change it so it looks like below:

<form id="form1" name="form1" method="post" action="blog.php">

  1. 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)

  1. Upload index.html & blog.php
  2. Test your form online. If you do not receive an error message, it probably worked

 

 

$array[caption] "; } } else { print "No results."; } ?>
Home
$array[caption] "; } } else { print "No results."; } ?>
Classes
$array[caption] "; } } else { print "No results."; } ?>
Instructor
$array[caption] "; } } else { print "No results."; } ?>
Robotics