PHP Formmailer Office365

<?php require(„phpMailer/PHPMailerAutoload.php“); $mail = new PHPMailer(true); $mail->isSMTP(); $mail->Host = ’smtp.office365.com‘; $mail->Port       = 587; $mail->SMTPSecure = ‚tls‘; $mail->SMTPAuth   = true; $mail->Username = ‚eMAIl@OFFICE365.de‘; $mail->Password = ‚Office365PW‘; $mail->SetFrom(‚eMAIl@OFFICE365.de‘, ‚FromEmail‘); $mail->addAddress(‚mich@elis.info‘, ‚ToEmail‘); //$mail->SMTPDebug  = 3; //$mail->Debugoutput = function($str, $level) {echo „debug level $level; message: $str“;}; //$mail->Debugoutput = ‚echo‘; $mail->IsHTML(true); $mail->Subject = ‚Here is the […]

Sage2Mysql

Daten aus SAGE (khk) in MYSQL übertragen mittels ODBC.     <?php set_time_limit(0); $conn2 = mysql_connect(‚localhost‘,’ID‘,’PW‘); $db=mysql_select_db(‚data‘); function querykhk($query) { global $conn; if (!$conn) $conn = odbc_connect(‚KHK‘,’ID‘,’PW‘); $result=odbc_exec($conn, $query); if (!$result) echo „KHK Query Error $query („.odbc_errormsg().“)“; return $result; } function query($query) { global $conn2; $result=mysql_query($query); if (!$result) { echo „Mysql Error $query („.mysql_error().“)“; sleep(10); […]

PHP Connect auf DB2 ohne Node oder Database Directory

<pre><?php $conn_string = „DRIVER={IBM DB2 ODBC DRIVER – DB2COPY1};DATABASE=DB;HOSTNAME=SRV;PORT=50300;PROTOCOL=TCPIP;UID=User;PWD=PW;“; $connect = odbc_connect($conn_string, “, “); $query = „SELECT * from DWH.LIEFERANT“; // perform the query $result = odbc_exec($connect, $query); while($erg=odbc_fetch_array($result)) { print_r($erg); } ?>

HowTo: Accessing Sharepoint Foundationsserver with PHP / Zugriff auf Sharepoint Foundationsserver mit PHP

Ein einfaches Bespiel: <?php $authParams = array(„login“ => „DOMAINUSER“, „password“ => „PW“); $listName = „{LIST ID}“; $rowLimit = ‚150‘; $wsdl = „http://sharepoint-server/_vti_bin/Lists.asmx?WSDL“; $soapClient = new SoapClient($wsdl, $authParams); $params = array(‚listName‘ => $listName, ‚rowLimit‘ => $rowLimit); $rawXMLresponse = null; try{ $rawXMLresponse = $soapClient->GetListItems($params)->GetListItemsResult->any; } catch(SoapFault $fault){ echo ‚Fault code: ‚.$fault->faultcode; echo ‚Fault string: ‚.$fault->faultstring; die(); } […]

Howto: Script Autoimport Videofiles Mythtv

#!/usr/bin/php <? $db=mysql_connect(‚localhost‘,’root‘,’DBPW‘); mysql_select_db(‚mythconverg‘); echo mysql_errno() . „: “ . mysql_error(). „n“; $d = dir(„/home/video/“); while (false !== ($entry = $d->read())) { if  ( (substr(strtolower($entry),-4)==‘.avi‘) or (substr(strtolower($entry),-4)==‘.vob‘)  ) { echo $entry.“n“; $res=mysql_query(„select * from recorded where basename=’$entry’“); echo mysql_errno() . „: “ . mysql_error(). „n“; if (mysql_num_rows($res)==0) { echo „- not foundn“; mysql_query(“ INSERT INTO […]

HowTo: Mythtv Filename / Dateiname

Dateiname aus Aufzeichnungsname erstellen. #!/usr/bin/php <? function allow_text($email) { $text=$email; $chars = „ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-0123456789 „; // Erlaubte Zeichen $dummy = 0; $helper = „“; for ($i=0;$i<strlen($text);$i++) { for ($j=0;$j<strlen($chars);$j++) if ($text[$i]==$chars[$j]) $helper.=$text[                                                                                                 $i]; } return $helper; } $db=mysql_connect(‚localhost‘,’root‘,’DBPW‘); mysql_select_db(‚mythconverg‘); echo mysql_errno() . „: “ . mysql_error(). „n“; $res=mysql_query(„select *,date_format(starttime,’%d.%m.%Y %H:%i‘) as ‚dater‘ fr                                                                                                 om recorded where […]