| | |
PHP & 406 Not Acceptable
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2008
Posts: 1
Reputation:
Solved Threads: 0
Hello all ! ! !
I have a litle problem with a script that I have create.
This script selecting from the database all the records (in total 2) and then print out a XML file.
I have enter this code to change the header to XML :
header('Content-type: application/xml; charset="utf-8"');
and then i print out hte records of the MySQL query :
That's all my code and then I'm getting from the server the following headers :
http://xx.x.xxx.xx/~babis08/CPanel/xml/languages.php
What can i do for ? ? ?
thanks a lot
I have a litle problem with a script that I have create.
This script selecting from the database all the records (in total 2) and then print out a XML file.
I have enter this code to change the header to XML :
header('Content-type: application/xml; charset="utf-8"');
and then i print out hte records of the MySQL query :
php Syntax (Toggle Plain Text)
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; echo "<languages>"; while($rows = @mysql_fetch_array($resLNGS, MYSQL_ASSOC)) { echo "<lngs>"; if((isset($_POST['lngs_id']) && strlen($_POST['lngs_id'])>0) && ($_POST['lngs_id'] == $rows['ID'])) { echo "<id default=\"" . $rows['ID'] . "\">" . $rows['ID'] . "</id>"; } else { echo "<id>" . $rows['ID'] . "</id>"; } echo "<name>" . $rows['NAME'] . "</name>"; echo "</lngs>"; } echo "</languages>";
That's all my code and then I'm getting from the server the following headers :
http://xx.x.xxx.xx/~babis08/CPanel/xml/languages.php
PHP Syntax (Toggle Plain Text)
POST /~babis08/CPanel/xml/languages.php HTTP/1.1 Host: 62.1.216.81 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; el; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 FirePHP/0.2.1 Accept: application/xml, text/xml, */* Accept-Language: el Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-7,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive X-Requested-With: XMLHttpRequest Referer: <a rel="nofollow" class="t" href="http://xx.x.xxx.xx/~babis08/CPanel/prop" target="_blank">http://xx.x.xxx.xx/~babis08/CPanel/prop</a> ... insert.php Cookie: PHPSESSID=4181110c8e9c2f68d7f758030aa2bbe4 Pragma: no-cache Cache-Control: no-cache HTTP/1.x 406 Not Acceptable Date: Sat, 03 Jan 2009 08:22:17 GMT Server: Apache/2.2.10 (Unix) mod_ssl/2.2.10 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.4 Perl/v5.8.8 Content-Length: 599 Keep-Alive: timeout=5, max=63 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1
What can i do for ? ? ?
thanks a lot
Last edited by peter_budo; Jan 6th, 2009 at 1:55 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Other Threads in the PHP Forum
- Previous Thread: Hotmail Address Book import
- Next Thread: Learning PHP
| Thread Tools | Search this Thread |
ajax apache api array beginner binary body broken cakephp checkbox class cms code cookies cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert interactive ip javascript job joomla js limit link login mail mediawiki menu mlm mobile msqli_multi_query multiple mycodeisbad mysql navigation oop outofmemmory paging parse paypal pdf php problem procedure query radio ram random recursion regex remote script search server sessions sms source space sql stored subdomain syntax system table tutorial unicode update upload url validator variable video web webapplications websitecontactform xml youtube





