I am using a shoutbox made from a tutorial here
All is working well (the shoutbox posts, resets...), but it doesn't display the shouts.
It shows this:
_level0.shouts
undefined
undefined
undefined
undefined
And a few more lines like that.
You can find the ActionScript on that link on the 6th page.
The shout.php source:
<?php
header("Content-type: text/xml");
$host = "localhost";
$user = "root";
$pass = "";
$database = "techgeeks";
$linkID = mysql_connect($host,$user,$pass) or die ("Could not connect to host.");
mysql_select_db($database,$linkID) or die ("Could not find database.");
$query = "SELECT * from shoutbox ORDER BY id DESC";
$resultID = mysql_query($query,$linkID) or die ("Data not found");
$xml_output = "<?xml version =\"1.0\"?>\n";
$xml_output = "<shouts>\n";
for ($x = 0; $x < mysql_num_rows($resultID); $x++){
$row = mysql_fetch_assoc($resultID);
$xml_output .= "\t<shout>\n";
$xml_output .= "\t\t<name>" . $row['name'] . "</name>\n";
$xml_output .= "\t\t<message>" . $row['message'] . "</message>\n";
$xml_output .= "\t</shout>\n";
}
$xml_output.= "</shouts>";
echo $xml_output;
?>
The post.php source
<?
mysql_connect("localhost","root","");
mysql_select_db("techgeeks");
$submit = $_POST['submit'];
$name = $_POST['name'];
$message = $_POST['message'];
if(isset($_POST['submit'])){
$result=MYSQL_QUERY("INSERT INTO shoutbox (id,name,message)"."VALUES ('NULL','$name','$message'");
echo '<script>alert("Shout posted");</script>';
} else {
}
?>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="500" height="100">
<param name="movie" value="shoutbox.swf">
<param name=quality value=high>
<embed src="shoutbox.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="500" height="100"></embed>
</object>
I am confused. I can't think of any reason for the error... please help!
ActionScript is in the link below
http://www.pixel2life.com/publish/tutorial..._and_xml/page6/
Edited by Edmachine, 06 August 2007 - 01:14 PM.
