Search the Community
Showing results for tags 'wont load'.
-
Hi! I'm an 85 year old newbie, trying to implement a "store bought" Guestbook. I seem to be having a problem with the module that connects the DB to the .flv (I think!) I've checked it with several online checkers and they don't report any errors/ Would someone be so kind as to look at the code and see id you can find the errors? THANKS! <?php // CONNECT TO THE SERVER AND SELECT DATABASE $server = "ftp.ipage.com"; $user = "jimmybryantnet"; $password = "********"; $dataBase = "guestbook"; $conx = mysql_connect($server,$user,$password); $db_selected = mysql_select_db($dataBase,$conx); if($conx && $db_selected){ // IF CONNECTION IS ESTABLISHED $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; $xml .= "<data>\n"; if(isset($_POST['name'])){ $result = 0; $name=mysql_escape_string(trim($_POST['name'])); $email=mysql_escape_string(trim($_POST['email'])); $message=mysql_escape_string(trim($_POST['message'])); // ADD DATA TO THE TABLE guestbook WHEN THE USER PRESS THE send_btn in FLASH $sql="INSERT INTO guestbook(name,email,message,dateAdded)values('$name','$email','$message',now())"; $query = mysql_query($sql,$conx); if ($query){ $result= 1; $sql2 = "SELECT * FROM guestbook ORDER BY id DESC"; $query2 = mysql_query($sql2,$conx); //WHEN query == true , GET LIST OF MESSAGES AND PUT THEM AS XML FILE while($data = mysql_fetch_array($query2)){ $xml .= "<guest>\n"; $xml .= "<name>".$data['name']."</name>\n"; $xml .= "<msg><![CDATA[".$data['message']."]]></msg>\n"; $xml .= "<sdate>".$data['dateAdded']."</sdate>\n"; $xml .= "</guest>\n"; } } else{ $result=0; } $xml .= "<inserted>".$result."</inserted>\n"; } if(isset($_POST['getMessage'])){ // GET LIST OF MESSAGES AND PUT THEM AS XML FILE $sql = "SELECT * FROM guestbook ORDER BY id DESC"; $query = mysql_query($sql,$conx); while($data = mysql_fetch_array($query)){ $xml .= "<guest>\n"; $xml .= "<name>".$data['name']."</name>\n"; $xml .= "<msg><![CDATA[".$data['message']."]]></msg>\n"; $xml .= "<sdate>".$data['dateAdded']."</sdate>\n"; $xml .= "</guest>\n"; } } $xml .= "</data>\n"; echo $xml; } else{ // IF CONNECTION == false OR DATABASE DOESN'T EXISTE die (mysql_error()); } ?>