473,397 Members | 1,949 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,397 software developers and data experts.

Anyone See An Error?

Hi,

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!

Jimmy
Nov 24 '14 #1
6 3217
!NoItAll
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!

Jimmy
Nov 25 '14 #3
!NoItAll
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
  2. // CONNECT TO THE SERVER AND SELECT DATABASE
  3. $server = "<?php 
  4. $link = mysqli_connect('jimmybryantnet.ipagemysqli.com', 'jimmyb29', 'alfiep69'); 
  5. if (!$link) { 
  6.     die('Could not connect: ' . mysqli_error()); 
  7.  
  8. echo 'Connected successfully'; 
  9. mysqli_select_db(guestbook); 
  10. ?> ";
  11. $user = "jimmyb29";
  12. $password = "alfiep69";
  13. $dataBase = "guestbook";
  14.  
  15. $conx = mysqli_connect($server,$user,$password);
  16. $db_selected = mysqli_select_db($dataBase,$conx);
  17.  
  18. if($conx && $db_selected){
  19.     // IF CONNECTION IS ESTABLISHED
  20.     $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
  21.     $xml .= "<data>\n";
  22.  
  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']));
  28.  
  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";
  49.  
  50.     }    
  51.     if(isset($_POST['getMessage'])){
  52.             // GET LIST OF MESSAGES AND PUT THEM AS XML FILE
  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{
  67.     // IF CONNECTION == false OR DATABASE DOESN'T EXISTE
  68.     die (mysqli_error());
  69. }
  70. ?>
  71.  
Thanks again for your expertise,

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

Jimmyb
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

1
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...
2
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...
4
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...
5
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...
7
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...
40
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...
3
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. ---...
10
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...
2
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...
9
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
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.