Re: [PHP] looping through a $_POST variable

2007-12-30 Thread Mark Kelly
Hi. On Monday 31 December 2007 00:34, Richard Kurth wrote: > When I do a var_dump($_POST['emails']); it has all the emails in it > string(65) "[EMAIL PROTECTED] [EMAIL PROTECTED] > [EMAIL PROTECTED]" Then this simple regex should do you; just use it instead of explode: $AddressList = preg_split(

Re: [PHP] looping through a $_POST variable

2007-12-30 Thread Richard Lynch
You should use whatever is actually BETWEEN the emails, which could be anything... See the thread about Tedd's bazaar (sic) problem and use the technique there to see what you are actually getting. You may even need to resort to a split instead of explode if newlines, spaces, and carriage-returns

Re: [PHP] looping through a $_POST variable

2007-12-30 Thread Richard Kurth
looks like that is my problem it is not separating the emails string(67) "[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]" array(1) { [0]=> string(67) "[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]" } $array = explode(' ', $_POST['emails']); what should I use for spaces or next l

Re: [PHP] looping through a $_POST variable

2007-12-30 Thread Richard Lynch
Okay. Now var_dump($array) and see what it has. On Sun, December 30, 2007 6:34 pm, Richard Kurth wrote: > When I do a var_dump($_POST['emails']); it has all the emails in it > string(65) "[EMAIL PROTECTED] [EMAIL PROTECTED] > [EMAIL PROTECTED]" > I will validate the emails after I get the loop to

Re: [PHP] looping through a $_POST variable

2007-12-30 Thread dg
You might want to check the loop alone and check each value of $value: $array = explode(' ', $_POST['emails']); foreach($array as $value) { print "'$value'"; } if it works that way, at least you narrow down the possibilities of weirdness. On Dec 30, 2007, at 5:34 PM, Richard Kurth wr

Re: [PHP] looping through a $_POST variable

2007-12-30 Thread Richard Kurth
When I do a var_dump($_POST['emails']); it has all the emails in it string(65) "[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]" I will validate the emails after I get the loop to work $memberid comes from a part of the script I did not show you $memberid =$_POST["members_id"]; safe_que

Re: [PHP] looping through a $_POST variable

2007-12-30 Thread Richard Lynch
On Sun, December 30, 2007 5:29 pm, Richard Kurth wrote: > I am trying to loop through a $_POST variable. It comes from a text > area and it will have data like many email address or just one listed > with a space or on a new line. I can't seam to get the data to extract > properly. I have tried

Re: [PHP] looping through a $_POST variable

2007-12-30 Thread Richard Kurth
I am trying to get one email at a time and run it through the loop and process it but if I have more than one email in the text area it gives me nothing and does not run What kind of problems are you having in extracting the data? On Dec 30, 2007, at 4:29 PM, Richard Kurth wrote: I am trying t