Sorry.
I have these php codes working for a chatbox server and when I enter This code it comes up with this error:
[img]http://m1059.photobucket.com/albumview/albums/shivampaw/photo.jpg.html?src=www&action=view¤t=photo.jpg[img]
That error code for this php code :
<?php
header( 'Content-type: text/xml' );
mysql_connect( 'localhost:/tmp/mysql.sock', 'root', '' );
mysql_select_db( 'chat' );
if ( $_REQUEST['past'] ) {
****$result = mysql_query('SELECT * FROM chatitems WHERE id > '.
********mysql_real_escape_string( $_REQUEST['past'] ).
********' ORDER BY added LIMIT 50');
} else {
****$result = mysql_query('SELECT * FROM chatitems ORDER BY added LIMIT 50' );****
}
?>
<chat>
<?php
while ($row = mysql_fetch_assoc($result)) {
?>
<message>
****<user><?php echo( htmlentities( $row['user'] ) ) ?></user>
****<text><?php echo( htmlentities( $row['message'] ) ) ?></text>
</message>
<?php
}
mysql_free_result($result);
?>
</chat>
And this other code that comes up with this error
This page contains the following errors:
error on line 25 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
PHP Error Message Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /home/a9178577/public_html/Add.php on line 4 Free Web HostingPHP Error Message Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'a9178577'@'localhost' (using password: NO) in /home/a9178577/public_html/Add.php on line 5 Free Web HostingPHP Error Message Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/a9178577/public_html/Add.php on line 5 Free Web HostingPHP Error Message Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'a9178577'@'localhost' (using password: NO) in /home/a9178577/public_html/Add.php on line 7 Free Web HostingPHP Error Message Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/a9178577/public_html/Add.php on line 7 Free Web HostingPHP Error Message Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'a9178577'@'localhost' (using password: NO) in /home/a9178577/public_html/Add.php on line 9 Free Web HostingPHP Error Message Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/a9178577/public_html/Add.php on line 9 Free Web HostingPHP Error Message Warning: mysql_query() [function.mysql-query]: Access denied for user 'a9178577'@'localhost' (using password: NO) in /home/a9178577/public_html/Add.php on line 10 Free Web HostingPHP Error Message Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/a9178577/public_html/Add.php on line 10 Free Web Hosting
This is the code:
<?php
header( 'Content-type: text/xml' );
mysql_connect( 'localhost:/tmp/mysql.sock', 'root', '' );
mysql_select_db( 'chat' );
mysql_query( "INSERT INTO chatitems VALUES ( null, null, '".
****mysql_real_escape_string( $_REQUEST['user'] ).
****"', '".
****mysql_real_escape_string( $_REQUEST['message'] ).
****"')" );
?>
<success />