php


How to display multi selection value in URL Query param?


I have created multi selection drop down in php page.Upon selecting one or more than one item in the lists will be passed to GET method to get values.
$user=$_GET['user'];
So the Query param in the page URL be like http:\\localhost\sample.php?users%5B%5D=nithya&users%5B%5D=nandha
Instead can I get like this http:\\localhost\sample.php?users=[nithya,nandha]? or any other readable way?
$users=array('Any','nithya','nandha','bala');
printf('<select multiple size="12" name="user[]">');
printf("<option value='Any'%s>Any</option>", in_array('Any', $users) ? ' selected' : '');
foreach ($users as $userName) {
printf("<option value='%s'%s>%s</option>", $userName, in_array($userName, $users) ? ' selected' : '', $userName);
}
}
printf("</select>");

Related Links

understanding the ternary operator in php
CSV with fputcsv() third parameter
PHP OOP Login system - member function getUsername() returns NULL
How to make a query to view a specific ID/ 1 line
Facebook access_token automatic renewal
Php, isset - default value, can it be simplified?
Converting MySQL PHP code / query to DB2 [closed]
how to export to excel file with multiple sheets wherein data is from database using mysqli
Downloading a file with Google Drive API with PHP
wamp rewrite_module not getting ticked
Yii: ID getting overwritten on load
Mysql select Timestamp compare
Rewrite my url to a dynamic one
Print numbers 1 to 10 group by 4
Update profile using php
Slim Application Error type- Twig_Error_Loader

Categories

HOME
paypal-ipn
bots
redmine
message-queue
mirc
impala
haxe
ag-grid
fasm
slide
colors
clish
vimeo
google-awareness
bundler
sql-injection
max-msp-jitter
dma
corona
android-contacts
scala-ide
spam
el
kaggle
conda
exchange-server-2010
jstree
raima
openbravo
region
intune
objectmapper
mapnik
windows2012
quick-nimble
plantuml
om-next
listjs
xmlunit
directfb
aurelia-cli
ng-repeat
iscroll
python-jira
slideshow
access-denied
minikube
common-table-expression
swift2.3
aws-kinesis-firehose
comm
karabiner
datediff
maven-jaxb2-plugin
portability
emacs25
yui3
streamwriter
system.web.optimization
svnserve
qtcpsocket
processor
gravatar
wepay
diawi
stack-smash
android-studio-import
search-form
physicsjs
fasterxml
cakephp-2.2
utf8-decode
global-scope
aho-corasick
rpg
network-printers
csslint
redpitaya
bittorrent-sync
oxygene
jms-serializer
lync-2010
autonumber
frontbase
san
unrealscript
disjoint-union
pacman
sunstudio
arrow
msinfo32
quartz-core
sigar
microblogging
infopath-2007
database-deadlocks
rtd
active-record-query
ninject-interception
android-input-method
bucket
jvm-bytecode

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App