61
Discussion / Visual HAM
« on: July 28, 2006, 07:19:59 am »
How can i make Visual HAM compile my project to a .gba because for some reason it won't
<?php
$db ='yourdb'
$host ='localhost';
$username ='yoursite_username';
$pass ='yourpass';
$dbh=mysql_connect ("$host", "$user", "$pass") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("$db");
?>
Now we're done with the first page, now time to build the ADMIN section.<html>
<head>
<title>Your Blog</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h3><a href="post.php" class="adminlink">Post a blog</a></h3><br />
<h3><a href="edit.php" class="adminlink">Edit a blog</a></h3><br />
<h3><a href="delete.php" class="adminlink">Delete a blog</a></h3><br />
</body>
</html>
<html>
<head>
<title>Post a Blog</title>
</head>
<body>
<form action="postpro.php" method="post">
Title: <input type="text" name="title"><br />
Username: <input type="text" name="user"><br />
Post: <text area style="width: 300px; height:200px" name="text"></textarea><br />
<input type="submit" value="Submit">
</form>
</body>
</html>
<?php
if ($_POST['title'] == '' || $_POST['text'] == '' || $_POST['user']) {
echo "You did not fill out the entire form";
die();
} else {
require("func.php");
$title = $_POST['title'];
$text = $_POST['text'];
$author = $_POST['user'];
$date = date("l, F d, Y");
mysql_query ("INSERT INTO `blog_entries` ( `id` , `date` , `author` , `title` , `entry` )
VALUES (
'', '$date', '$user', '$title', '$text'
);");
echo "Post successful!";
}
?>
<?php
require("func.php");
$qResult = mysql_query("SELECT * FROM blog_entries ORDER BY id DESC");
$counting = mysql_num_rows($qResult);
if ($counting == 0) {
echo "<H2>No blog posts.</H2>";
}
while($row = mysql_fetch_array($qResult)) {
$title = $row['title'];
$id = $row['id'];
echo "
$title [<a href='editpost.php?id=$id'>Edit</a>]
<BR>";
}
?>
draw_sprite(buttons,0,169,10);