Jump to content

Archived

This topic is now archived and is closed to further replies.

gavn8r

Parse data returned from form elements with the same name

Recommended Posts

I'm really new to PHP coming over from ASP, so please forgive the ignorance.  But...

I have a flash form that sends data to a php file.  The problem is that I can't modify the flash form because I don't have the .fla file anymore.  When I get the data, I first use this code (given to me graciously by a member of this forum):

//foreach ($_POST as $fld => $val) echo "$fld  = $val,<br>";

It returns, for example:
emailVariables = My Namemyemail@domain.com(555) 555-1212California

You can see that name, email, telephone number and state are all returned from a form element called emailVariables.  My problem is that I can't divide the data because there are no delimiters.  I'm wondering if there is a way to divide the data into separate variable names even though they all come from form elements with the same name?

Share this post


Link to post
Share on other sites
[quote]My problem is that I can't divide the data because there are no delimiters[/quote]

Which means there's no rational way to decipher where one variable ends and the next begins in the only and only string returned.  It's plausible that some creative coding code separate the state (since it's everything immediately after the numbers), and to separate the phone number out, and even separate out the domain but the nameemail username is inseparable, plus you're out of luck completely if someone submits with the phone number.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.