Search Results

Search found 2 results on 1 pages for 'user1751581'.

Page 1/1 | 1 

  • Error while sending email to Multiple Addresses From MYSQL Database using PHP

    - by user1751581
    I am trying to send an email to multiple email addresses which are contained in a database and sorted into a recordset... The recordset has multiple columns, but I only need one: "Email". I know that if I have them in an array I can implode them and separate them by commas, but I'm not sure how I could do that with a recordset column. Anyone know how? BTW I know I have the mail function commented out... The echo is returning null... Heres the code that I tried: $colname_rsAllLeads = "-1"; if (isset($_SESSION['MM_Username'])) { $colname_rsAllLeads = $_SESSION['MM_Username']; } mysql_select_db($database_myBackOfficeConn, $myBackOfficeConn); $query_rsAllLeads = sprintf("SELECT Email FROM Leads WHERE `User` = %s ORDER BY FullName ASC", GetSQLValueString($colname_rsAllLeads, "text")); $rsAllLeads = mysql_query($query_rsAllLeads, $myBackOfficeConn) or die(mysql_error()); $row_rsAllLeads = mysql_fetch_assoc($rsAllLeads); $totalRows_rsAllLeads = mysql_num_rows($rsAllLeads); $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form")) { $startcode = $_POST['messagefield']; $replaced = preg_replace( '/\\\\(?="|\')/', '', $startcode ); echo $replaced; $collectedleads = implode(',', $row_rsAllLeads['Email']); echo $collectedleads; /* $to = $collectedleads; $subject = $_POST['subjectfield']; $body = $replaced; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: " . $row_rs_CurrentUser['FirstName'] . " " . $row_rs_CurrentUser['LastName'] . " <" . $row_rs_CurrentUser['Email'] . ">"; if (mail($to, $subject, $body, $headers)) { } else { echo("<p>Message delivery failed...</p>"); } */ $insertSQL = sprintf("INSERT INTO PendingEmails (`to`, subject, message) VALUES (%s, %s, %s)", GetSQLValueString($row_rsAllLeads['Email'], "text"), GetSQLValueString($_POST['subjectfield'], "text"), GetSQLValueString($_POST['messagefield'], "text")); mysql_select_db($database_myBackOfficeConn, $myBackOfficeConn); $Result1 = mysql_query($insertSQL, $myBackOfficeConn) or die(mysql_error()); $insertGoTo = "Email Sent.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } When I use var_dump($row_rsAllLeads['Email']) it outputs string(16) "[email protected]" but I know that there is no error in my SQL query because when I put them in a select box, they all show up...

    Read the article

  • How to manipulate string to delete quotes?

    - by user1751581
    I am trying to manipulate a string so that any quotes (") within <a href> and <\a> get taken out... Sorry if its been asked before but I just can't get it to work! By the way, I am POSTing the data from a form and then manipulating the string. This is basically html but its in the form of a string, and I want to take out quotes on things like images and links... Another thing is, I do not want to escape the quotes because that would break the link... And the whole point is that the html can be used and work fine... But now, something is automatically creating a second set of quotes inside the normal quotes, like this: <a href="\"http://www.example.com/\""></a> Example input would be: <p><a href="http://www.example.com">example</a></p> Heres how it appears when I echo it however: <p><a href=\"http://www.example.com\">example</a></p> Heres how I want it to look: <p><a href="http://www.example.com">example</a></p> So I would actually be trying to get rid of the (/) my bad...

    Read the article

1