Beau
unread,Nov 3, 2009, 2:13:51 PM11/3/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to inputex
Hi, I'm having trouble with double quotes in the json string generated
by getValue(). My output json looks like this:
{"Keywords":{"Keywords":"("civil engineer" or "construction engineer")
and highway and
bridge","SearchPattern":"BOO","JobTitle":"","Company":"","School":"","JobCategories":
[""]},"Location":
{"City":"","State":"CA","ZipCode":"","Country":"US","SearchRadiusInMiles":"","RelocationFilter":""},"Preferences":
{"EmploymentType":"ALL","MinimumExperience":"RENS","MinimumTravelRequirement":"RTNS","MinimumDegree":"CE31","CompensationType":"SALR","MinimumSalary":"","MaximumSalary":"","CurrentlyEmployed":"","ManagementExperience
":"","MinimumEmployeesManaged":"","MaximumCommute":""},"Options":
{"FreshnessInDays":"60","ExcludeResumesWithNoSalary":"","WorkStatus":"CTNS","OrderBy":"-
MODIFIEDINT"}}
and I url encode this and pass it to a php page for some ajax
processing. Trouble is with the Keywords field (and potentially any
other text input field) where a user can use double quotes. In my
keywords field, the user is allowed to use quotes to specify phrases
they would like to search on.
So, this string works fine in the browser with JS, but when passed to
PHP, the json_decode() function craps out.
I read somewhere that proper json uses double quotes to delimit the
values, and my search script cannot use single quotes for phrases.
anyone have any ideas on how to get around this?
Thanks