$Tags=$_REQUEST['Tags'];
$CategoryId=$_REQUEST['CategoryId'];
var_dump($Tags);
and my input is:
baseurl/project/controller/method?CategoryId=3&Tags=Other,testcase,Bar & restaurant,Dining
when i give input like that,i get error 'disallowed key values'.... I know that the error is because of Special character '&' in Bar & restaurant..... How do i pass Bar & restaurant without getting error
You should encode it, so & would be &
This can be done with the htmlspecialchars()
function, see the documentation here
You are not allowed to pass parameters through url with characters like ,
. You can encode the string you want to pass (Other,testcase,Bar ).
Try like :
$vars = urlencode(join(',', array(Other,testcase,Bar)));
Pass though url like
aseurl/project/controller/method?CategoryId=3&Tags=<?php echo $vars ?>
Process it in the resultant page
$vars = explode(',', urldecode($_GET['Tags']));
Certain characters cannot be used directly. Use urlencode()
http://php.net/urlencode This function is convenient when encoding a string to be used in a query part of a URL.