title: html form to mysql database
body: <p>hi so i have to make a blog and I'm having a bit of a problem of showing my entries onto the webpage.</p>
  
  <pre><code>&lt;?xml version = "1.0" encoding = "utf-8"?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html xmlns = "http://www.w3.org/1999/xhtml"&gt; 
  &lt;head&gt; &lt;title&gt; Add entry &lt;/title&gt; 
  &lt;/head&gt; 
  &lt;body&gt;
  
  &lt;form action = "text1.php" method = "post"&gt;
  
  Title: &lt;input type = "text" name = "title"&gt;&lt;br&gt;
  Body: 
  &lt;textarea rows="10" cols="100" name="textblock"&gt;&lt;/textarea&gt;
  &lt;input type = "submit" value = "Add Entry" /&gt;
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>and my php code</p>
  
  <pre><code>&lt;?php
  $title = $_POST['title'];
  $textblock = $_POST['textblock'];
  $host   =   "xxxxxx"  ;
  $user   =   "xxx"  ;
  $pass   =   "xxx"  ;
  $db   =   "xxx"  ;
  
  
  // Connect to server and select database.
  mysql_connect("$host", "$username", "$password")or die("cannot connect");
  mysql_select_db("$db")or die(mysql_error());
  
  $query = "INSERT INTO yourMySQLTable (title, textblock) VALUES ('$title','$textblock')";
  
  mysql_query($query) or die('Error, insert query failed');
  
  ?&gt;
  </code></pre>
  
  <p>I want to display each entry, consisting of the title and the textblock on another webpage but for some reason the values are not going into the table. How do I input the values into the table and how do I display them on another webpage called viewblog.php?</p>