looping through a $_POST variable
- From: richardkurth@xxxxxxxxxxxxxx (Richard Kurth)
- Date: Sun, 30 Dec 2007 15:29:22 -0800
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 this below
$array = explode(' ', $_POST['emails']);
foreach ($array as $value) {
$sql = "SELECT id FROM contacts where emailaddress = '$value' AND members_id = '$memberid'";
$sql_result=safe_query($sql);
while ($row=mysql_fetch_array($sql_result)){
$id = $row["id"];
$sql1="UPDATE contacts SET emailstatus ='Unsubscribed' WHERE id = '$id'";
safe_query($sql1);
}}
.
- Follow-Ups:
- Re: [PHP] looping through a $_POST variable
- From: "Richard Lynch"
- Re: [PHP] looping through a $_POST variable
- Prev by Date: Re: [PHP] Question about sqli class
- Next by Date: Re: [PHP] looping through a $_POST variable
- Previous by thread: Mail system
- Next by thread: Re: [PHP] looping through a $_POST variable
- Index(es):
Relevant Pages
|