Jump to content

dbair

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male

dbair's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am able to connect to my AD server successfully. This server serves multiple domains. Example is user1@dom1.dom.net is able to successfully bind. user2@dom2.com is not able to bind but gets error 49: invalid credentials. Using windows ldp.exe, I can connect successfully, then select bind from the connection menu, enter the username (user2), the account password, and the Domain (dom2.com) and the result indicated is successful. Using php I attempt to bind using: $adBind = ldap_bind($ad, $adUname, $ldappass); Where $ad = successful connection resource, $adUname = user1@dom1.dom.com OR user2@dom2.com, $ldappass is the account password. As user1 it is successful, with user2 it is unable to bind with error 49. Any suggestions or help is greatly appreciated. Thanks in advance!
  2. I have searched the forums and still have not found an answer. Problem: When sending an html formatted email created using php mail and mime 1) the receiving client (Outlook) shows the text only version by default, 2) the html version is an attachment to the text version and does not show all images. <?php require_once('Mail.php'); require_once('Mail/mime.php'); // use \r\n if using smtp and \n if using mail as factory type. $eMsg = new Mail_mime("\n"); // posted values $uID = $_POST['uID']; list($fname, $eAdd) = split("\|", $myUserEmail[$uID], 2); $to = $eAdd . ", someone@somewhere.com"; $eSubj = ms($_POST['eSubj']); $eAttach = $_POST['eAttach']; // dir/name to attachment $eAttType = $_POST['eAttType']; // mime type of attachment $eImg = $_POST['eImg']; // dir/name of embedded image $imgTp = $_POST['imgTp']; // mime type of embedded image $imgPos = $_POST['imgPos']; // bfr or aftr $eBody = $_POST['eBody']; // if attachment is included, add it to the email if ($eAttach) { $retVal = $eMsg->addAttachment($eAttach, $eAttType, $eAttach, true, 'base64', 'attachment'); if (PEAR::isError($retVal)) { $myMsg = $tst_uname . "|$_SERVER[sCRIPT_NAME] addAttachment failed with error:|" . $retVal->getMessage() . "|" . $create_date . "\n"; logIt($myMsg); print "<script type='text/javascript'>alert('Failed to add attachment to email! Email NOT sent! ');window.location='tst.php';</script>\n"; exit; } } // text only email $emailTxt = "$fname,\n\n" . str_replace("<br />", "\n", $eBody) . "\n\n$txtSig\n"; // html email $logo = file_get_contents("images/emailLogo.jpg"); // $logo = "images/emailLogo.jpg"; $param = array('html_encoding' => 'base64'); $eMsg->get($param); $html = "<html><head><meta http-equiv='Content-Language' content='en' />\n<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />\n<title>$eSubj</title></head>\n<body bgcolor='#FFFFFF' text='#000000' link='#FF9966' vlink='#FF9966' alink='#FFCC99'>\n"; $html .= "<center><a href='http://yoruSite.net/'><img src='images/emailLogo.jpg' /></a></center>\n"; $html .= "<br />$fname,\n"; if ($eImg && $imgPos == "bfr") { $html .= "<br /><img src='$eImg' align='center' />\n"; $html .= "<br />$eBody\n"; } elseif ($eImg && $imgPos == "aftr") { $html .= "<br />$eBody\n"; $html .= "<br /><img src='$eImg' align='center' />\n"; } else { $html .= "<br />$eBody\n"; } $html .= "<br><br>$signature\n"; $html .= "</body></html>\n"; $eMsg->setTXTBody($emailTxt); $eMsg->setHTMLBody($html); $eMsg->addHTMLImage($logo, 'image/jpg', 'images/emailLogo.jpg', false); $eMsg->addHTMLImage($eImg, $imgTp, $eImg, true); $body = $eMsg->get(); $headers = array('To' => $eAdd, 'From' => 'me@you.com', 'Subject' => $eSubj, 'Reply-To' => 'me@you.com', 'Subject' => $eSubj); $hdrs = $eMsg->headers($headers, true); $addlParms = "-r me@you.com"; $mail =& Mail::factory('mail'); $retVal = $mail->send($to, $hdrs, $body, $addlParms); if (PEAR::isError($retVal)) { $myMsg = $tst_uname . "|$_SERVER[sCRIPT_NAME] sending email failed with error:|" . $retVal->getMessage() . "|" . $create_date . "\n"; logIt($myMsg); print "<script type='text/javascript'>alert('Failed to send the email! Email NOT sent!');window.location='tst.php';</script>\n"; exit; } print "<script type='text/javascript'>alert('email sent');window.location='tst.php';</script>\n"; exit; ?> Any help is greatly appreciated! David
  3. figuted it out. I used this to get September to work corectly where date("Y-m") = 2007-07: $twoMnth = date("Y-m", mktime(0, 0, 0, date("m")+3, 0, date("Y")));
  4. No because date('m') returns 7 and +2 should be 9 but is 10.
  5. Any idea why dates go from august to october missing september? where current month = July (07) $curYM = date("Y-m"); // 2007-07 $nextMnth = date("Y-m", strtotime("+1 months")); // 2007-08 Both of the two below give back 2007-10 $twoMnth = date("Y-m", mktime(0,0,0,date('m')+2)); // 2007-10 - should be 2007-09 $twoMnth = date("Y-m", strtotime("+2 months")); // 2007-10 - should be 2007-09 Thanks in advance! David
  6. k...try this: do not use the sprintf stuff. single quote $customer, double quote entire select statement. $query = "SELECT * FROM invoiceid WHERE customerid='$customer'"; remove this line: $query= mysql_real_escape_string($query); $cResult = mysql_query($query) or die ("<p>Cannot select from invoiceid: query = " . $query . " mysql_error = " . mysql_error() . "</p>); This will give you more of an error message. copy, paste and post the results please.
  7. make sure the user (ppl) has permissions set in the mysql.users table.
  8. k...try this: $query= "SELECT * FROM invoiceid WHERE customerid=$customer"; remove this line: $query= mysql_real_escape_string($query); $cResult= mysql_query($query);
  9. change your query to be something like: $query= "SELECT * FROM invoiceid WHERE customerid=$customer";
  10. I am trying to figure out how to generate a listing of dates using the following known values: begDate = 2007-07-03 endDate = 2007-08-30 recurDates = Tue|Thu Question is how do I generate the YYYY-MM-DD for each of the dates between begDate and endDate for each of the recurDates? Thanks in advance!
×
×
  • Create New...

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.