Jump to content

myrddinwylt

Members
  • Posts

    84
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.microvb.com

Profile Information

  • Gender
    Not Telling

myrddinwylt's Achievements

Member

Member (2/5)

0

Reputation

  1. Had to modify inside TCPDF libraries as well for some strange reason. After doing that, this magically began working o.0
  2. The following code returns this error: <?php require_once './includes/tcpdf/config/lang/eng.php'; require_once './includes/tcpdf/tcpdf.php'; require_once './includes/tcpdf_invoice_lib.php'; class invoices { private $numbers = array(); private $pdf = null; private $billaddr = null; private $customers = array(); private $customers_currentid = null; public $cdr = array(); private $invoiceid = null; private $invoicedate = array(); private $invoiceperiod = array(); private $clients = array(); private $batch = array(); private $mysql = array(); private $conn = null; private $invoice_output_path = "securefiles"; function __construct($mysql,$files) { $this->mysql = $mysql; $this->files = $files; $date = date('mdy'); // $date = '2009-10-01'; $this->batch = array('lastmonthpayments'=>date('Y-m',strtotime ( '-2 month' , strtotime ( $date ) )) . '-01', 'lastmonth'=>date('Y-m',strtotime ( '-1 month' , strtotime ( $date ) )), 'lastmonthstart'=>date('Y-m',strtotime ( '-1 month' , strtotime ( $date ) )) . '-01', 'lastmonthend' => date('Y-m-j',strtotime('-1 day', strtotime(date('Y-m',strtotime ( $date )) . '-01'))),'thismonth'=>date('Y-m',strtotime($date)) . '-01','thismonthlate'=>date('Y-m',strtotime($date)) . '-20'); $this->invoiceperiod = array($this->batch['lastmonthstart'],$this->batch['lastmonthend']); $this->connect(); } function newInvoice() { if(isset($this->pdf)) { unset($this->pdf); } if(isset($this->cdr)) { unset($this->cdr); } $this->pdf = new Invoice(); $this->cdr = null; } ?> Since setting $this->pdf to NULL doesn't free it's used memory space, and "unset()" is returning an error..... ummm.... what the hell am i supposed to do XD. This is driving me insane. TCPDF has a huge memory leak, but I really don't have a choice in using it, so I need to implement some garbage cleanup freeing it's memory space prior to moving on to the next record. Any suggestions that will work ? Thanks.
  3. Personally I use "DOUBLE" as the field data type which allows for negative numbers as well as positive, and the field length, i set 20, for decimals, i set between 2 and 8 (depending on the precision of the application).
  4. Just use PHP Mailer, and authenticate with your mail server before sending messages. This would eliminate the erronious e-mail account from showing up. Yes, it's more complicated to use PHP Mailer, but it's more accurate, and ensures that every message sent from you is coming from you. I can not believe how many programs are created with this design flaw, and I really wish PHP would either toss the command or update it to allow for: Authentication POP before SMTP SSL / TLS In script configuration CC/BCC/etc HTML/Plain combination body text MIME IMAP Support Rather than monkeying about with headers, and still don't have several of the above features, such as POP before SMTP, or SSL/TLS. Just wish that developers would stop being so lazy with this area if they wish to distribute/sell the application. (not saying thats what you are doing here, but since I have signed up, you are around the 12th person who is using mail() ..... i know it's easier, but it really does create a lot of headaches -- aka... your host e-mail account showing up as originator e-mail in the header, automatically ending up in anyones spam box who uses a server that checks if your account was authenticated with your server frst -- direct mail is 99% of the time spam). Hope this helps you anyway.
  5. <?php function getTimeDiff($time1, $time2) { if($time2 > $time1) $diff = abs($time2 - $time1); } else { $diff = abs($time1 - $time2); } return CEIL($diff / 60); } ?> This should sum it up for you.
  6. If you are looking to simply generate links to PDF's for viewing/etc in the browser, the simplest way IMO: http://docs.google.com/viewer?url= So for example, if you wish to view http://www.statcan.gc.ca/pub/89-599-m/89-599-m2006003-eng.pdf , you would use the following http://docs.google.com/viewer?url=http://www.statcan.gc.ca/pub/89-599-m/89-599-m2006003-eng.pdf The only condition is the file has to be accessible online somewhere.
  7. First MrAdam, What exactly is your point of providing a link to the following information ? It doesn't state that it can not be used to point inside of an IF statement, only can not be pointed inside another loop or file. Second, I wasn't asking for you to define how a GOTO statement would solve a problem. It does resolve a problem by making the code simpler, and more controllable without the use of extending IF statements to encompass the entire body or other similar logic. And NO, PHP does not have the same power of other languages when it comes to use of the GOTO command. For example, in Visual Basic, you CAN use it to go inside another loop (which isn't what was being done here, but whatever). Controlling output buffer is not really my concern. As stated in the original post, this code runs invisible, and does not output ANYTHING until an echo or print statement is made. Notice there is no where any data is to be output inside that block of code until the loop has finished. PHP had no reason to leave that loop, until it's execution was completed, unless you are implying that PHP executes code in a random order, which would pretty much break every language rule out there. The inherant and undocumented flaw in PHP as proven above, is as follows. Breaking out of a foreach Loop using goto to enter into an else portion of an if statement causes PHP to continue execution past two closing }, regardless that the second } is the looping/closing brace for an outer loop. So my not-smart allegation is more than just an "allegation". It is a fact. PHP's GOTO command is not quite as smart as other languages which support GOTO. As for the Wikipedia entry on how GOTO is fail in Fortran, I couldn't give a flying --- . It is still something used and does provide more control over your code without slopping it over using 300 closing braces for a simple IF check. As for further evidence of it's importance, it's inclusion in even the latest version of PHP (albeit limited, but at least they are trying and it does work -- mostly). Perhaps this was a statement you missed in that Wiki entry, , which should help to clarify it's purpose in development --- YOU get to take control of the code, instead of leaving it to the whim of the pairing elseif or else statements, which in large blocks of code tend to get shoveled several hundred lines down... or more. In any case, thank you for your response, even though it was an attempt to insult my work/intelligence/coding techniques. Wow, I don't think you realise how not-smart you just sounded with that allegation. I'm not going to go into what's wrong with GOTO statements, or try to understand how a GOTO statement would solve your problem?? But just to add insult to injury, check out the PHP GOTO statement, available as of PHP5.3. To answer your original question; during long and/or memory intense loads like in your situation, PHP attempts to periodically output whatever is in the buffer. This is normally a positive thing in most situations as it free's up memory and resources. If you want to stop that you need to take control of the output buffer yourself.
  8. Sounds like a job for RegEx. $code = "your html here"; $regex = "~a[^href]*href=\"([^\\"]*)\"~"; preg_match_all('~Select Row</LABEL>.*?>(.*?)</TR>~', $code, $out); foreach($out[1] as $matchedrow) { echo $matchedrow; }
  9. if($time2 > $time1) $diff = $time2 - $time1; } else { $diff = $time1 - $time2; }
  10. Well.. resolved this one again on my own. Turns out that PHP isn't quite as smart as other languages which support "GOTO". case 'merge_cdr': include("includes/ftp.class.php"); include("includes/cdr.class.php"); include("includes/http.class.php"); include("includes/txt2sql.class.php"); include("includes/mysql.class.php"); $startdate = strtotime($download["startdate"]); $month = date("m",$startdate); $day = date("d",$startdate); $year = date("Y",$startdate); $daterange["start"] = mktime(0, 0, 0, $month ,$day,$year); $daterange["end"] = mktime(0,0,0,date("m"),date("d")-2,$year); $daysdownloaded = null; foreach($cdrformats as $cdrformat) { $cdr = new cdr(); $cdr->dateposition = $cdrformat["date"]; switch($cdrformat["type"]) { case "ftp": $ftp = new ftp(); $ftp->connect($cdrformat["server"],$cdrformat["username"],$cdrformat["password"],1); $ftp->nlist($cdrformat["path"]); $cfiles = $ftp->files($cdrformat["filter"]); if($cdrformat["path"] != null && $cdrformat["path"] !="") { $ftp->chdir($cdrformat["path"]); } foreach($cfiles as $file) { $fdate = $cdr->filedate($file,$cdrformat["dateoffset"]); if ($fdate >= $daterange["start"] && $fdate <= $daterange["end"]) { if(file_exists($download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]) || file_exists("sql\\" . date("Y-m",$fdate) . "\\" . date("Y-m-d",$fdate) . ".sql")) { if($download['overwrite'] != 0) { set_time_limit(500); @unlink($download["path"] . $file); $ftp->get($file, $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]); $downloads[$cdrformat["name"]][] = $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]; $daysdownloaded[] = date("Y-m-d",$fdate); // echo date("Y-m-d",$fdate) . " - " . $file . "<br>"; } } else { set_time_limit(500); $ftp->get($file, $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]); $downloads[$cdrformat["name"]][] = $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]; $daysdownloaded[] = date("Y-m-d",$fdate); } } } $ftp->disconnect(); $ftp = null; break; case "http" || "https": $http = new http($cdrformat['server'],$cdrformat['username'],$cdrformat['password'],$cdrformat['type'] ); $http->nlist($cdrformat["path"],$cdrformat["prefixfile"]); $cfiles = $http->files($cdrformat["filter"]); foreach($cfiles as $file) { $fdate = $cdr->filedate($file,$cdrformat["dateoffset"]); if ($fdate >= $daterange["start"] && $fdate <= $daterange["end"]) { if(file_exists($download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]) || file_exists("sql\\" . date("Y-m",$fdate) . "\\" . date("Y-m-d",$fdate) . ".sql")) { if($download['overwrite'] != 0) { set_time_limit(500); @unlink($download["path"] . $file); $http->get($file, $cdrformat["prefixfile"], $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]); $downloads[$cdrformat["name"]][] = $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]; $daysdownloaded[] = date("Y-m-d",$fdate); } } else { set_time_limit(500); $http->get($file, $cdrformat["prefixfile"], $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]); $downloads[$cdrformat["name"]][] = $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]; $daysdownloaded[] = date("Y-m-d",$fdate); } } } break; default: break; } $cdr = null; } $missingfiles = null; if($daysdownloaded != null) { $daysdownloaded = array_unique($daysdownloaded); foreach($daysdownloaded as $daydownloaded) { foreach($cdrformats as $cdrformat) { if(!file_exists("downloads\\" . $daydownloaded . "." . $cdrformat['name'])) { goto skipday; break; } } $mysqldb1 = new mysql($mysql['server'],$mysql['username'],$mysql['password'],$mysql['database'],$mysql['databasetmp'],$cdrformat['name']); $databaseformat = "DROP TABLE IF EXISTS `##DATABASE##`.`##MONTH##`;\nCREATE TABLE `##DATABASE##`.`##MONTH##` ( `uniqueid` int(11) DEFAULT NULL, `Caller` varchar(255) DEFAULT NULL, `Started` datetime DEFAULT NULL, `Dialed` varchar(255) DEFAULT NULL, `DurationSec` int(11) DEFAULT NULL, `DurationMin` int(11) DEFAULT NULL, `Cost` double DEFAULT NULL, `Location` varchar(60) DEFAULT NULL, `Switch` varchar(15) DEFAULT 'Cellular');"; $databaseformat = str_replace("##MONTH##",substr($daydownloaded,0,-3),$databaseformat); $databaseformat = str_replace("##DATABASE##",$mysql['databasetmp'],$databaseformat); $mysqldb1->executesql($databaseformat); $mysqldb1 = null; unset($mysqldb1); $i = 0; foreach($cdrformats as $cdrformat) { if(!file_exists("downloads\\" . $daydownloaded . "." . $cdrformat['name'])) { goto missingfile; } $txt2sql = new txt2sql($cdrformat["name"],$cdrformat["delimiter"],$cdrformat['skiprows'],$mysql['databasetmp']); $vals = $txt2sql->getFile($daydownloaded); $txt2sql = null; unset($txt2sql); $b = ""; $c = ""; $d = ""; $b = str_replace("##DATABASE##",$mysql['databasetmp'],$cdrformat["sql"]["beforerates"]); $d = str_replace("##DATABASE##",$mysql['databasetmp'],$cdrformat["sql"]["migrate"]) . "\n" . "DROP TABLE IF EXISTS `" . $mysql['databasetmp'] . "`.`" . $cdrformat['name'] . "`;\n"; $d = str_replace("##MONTH##",substr($daydownloaded,0,-3),$d); $mysqldb = new mysql($mysql['server'],$mysql['username'],$mysql['password'],$mysql['database'],$mysql['databasetmp'],$cdrformat['name']); if($cdrformat["userates"] == true) { $c = implode("\n",$mysqldb->getrates($cdrformat['useratesfields']['ratefield'],$cdrformat['useratesfields']['locationfield'],$cdrformat['useratesfields']['durationfield'],$cdrformat['useratesfields']['codefield'])); } $vals .= $b . $c . $d; $b = null; $c = null; $d = null; @mkdir("sql\\" . substr($daydownloaded,0,-3) . "\\" . substr($daydownloaded,-2),0777,1); file_put_contents("sql\\" . substr($daydownloaded,0,-3) . "\\" . substr($daydownloaded,-2) . "\\" . $daydownloaded . "." . $cdrformat['name'] . ".sql", $vals); $mysqldb->executesql($vals); $vals = null; $mysqldb = null; unset($vals, $mysqldb, $b, $c, $d); goto nextcdrformat; missingfile: $missingfiles[$cdrformat['name']][] = $daydownloaded; $i++; nextcdrformat: } foreach($cdrformats as $cdrformat) { @unlink("downloads\\" . $daydownloaded . $cdrformat['name']); } if($i == 0) { set_time_limit(3600); $mysqldb1 = new mysql($mysql['server'],$mysql['username'],$mysql['password'],$mysql['database'],$mysql['databasetmp'],$cdrformat['name']); $vals = implode("\n",$mysqldb1->dumpsql($daydownloaded)); @mkdir("sql\\" . substr($daydownloaded,0,-3),0777,1); file_put_contents("sql\\" . substr($daydownloaded,0,-3) . "\\" . $daydownloaded . ".sql", $vals); $mysqldb1->executesql("DROP TABLE IF EXISTS `" . $mysql['databasetmp'] . "`.`" . substr($daydownloaded,0,-3) . "`;"); $mysqldb1->executesql($vals); $vals = null; unset($vals, $mysqldb1); // echo "MERGED: " . $daydownloaded . "<br />"; } else { // echo "MISSING: " . $daydownloaded . "<br />"; } skipday: } } echo "CDR's Downloaded & Merged"; break; Had to move skipday:to just outside the last if statment.
  11. Here is some help with potential flaws that you should look into to see if any apply: First: The all too famous "Include" statement Include Vulnerability - Wikipedia - This topic just touches on the problem with using Include in a brief sensible manner Code Injection Vulnerabilities - This article goes into a bit more detail on how an Include could cause a security issue on your server, and briefly discusses some alternatives. SQL Injections - Article outlining how SQL injections work. If your queries are not sanitized, then, you leave yourself open to problems with your data in your database. If that data also happens to be output to a web page, and/or the web page has exec capabilities on that code, then pretty much anything can happen. Again, as stated in the above posts by other members of this site, without analysing your code (which could be intensive), the server / php / and libraries loaded, ports open, etc, there is no real way to determine 100% how your site got hijacked. The above links should at least point you in the right direction for the type of research you must do if you wish to resolve the problem yourself.
  12. Hello, I am using AJAX to toggle back and forth between "switch/case" by sending a new POST var defining which "case" i wish to execute. At the end of each case, is an echo, which defines progress status, and essentialy is returned to the AJAX html request, and processed client side. So far, it works great for any of the cases I have pushed on it, except this one. case 'merge_cdr': include("includes/ftp.class.php"); include("includes/cdr.class.php"); include("includes/http.class.php"); include("includes/txt2sql.class.php"); include("includes/mysql.class.php"); $startdate = strtotime($download["startdate"]); $month = date("m",$startdate); $day = date("d",$startdate); $year = date("Y",$startdate); $daterange["start"] = mktime(0, 0, 0, $month ,$day,$year); $daterange["end"] = mktime(0,0,0,date("m"),date("d")-2,$year); $daysdownloaded = null; foreach($cdrformats as $cdrformat) { $cdr = new cdr(); $cdr->dateposition = $cdrformat["date"]; switch($cdrformat["type"]) { case "ftp": $ftp = new ftp(); $ftp->connect($cdrformat["server"],$cdrformat["username"],$cdrformat["password"],1); $ftp->nlist($cdrformat["path"]); $cfiles = $ftp->files($cdrformat["filter"]); if($cdrformat["path"] != null && $cdrformat["path"] !="") { $ftp->chdir($cdrformat["path"]); } foreach($cfiles as $file) { $fdate = $cdr->filedate($file,$cdrformat["dateoffset"]); if ($fdate >= $daterange["start"] && $fdate <= $daterange["end"]) { if(file_exists($download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]) || file_exists("sql\\" . date("Y-m",$fdate) . "\\" . date("Y-m-d",$fdate) . ".sql")) { if($download['overwrite'] != 0) { set_time_limit(500); @unlink($download["path"] . $file); $ftp->get($file, $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]); $downloads[$cdrformat["name"]][] = $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]; $daysdownloaded[] = date("Y-m-d",$fdate); // echo date("Y-m-d",$fdate) . " - " . $file . "<br>"; } } else { set_time_limit(500); $ftp->get($file, $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]); $downloads[$cdrformat["name"]][] = $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]; $daysdownloaded[] = date("Y-m-d",$fdate); } } } $ftp->disconnect(); $ftp = null; break; case "http" || "https": $http = new http($cdrformat['server'],$cdrformat['username'],$cdrformat['password'],$cdrformat['type'] ); $http->nlist($cdrformat["path"],$cdrformat["prefixfile"]); $cfiles = $http->files($cdrformat["filter"]); foreach($cfiles as $file) { $fdate = $cdr->filedate($file,$cdrformat["dateoffset"]); if ($fdate >= $daterange["start"] && $fdate <= $daterange["end"]) { if(file_exists($download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]) || file_exists("sql\\" . date("Y-m",$fdate) . "\\" . date("Y-m-d",$fdate) . ".sql")) { if($download['overwrite'] != 0) { set_time_limit(500); @unlink($download["path"] . $file); $http->get($file, $cdrformat["prefixfile"], $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]); $downloads[$cdrformat["name"]][] = $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]; $daysdownloaded[] = date("Y-m-d",$fdate); } } else { set_time_limit(500); $http->get($file, $cdrformat["prefixfile"], $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]); $downloads[$cdrformat["name"]][] = $download['path'] . date("Y-m-d",$fdate) . "." . $cdrformat["name"]; $daysdownloaded[] = date("Y-m-d",$fdate); } } } break; default: break; } $cdr = null; } $missingfiles = null; if($daysdownloaded != null) { $daysdownloaded = array_unique($daysdownloaded); foreach($daysdownloaded as $daydownloaded) { foreach($cdrformats as $cdrformat) { if(!file_exists("downloads\\" . $daydownloaded . "." . $cdrformat['name'])) { goto skipday; break; } } $mysqldb1 = new mysql($mysql['server'],$mysql['username'],$mysql['password'],$mysql['database'],$mysql['databasetmp'],$cdrformat['name']); $databaseformat = "DROP TABLE IF EXISTS `##DATABASE##`.`##MONTH##`;\nCREATE TABLE `##DATABASE##`.`##MONTH##` ( `uniqueid` int(11) DEFAULT NULL, `Caller` varchar(255) DEFAULT NULL, `Started` datetime DEFAULT NULL, `Dialed` varchar(255) DEFAULT NULL, `DurationSec` int(11) DEFAULT NULL, `DurationMin` int(11) DEFAULT NULL, `Cost` double DEFAULT NULL, `Location` varchar(60) DEFAULT NULL, `Switch` varchar(15) DEFAULT 'Cellular');"; $databaseformat = str_replace("##MONTH##",substr($daydownloaded,0,-3),$databaseformat); $databaseformat = str_replace("##DATABASE##",$mysql['databasetmp'],$databaseformat); $mysqldb1->executesql($databaseformat); $mysqldb1 = null; unset($mysqldb1); $i = 0; foreach($cdrformats as $cdrformat) { if(!file_exists("downloads\\" . $daydownloaded . "." . $cdrformat['name'])) { goto missingfile; } $txt2sql = new txt2sql($cdrformat["name"],$cdrformat["delimiter"],$cdrformat['skiprows'],$mysql['databasetmp']); $vals = $txt2sql->getFile($daydownloaded); $txt2sql = null; unset($txt2sql); $b = ""; $c = ""; $d = ""; $b = str_replace("##DATABASE##",$mysql['databasetmp'],$cdrformat["sql"]["beforerates"]); $d = str_replace("##DATABASE##",$mysql['databasetmp'],$cdrformat["sql"]["migrate"]) . "\n" . "DROP TABLE IF EXISTS `" . $mysql['databasetmp'] . "`.`" . $cdrformat['name'] . "`;\n"; $d = str_replace("##MONTH##",substr($daydownloaded,0,-3),$d); $mysqldb = new mysql($mysql['server'],$mysql['username'],$mysql['password'],$mysql['database'],$mysql['databasetmp'],$cdrformat['name']); if($cdrformat["userates"] == true) { $c = implode("\n",$mysqldb->getrates($cdrformat['useratesfields']['ratefield'],$cdrformat['useratesfields']['locationfield'],$cdrformat['useratesfields']['durationfield'],$cdrformat['useratesfields']['codefield'])); } $vals .= $b . $c . $d; $b = null; $c = null; $d = null; @mkdir("sql\\" . substr($daydownloaded,0,-3) . "\\" . substr($daydownloaded,-2),0777,1); file_put_contents("sql\\" . substr($daydownloaded,0,-3) . "\\" . substr($daydownloaded,-2) . "\\" . $daydownloaded . "." . $cdrformat['name'] . ".sql", $vals); $mysqldb->executesql($vals); $vals = null; $mysqldb = null; unset($vals, $mysqldb, $b, $c, $d); goto nextcdrformat; missingfile: $missingfiles[$cdrformat['name']][] = $daydownloaded; $i++; nextcdrformat: } foreach($cdrformats as $cdrformat) { @unlink("downloads\\" . $daydownloaded . $cdrformat['name']); } if($i == 0) { set_time_limit(3600); $mysqldb1 = new mysql($mysql['server'],$mysql['username'],$mysql['password'],$mysql['database'],$mysql['databasetmp'],$cdrformat['name']); $vals = implode("\n",$mysqldb1->dumpsql($daydownloaded)); @mkdir("sql\\" . substr($daydownloaded,0,-3),0777,1); file_put_contents("sql\\" . substr($daydownloaded,0,-3) . "\\" . $daydownloaded . ".sql", $vals); $mysqldb1->executesql("DROP TABLE IF EXISTS `" . $mysql['databasetmp'] . "`.`" . substr($daydownloaded,0,-3) . "`;"); $mysqldb1->executesql($vals); $vals = null; unset($vals, $mysqldb1); // echo "MERGED: " . $daydownloaded . "<br />"; } else { skipday: // echo "MISSING: " . $daydownloaded . "<br />"; } } } echo "CDR's Downloaded & Merged"; break; This particular case returns the "echo" statement, while it is still processing -- in fact almost immediatly after AJAX makes the call for "merge_cdr". I know that the PHP function is still processing as I can open up Navicat, and watch the tables and structures, and SQL changes occuring live --- After the "CDR's Downloaded & Merged" message has shown in the browser. This entire block of code takes approximatly 1-3 minutes per file, and there could be several files. Any idea as to why the Echo is occuring before the code has completed processing ?
  13. Might seem like adding an extra layer, but here goes. The built in "mail" command doesn't authenticate, and can cause mail (when it does work), to end up in peoples junk folders. You can use the following script PHPMailer which uses raw socket connections for full communication with the mail server. Where mail() has failed, PHPMailer has succeeded with flying colors. It is also 100% free. Not sure why PHP has not updated their mail() function to allow for such things as authentication, CC, BCC, SSL/TLS, etc, etc, but whatever, this script does everything you need for sending mail --- it even has POP before SMTP authentication.
  14. Look up the "datetime" field, or "timestamp", either can be sorted by ASC or DESC. The "datetime" field, follows the format "2010-01-31 13:29:29", where the "timestamp" field stores as a Unix timestamp (looks like a really long number) -- "13992988499" or something like that. Handling different types in php datetime $val = strtotime($row['datetimefieldname']); timestamp $val = $row['timestampfieldname']; Sorting in MySQL .... ORDER BY `datetime_or_timestamp_field_name` ASC ... Both blocks of PHP code above get the Date/Time value in UNIX Timestamp format, which is the easiest to reformat (in my opinion). See date() for more information on formatting date/times.
×
×
  • 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.