ok, I'm trying to post this stuff in flash and I had no idea to do that, so I used the code from a tutorial on the net. It's worked well for everything so far, but it's giving me big problems now... When I open the page in the browser I now get no errors, but in the flash text box it's meant to display in I just get the text 'undefined'. Hope the code makes sense:
<?
include 'connect.php';
$numComments = 1000;
$action = $_GET['action'];
switch($action) {
case 'read' :
$sql = 'SELECT `title`, `time`, `post`, FROM `guestbook` WHERE `time` >= CURDATE();'
$allComments = mysql_query($sql, $DBConn) or die("Error in Show Addition: " . mysql_error());
$numallComments = mysql_num_rows($allComments);
$sql .= ' ORDER BY `time` ASC LIMIT ' . $_GET['NumLow'] . ', ' . $numComments;
$fewComments = mysql_query($sql, $DBConn) or die("Error in Show Addition: " . mysql_error());
$numfewComments = mysql_num_rows($fewComments);
print '&totalEntries=' . $numallComments . '&';
print "<br>&entries=";
if($numallComments == 0) {
print "No shows currently scheduled.";
} else {
while ($array = mysql_fetch_array($fewComments)) {
$title = mysql_result($fewComments, $i, 'title');
$time = mysql_result($fewComments, $i, 'time');
$post = mysql_result($fewComments, $i, 'post');
$title = strtoupper($title);
print '<u>' . $title . '</u><br>' . $post . '<br><font size="14" color = "#003366">' . $time . '</font><br><br>';
$i++;
}
}
if($_GET['NumLow'] > $numallComments) {
print 'No More Entries&';
}
break;
case 'write' :
$title = ereg_replace("&", "%26", $_POST['title']);
$post = ereg_replace("&", "%26", $_POST['post']);
$submit = $_POST['submit'];
$submitted_on = date ("Y/m/d H:i:s",time());
if($submit == 'Yes'){
$sql = 'INSERT INTO ' . $table .
' (`ID`,
`title`,
`post`,
`time`
)
VALUES
(\'\','
. '\'' . $title . '\','
. '\'' . $post . '\','
. '\'' . $submitted_on . '\'
)';
$insert = mysql_query($sql, $DBConn) or die("Error in News Posting: " . mysql_error());
print "&gb_status=Show posted.&done=yes&";
return;
}
print "&_root.write.gb_status=Show addition did not work. Please contact me!&";
break;
}
?>