southbeach
Programmer
Hello!
I have written or in process of writing a a javascript which
a) scans through any form
b) identifies each field
c) based on field type, extracts its name and value
d) names & values are paired into a variable
e) built variable is returned as a variable string
So, given (a) through (e), I can end up with a string that looks like
name::James Smith~phone:
555) 555-1212~Status::Member~Income::20000~
I need to pass this string to PHP, using AJAX, and then have PHP parse it, explode it or do whatever it needs to do to pair the names with their respective values in a form of an array.
I could create the string in javascript in any format if it helps PHP end of things ... I even though of using something like
[name=>James Smith,phone>=(555) 555-1212,Status=>Member,Income=>20000]
but when I passed this format to PHP, PHP saw it as a "single" string and doing
did not yield an array with multiple keys ...
Where am I going wrong?
Your assistance, as always, is greatly appreciated.
Regards,
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
I have written or in process of writing a a javascript which
a) scans through any form
b) identifies each field
c) based on field type, extracts its name and value
d) names & values are paired into a variable
e) built variable is returned as a variable string
So, given (a) through (e), I can end up with a string that looks like
name::James Smith~phone:
I need to pass this string to PHP, using AJAX, and then have PHP parse it, explode it or do whatever it needs to do to pair the names with their respective values in a form of an array.
I could create the string in javascript in any format if it helps PHP end of things ... I even though of using something like
[name=>James Smith,phone>=(555) 555-1212,Status=>Member,Income=>20000]
but when I passed this format to PHP, PHP saw it as a "single" string and doing
Code:
$array = array($above-built-string);
did not yield an array with multiple keys ...
Where am I going wrong?
Your assistance, as always, is greatly appreciated.
Regards,
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.