Okay I'm pretty noobish to PHP, and I have no idea why this isn't working. I thought it would work, but it doesn't.
Okay so let me explain before I post the code. On index.php, I show the most recent blog posts (it works fine, don't worry about that) as a link. Then a form sends it to the post.php page using GET (so they can save the page). The problem is well... on post.php, nothing happens. It somehow doesn't receive the information. I have a feeling it's a really noobish problem, but all the same, be nice. Okay so here are the codes:
index.php
<?
$dbhost = 'localhost';
$dbuser = 'ip2g_*****';
$dbpass = '*****';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'ip2g_*****';
mysql_select_db($dbname) or die('Could not connect to Database');
$i = 1;
for ($i=1;$i<=3;$i++)
{
$query = "SELECT * from Posts WHERE postID = '$i'";
$result = mysql_query($query,$conn) or die(mysql_error());
$row = mysql_fetch_assoc($result);
$postTitle = $row['postTitle'];
$postDate = $row['postDate'];
echo " <li class='menu'>
<a>
<form action='post.php' method='GET'>
<input type='hidden' name='postID' value='$postID' />
<span class='name'>" . $postTitle . "</span>
<span class='comment'>" . $postDate . "</span>
<span class='arrow'></span>
</form>
</a>
</li>";
}
?>
post.php
<?
$dbhost = 'localhost';
$dbuser = 'ip2g_*****';
$dbpass = '*****';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'ip2g_*****';
mysql_select_db($dbname) or die('Could not connect to Database');
$query = "SELECT * from Posts WHERE postID = \"{_GET['postID']}\"";
$result = mysql_query($query,$conn) or die(mysql_error());
$row = mysql_fetch_assoc($result);
$postPost = $row['postPost'];
$postDate = $row['postDate'];
$postTitle = $row['postTitle'];
echo "
<li class='menu'>
<a>
<span class='name'>" . $postTitle . "</span>
<span class='comment'>" . $postDate . "</span>
<span class='arrow'></span>
</a>
</li>";
?>
Right now, it's not supposed to print out the post, it's just supposed to print out the title and the date. But, once again, it won't print out anything. It obviously has something to do with the form and the query:
($query = "SELECT * from Posts WHERE postID = \"{_GET['postID']}\""
Once again, I be a nub, so help me