Hi,
I'm an old guy trying to create a guestbook. The xml code keeps throwing an error in the following: - <?xml version="1.0" encoding="utf-8" ?>
-
<configuration>
-
<img_back>img/back.jpg</img_back>
-
<phpURL>/home/users/web/b2713/jpg.jimmybryantnet</phpURL>
-
<alert_color>#FF0000</alert_color>
-
<name_color>#8d2405</name_color>
-
<message_color>#532b2b</message_color>
-
<datePosted_color>#307a03</datePosted_color>
-
<insert_ok><![CDATA[<font color='#0f5711'>Thanks for the message.</font>]]></insert_ok>
-
<insert_error><![CDATA[<font color='#ff0000'>Error adding Message</font>]]></insert_error>
-
</configuration>
It throws the error: "Error Adding Message", which I assume means that it got that far.
Any help appreciated!
Jimmy
6 3217
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.
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
I don't see any attachment...
I think the error is in the Guestbook.php module: - <?php
-
// CONNECT TO THE SERVER AND SELECT DATABASE
-
$server = "<?php
-
$link = mysqli_connect('jimmybryantnet.ipagemysqli.com', 'jimmyb29', 'alfiep69');
-
if (!$link) {
-
die('Could not connect: ' . mysqli_error());
-
-
echo 'Connected successfully';
-
mysqli_select_db(guestbook);
-
?> ";
-
$user = "jimmyb29";
-
$password = "alfiep69";
-
$dataBase = "guestbook";
-
-
$conx = mysqli_connect($server,$user,$password);
-
$db_selected = mysqli_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
-
$sqli="INSERT INTO guestbook(name,email,message,dateAdded)values('$name','$email','$message',now())";
-
$query = mysqli_query($sql,$conx);
-
if ($query){
-
$result= 1;
-
$sqli2 = "SELECT * FROM guestbook ORDER BY id DESC";
-
$query2 = mysqli_query($sql2,$conx);
-
//WHEN query == true , GET LIST OF MESSAGES AND PUT THEM AS XML FILE
-
while($data = mysqli_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 = mysqli_query($sqli,$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 (mysqli_error());
-
}
-
?>
-
Thanks again for your expertise,
jimmyb
OOPS! I used the wrong terminology - I didn't "attach" the files, I "included" the files in my reply. SORRY!
Jimmyb
Sorry about the
error - I'm NOT a coder, as you can probably imagine.
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: 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: 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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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,...
|
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: 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...
|
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,...
| |