Javascript + PHP $_GET URL with % gives me 406 Not Acceptable
Hello to everyone out there!
I am Akke, and I'm a newbie developer, I know some VB, OK PHP, and OK JavaScript and some AJAX.
I'm working on a project that requires me to send stuff through an AJAX $_GET request to a PHP page which then echoes a string which then is fed back to the form on the first page.
You have not to encode all the URL but only values (if necessary) with encodeURIComponent ...
SEe too PHP urldecode notes : The superglobals $_GET and $_REQUEST are already decoded. Using urldecode() on an element in $_GET or $_REQUEST could have unexpected and dangerous results.
<?php
header("Content-Type:text/html;charset=utf-8");
if (!empty($_GET)) {
foreach ($_GET as $k=>$v) echo "<br>$k => $v";
}
// Give effectively with this first adress
question => kassasumma
q => 500
kale => 10%
nro => 6
?>
Your error 406 as probably an other origin. See this page
Bookmarks