Jump to content

redbrad0

Members
  • Posts

    107
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

redbrad0's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. From our website we are connecting to GMAIL to send our emails through SMTP. For some reason it is not sending the emails to the CC or BCC email address event though GMAIL shows it was included in the email. Am I missing something in the below code? $currentTime = time(); $emailTo = "redbrad0@domain.com"; $emailCC = "brad@domain.com"; $emailBCC = "events@domain.com"; $emailSubject = "TEST Email at (" . $currentTime . ")"; $emailBody = "This is the body of the email"; $headers = array(); if (!empty($emailTo)) $headers['TO'] = $emailTo; if (!empty($emailCC)) $headers['CC'] = $emailCC; if (!empty($emailBCC)) $headers['BCC'] = $emailBCC; if (!empty($emailSubject)) $headers['Subject'] = $emailSubject; $headers['From'] = "events@domain.com"; $mime = new Mail_mime("\n"); $mime->setTXTBody($emailBody); $body = $mime->get(); $headers = $mime->headers($headers); $mail = Mail::factory('smtp', array ('host' => 'ssl://smtp.gmail.com', 'auth' => true, 'port' => 465, 'username' => 'events@domain.com', 'password' => 'thepasswordhere')); try { $result = $mail->send($emailTo, $headers, $emailBody); } catch (TixException $ex) { echo "<font color=red>Error:" . $ex->getCode() . "</font><br>"; } echo "Emailed at (" . $currentTime . ")<br>"; die; [attachment deleted by admin]
  2. Thanks everyone for all the details and examples.
  3. Since eregi_replace is deprecated I am trying to convert it to a new regexp replace but cant seem to get it. I thought you could just replace eregi_replace with preg_replace but that is not working. Can someone help me with converting this as I cant seem to figure it out. $text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '<a href="' . $linkprefix . '\\1">\\1</a>', $text); $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '\\1<a href="' . $linkprefix . 'http://\\2">\\2</a>', $text); $text = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})', '<a href="mailto:\\1">\\1</a>', $text);
  4. In my code I call PEAR::isError to see if there was an error in the SQL Query so I can log it but its always returning this error. Does anyone know a fix? I have tried to search google it and found http://pear.php.net/bugs/bug.php?id=9950 but it does not say how to fix it. Does anyone have any ideas? Error Non-static method PEAR::isError() should not be called statically $query = "SELECT Column FROM TableName"; $res = $db['database']->query($query); if (PEAR::isError($res)) { $logger->err("Error pulling results from DB. Query:" . $query); }
  5. Can someone help me convert this into a PHP 5 valid code? It looks like I would use stristr but looking at php.net it seems like there is something else I should change. if (eregi("^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$", $parts[1], $regs)) {
  6. Sorry if I didn't hit on the point exactly, but what I'm worried about is the people that manage the servers and the programers that are working on the site. Let's just say I wrote software for a application that I am selling online. They need full access to the source code to be able to make modifications but I wouldn't want them to be able to put the code on a warez site or anything else allowing people to download it without paying. Does this help?
  7. I've been developing a php application that runs my entire company for the last 4 years. One of the things I never thought of until now is that the server guys or anyone else could copy the source code and db and be able to start up another company which brings up my question to you.... How would you protect your application? My thought is to create one small php file that is encrypted with something that is required to make the entire site run (not sure at this point what it would be that they couldn't just rebuild). Then if this file sees it's on a different domain/ip it requests data from my site which logs the info for me to look at. If I find out it's something not approved, it would then not allow the program to run and will give a error. What is your idea?
  8. I am working on taking out the Deprecated functions from my site so while replacing ereg with preg_match I get the below error. Per a message I found on the internet it says to replace ereg with preg_match and everything should work. Can anyone assist me with fixing this error? Error: Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash Part where error is contained if (preg_match('enum.(.*).', $row['Type'], $match)) { $opts = explode(',', $match[1]); foreach ($opts as $item) $finalResult[] = substr($item, 1, strlen($item)-2); } Full Function function getEnumOptions($table, $field) { global $db; $finalResult = array(); if (strlen(trim($table)) < 1) return false; $query = "show columns from " . $db['tickets_slave']->escapeSimple($table); $res =& $db['tickets']->query($query); if (PEAR::isError($res)) { throw new TixException($_SERVER['SCRIPT_NAME'] . ":", TixExceptionCodes::UNKNOWN_ERROR); } else { try { while ($res->fetchInto($row)) { if ($field != $row["Field"]) { } else { //check if enum type if (preg_match('enum.(.*).', $row['Type'], $match)) { $opts = explode(',', $match[1]); foreach ($opts as $item) $finalResult[] = substr($item, 1, strlen($item)-2); } } } } catch (TixException $ex) { throw new TixException($_SERVER['SCRIPT_NAME'] . ":", TixExceptionCodes::UNKNOWN_ERROR); } } return $finalResult; }
  9. On our website, our employees have a custom program that is installed on all the systems that gets associated with a file extension. Then on our website, we have a javascript that sends the file to print which is automatically downloaded and then the file is handled and processed by our local installed application. The problem is that we are having to enable automatic file downloads which opens a security risk. Is there another way that we can handle this so we dont have to adjust their security zone settings? <SCRIPT> setTimeout('location.href="pop_print.php?order=189063"', 1); </SCRIPT>
  10. I just purchased a program that connects via ODBC to any database. The problem is that I don't want to specify the database connection information, so I am hoping I can create a web page with XML feed (or something like that) that the odbc can read and return the data. Is there something like this out there or is it even a possibility?
  11. This seems like a stupid question but I cant seem to figure it out. What I am trying to do is generate an array that looks like the below sample but have all the Member ID's group so I know the card each member grabbed. Array ( [889557275612] => Array ( [0] => Array ( [Cards_ID] => 51 [Cards_MemberID] => 889557275612 [Cards_Card] => 308292114653 [Cards_DateTime] => 1969-12-31 18:00:00 ) [1] => Array ( [Cards_ID] => 51 [Cards_MemberID] => 889557275612 [Cards_Card] => 308292114653 [Cards_DateTime] => 1969-12-31 18:00:00 ) ) [971131027757] => Array ( [0] => Array ( [Cards_ID] => 51 [Cards_MemberID] => 971131027757 [Cards_Card] => 308292114653 [Cards_DateTime] => 1969-12-31 18:00:00 ) ) ) $query = "SELECT * FROM Cards"; $res =& $db['tickets']->query($query); if (PEAR::isError($res)) throw new TixException($_SERVER['SCRIPT_NAME'] . ":", TixExceptionCodes::UNKNOWN_ERROR); $cardsGrouped = array(); while ($res->fetchInto($row)) { array_push($cardsGrouped[$row['Card_MemberID']], $row); }
  12. I have a sample PHP script where I am posting data to UPS using curl, and then getting the data returned. The problem I am having is when I get curl_exec to pull the data and store it in a variable, it is actually printing it out on the web page. Does someone see a problem with this script on why its pulling the data and printing it instead of storing in the $result variable? $xmlRequest = "<?xml version=\"1.0\"?>\n". "<AccessRequest>\n". " <AccessLicenseNumber>" . $LicenseNumber . "</AccessLicenseNumber>\n". " <UserId>" . $Username . "</UserId>\n". " <Password>" . $Password . "</Password>\n". "</AccessRequest>\n". "<?xml version=\"1.0\"?>\n". "<AddressValidationRequest xml:lang=\"en-US\">\n". " <Request>\n". " <TransactionReference>\n". " <CustomerContext>MarketingWebForce.com</CustomerContext>\n". " <XpciVersion>1.0001</XpciVersion>\n". " </TransactionReference>\n". " <RequestAction>AV</RequestAction>\n". " </Request>\n". " <Address>\n"; $xmlRequest .= " <City>Oklahoma City</City>\n"; $xmlRequest .= " <StateProvinceCode>OK</StateProvinceCode>\n"; $xmlRequest .= " <PostalCode>73142</PostalCode>\n"; $xmlRequest .= " </Address>\n". "</AddressValidationRequest>"; //set POST variables $url = 'https://wwwcie.ups.com/ups.app/xml/AV'; //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,'1'); curl_setopt($ch,CURLOPT_POSTFIELDS,$xmlRequest); [color=red]//execute post echo "<hr>PULLING DATA<br>"; $result = curl_exec($ch); echo "<hr>DATA PULLED<br>";[/color] //close connection curl_close($ch); echo "<hr>PRINTING DATA<br>"; print_r($result); echo "<hr>DATA PRINTED<br>";
  13. We have a custom software that some of our clients use that we wrote. When these users are in out backend website i want the website to know if they have the program installed on the computer they are logged in on. I know javascript can't access to see if a program is installed but wondering if there was something else that could be used. Even if I have to get our printing software written in a different language (its in C# .net) I need to find a way. Our clients use all sort of browsers so it would need to work on the main browsers.
×
×
  • 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.