473,396 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Anyone See An Error?


I'm an old guy trying to create a guestbook. The xml code keeps throwing an error in the following:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8" ?> 
  2. <configuration>
  3.     <img_back>img/back.jpg</img_back>
  4.     <phpURL>/home/users/web/b2713/jpg.jimmybryantnet</phpURL>
  5.     <alert_color>#FF0000</alert_color>
  6.     <name_color>#8d2405</name_color>
  7.     <message_color>#532b2b</message_color>
  8.     <datePosted_color>#307a03</datePosted_color>
  9.     <insert_ok><![CDATA[<font color='#0f5711'>Thanks for the message.</font>]]></insert_ok>
  10.     <insert_error><![CDATA[<font color='#ff0000'>Error adding Message</font>]]></insert_error>
  11. </configuration>
It throws the error: "Error Adding Message", which I assume means that it got that far.

Any help appreciated!

Nov 24 '14 #1
6 3216
297 100+
The xml is fine. The error is being thrown by something other than the XML parser so we would need to see the rest of your code to determine what might be happening.
Nov 25 '14 #2
I attached all the files - there isn't a lot, but I'm sure you can see the problem. Thank you so much for replying!

Nov 25 '14 #3
297 100+
I don't see any attachment...
Nov 28 '14 #4
I think the error is in the Guestbook.php module:

Expand|Select|Wrap|Line Numbers
  1. <?php
  3. $server = "<?php 
  4. $link = mysqli_connect('jimmybryantnet.ipagemysqli.com', 'jimmyb29', 'alfiep69'); 
  5. if (!$link) { 
  6.     die('Could not connect: ' . mysqli_error()); 
  8. echo 'Connected successfully'; 
  9. mysqli_select_db(guestbook); 
  10. ?> ";
  11. $user = "jimmyb29";
  12. $password = "alfiep69";
  13. $dataBase = "guestbook";
  15. $conx = mysqli_connect($server,$user,$password);
  16. $db_selected = mysqli_select_db($dataBase,$conx);
  18. if($conx && $db_selected){
  20.     $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
  21.     $xml .= "<data>\n";
  23.     if(isset($_POST['name'])){
  24.         $result = 0;
  25.         $name=mysql_escape_string(trim($_POST['name']));
  26.         $email=mysql_escape_string(trim($_POST['email']));
  27.         $message=mysql_escape_string(trim($_POST['message']));
  29.         // ADD DATA TO THE TABLE guestbook WHEN THE USER PRESS THE send_btn in FLASH
  30.         $sqli="INSERT INTO guestbook(name,email,message,dateAdded)values('$name','$email','$message',now())";
  31.         $query = mysqli_query($sql,$conx);
  32.         if ($query){
  33.             $result= 1;
  34.             $sqli2 = "SELECT * FROM guestbook ORDER BY id DESC";
  35.             $query2 = mysqli_query($sql2,$conx);
  36.             //WHEN query == true , GET LIST OF MESSAGES  AND PUT THEM AS XML FILE
  37.             while($data = mysqli_fetch_array($query2)){
  38.                 $xml .= "<guest>\n";
  39.                 $xml .= "<name>".$data['name']."</name>\n";
  40.                 $xml .= "<msg><![CDATA[".$data['message']."]]></msg>\n";
  41.                 $xml .= "<sdate>".$data['dateAdded']."</sdate>\n";
  42.                 $xml .= "</guest>\n";
  43.                 }
  44.             }
  45.         else{
  46.             $result=0;
  47.             }
  48.         $xml .= "<inserted>".$result."</inserted>\n";
  50.     }    
  51.     if(isset($_POST['getMessage'])){
  53.             $sql = "SELECT * FROM guestbook ORDER BY id DESC";
  54.             $query = mysqli_query($sqli,$conx);
  55.             while($data = mysql_fetch_array($query))
  56.                 $xml .= "<guest>\n";
  57.                 $xml .= "<name>".$data['name']."</name>\n";
  58.                 $xml .= "<msg><![CDATA[".$data['message']."]]></msg>\n";
  59.                 $xml .= "<sdate>".$data['dateAdded']."</sdate>\n";
  60.                 $xml .= "</guest>\n";
  61.             }
  62.         }
  63.     $xml .= "</data>\n";
  64.     echo $xml;
  65. }
  66. else{
  68.     die (mysqli_error());
  69. }
  70. ?>
Thanks again for your expertise,

Nov 28 '14 #5
OOPS! I used the wrong terminology - I didn't "attach" the files, I "included" the files in my reply. SORRY!

Nov 28 '14 #6
Sorry about the
Expand|Select|Wrap|Line Numbers
error - I'm NOT a coder, as you can probably imagine.
Nov 28 '14 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Mr Mint | last post by:
Hi all, I have a page named register.php, which is a form for collecting user data. As an example: - I have the fields Name, Surname, email. - In the <form> tag I have action ="" - The page...
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
by: muser | last post by:
Can anyone run this program through their compiler or if they can see a logical error please point it out. I have my tutor working on it at the moment but I would rather a less ambigious response...
by: Bob Bamberg | last post by:
Hello All, I have been trying without luck to get some information on debugging the Runtime Error R6025 - Pure Virtual Function Call. I am working in C++ and have only one class that is derived...
by: Abdul-Wahid Paterson | last post by:
Hi, I have had a site working for the last 2 years and have had no problems until at the weekend I replace my database server with a newer one. The database migration went like a dream and I had...
by: Jeff | last post by:
I have a system on a network and want to determine if anyone is currently connected to the back-end files. An interesting twist is that I have noticed that some users can be connected (have the...
by: shifty shaker | last post by:
I've modified sql text and now i'm getting a syntax error that I cannot figure out....anyone? error occurs at the Insert Into line but the entire function is given in case you need it. ---...
by: Anthony England | last post by:
(sorry for the likely repost, but it is still not showing on my news server and after that much typing, I don't want to lose it) I am considering general error handling routines and have...
by: Jon | last post by:
Anyone seen a webservice return this error: Error: Client found response content type of 'text/html;charset=utf-8', but expected 'text/xml'. The request failed with the error message: --Error...
by: Debbie | last post by:
I wonder if anyone can help me out, or point me in the right direction, in solving my current problem: I have started seeing an error on one of my ASP pages. Id displays totally blank except...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.