hi so i have to make a blog and I'm having a bit of a problem of showing my entries onto the webpage.
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head> <title> Add entry </title>
</head>
<body>
<form action = "text1.php" method = "post">
Title: <input type = "text" name = "title"><br>
Body:
<textarea rows="10" cols="100" name="textblock"></textarea>
<input type = "submit" value = "Add Entry" />
</body>
</html>
and my php code
<?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');
?>
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?