![]() |
|
|
|
|
|
|
3
4th November 09:54
External User
Posts: 1
|
//see what you have.
//maybe it's not hat you think var_dump($_POST['emails']); //you should probably validate the emails using: http://php.net/imap_rfc822_parse_adrlist $value_sql = mysql_real_escape_string($value); Use '$value_sql' here. And I dunno where $memberid came from, but maybe it should be escaped as well. I'm not sure what "safe_query" is doing, and maybe you think it can escape the data you embedded into the SQL, but I don't see how you can do that... Sort of a Humpty-Dumpty problem... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? |
|
|
4
4th November 09:55
External User
Posts: 1
|
When I do a var_dump($_POST['emails']); it has all the emails in it
string(65) "rkurth@centurytel.net ckurth@centurytel.net tkurth@centurytel.net" 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_query is a function that I call that does query stuff function safe_query ($query = ""){ include ("dataconf.inc.php"); dbconnect($dbname,$rootusername,$rootpassword,$roo thostname); global $query_debug; if (empty($query)) { return FALSE; } if (!empty($query_debug)) { print "<pre>$query</pre>\n"; } $result = mysql_query($query) or die("Query Failed: " ."<li>errorno=".mysql_errno(). "<br>" ."<li>error=".mysql_error(). "<br><br>" ."<li>query=".$query ); return $result; } |
|
|
6
4th November 09:57
External User
Posts: 1
|
Okay.
Now var_dump($array) and see what it has. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? |
|
|
7
4th November 09:58
External User
Posts: 1
|
looks like that is my problem it is not separating the emails
string(67) "rkurth@centurytel.net ckurth@centurytel.net tkurth@centurytel.net" array(1) { [0]=> string(67) "rkurth@centurytel.net ckurth@centurytel.net tkurth@centurytel.net" } $array = explode(' ', $_POST['emails']); what should I use for spaces or next line to separate them |
|
|
8
4th November 09:58
External User
Posts: 1
|
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 are all possible inputs from the end users... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? |
|
|
|