[PHP] Problems with dbase_create function

2002-09-28 Thread Matt Neimeyer
Hey All, I'm trying to build a DBF for exporting selected data as a download to the end users... But I can't get further than this... error_reporting(E_ALL); $DBFName = "Test.dbf"; $Fields = array( array ("Test","C",32) ); if(dbase_create($DBFName, $Fields))

RE: [PHP] Problems with dbase_create function

2002-09-29 Thread Matt Neimeyer
he directory where you >are trying to create the database? PHP runs as the web server when >installed as a module and it needs permission to write in that >directory. > >---John Holmes... > > > -Original Message- > > From: Matt Neimeyer [mailto:[EMAIL PROTECTE

[PHP] Sanitizing Numbers

2009-03-13 Thread Matt Neimeyer
I'm trying to sanitize some numeric data that's coming to us from another system which I have no control over where all fields are character fields with no formatting from the end user so data is a mishmash of clean and mixed types of dirty. I know I can use intval and floatval to sanitize if the

[PHP] Reading from a COM port in Windows blows up

2009-03-14 Thread Matt Neimeyer
I just recently got a new Onkyo TX-SR706 Audio Receiver that has an RS232 interface and I thought... cool... Build a Web Interface so I can control it from several rooms away. The code below works using PHP 5.2.8 under Apache (XAMPP) on Windows XP to change the current input of my Audio Receiver.

Re: [PHP] Problems with implode

2009-03-24 Thread Matt Neimeyer
On Tue, Mar 24, 2009 at 9:15 AM, Per Jessen wrote: > TG wrote: > >> I don't think that would be a problem, the size of the array.  I've >> used implode at least once or twice on fairly large arrays.  More >> likely is something weird with your data. > > Yeah, like the odd backspace or carriage ret

Re: [PHP] Connecting to dBase using ODBC on Mac OS X

2009-04-12 Thread Matt Neimeyer
I know this isn't exactly what you were probably looking for but... If you have a Windows machine available I would recommend taking a look at the ODBTP project at http://odbtp.sourceforge.net. ODBTP stands for Open DataBase Transport Protocol. The short version is that you add a client module to

[PHP] Boolean Parameter to 3 Options?

2009-04-29 Thread Matt Neimeyer
I have a function that currently takes a boolean value as a parameter. But now I want to expand it to 3 options... So if I have... function doFooBar($doFoo = false) { if($doFoo) { echo "Did Foo"; } else { echo "Did Bar"; } } Is it as "simple" as changing it like follows t

Re: [PHP] Boolean Parameter to 3 Options?

2009-04-29 Thread Matt Neimeyer
On Wed, Apr 29, 2009 at 1:30 PM, Shawn McKenzie wrote: > Philip Thompson wrote: >> On Apr 29, 2009, at 11:42 AM, Matt Neimeyer wrote: >> >>> I have a function that currently takes a boolean value as a parameter. >>> But now I want to expand it to 3 options...

[PHP] Same Page, Fundamentally Different Behavior OR is Firefox broken?

2009-06-11 Thread Matt Neimeyer
I'm at a complete loss... So I'm hoping someone can point me in the right direction to even start looking. We have an application written in PHP that lets users send out emails. The basic process is as follows. 1. Go to "start" screen. (This resets anything currently in process for the current lo

Re: [PHP] Re: Same Page, Fundamentally Different Behavior OR is Firefox broken?

2009-06-13 Thread Matt Neimeyer
I'd have to check... But am I to understand that no-cache works with pre-caching? I always assumed it basically meant "when you get this page, don't keep it for next time"? Thanks! On Fri, Jun 12, 2009 at 2:04 AM, Manuel C. wrote: > Matt Neimeyer a écrit : >> >&g

[PHP] PHP module "portability" on OSX 10.4

2009-06-23 Thread Matt Neimeyer
I know this is a bit OS specific but it's for PHP so I'm hoping someone here has run into it before and can answer. I've compiled php_gd.so for use on an XServe running OSX 10.4. It works fine there. When I copy it to another XServe it fails because of missing dependencies (don't remember the exac

[PHP] Split up Date Range

2009-07-01 Thread Matt Neimeyer
I haven't been able to find anything by googling... Does anyone know of any libraries that will split up date ranges? We've got a project where "Date Of Attendance" is moving from a single type in character field to an automatically built field based on a DateBegin date field and a DateEnd date fie

Re: [PHP] Split up Date Range

2009-07-01 Thread Matt Neimeyer
On Jul 1, 2009, at 11:33, Ashley Sheridan wrote: On Wednesday 01 July 2009 16:25:29 Matt Neimeyer wrote: We've got a project where "Date Of Attendance" is moving from a single type in character field to an automatically built field based on a DateBegin date field and

[PHP] Launch Windows Program from PHP

2009-07-13 Thread Matt Neimeyer
I'm probably just not Googling right... Short version: How can I launch a program for the current user sitting in front of a windows web server? Longer version: I've written a PHP app to migrate data from the FoxPro version of our product to the upcoming MySQL version. I have a self contained setu

Re: [PHP] PHP and FoxPro

2009-07-20 Thread Matt Neimeyer
> We currently use the Easysoft ODBC Bridge to connect to a remote FoxPro > database. The problem is that the bridge, after a while, starts consuming a > ton of system resources and we have to reboot the machine. Afterwards, it > can take upwards to two hours before everything is running quickly

[PHP] Converting SQL Dialects

2009-07-21 Thread Matt Neimeyer
Has anyone come across / written a script that will convert one "flavor" or Dialect of SQL to another? I need to convert Visual FoxPro 6.0 style WHERE clauses to MySQL. For the most part the problems are converting VFP functions to the equivalent SQL. For example, Visual FoxPro has a function inl

Re: [PHP] PHP and FoxPro

2009-07-21 Thread Matt Neimeyer
       Thanks for the information.  I'll look into using ODBTP.  I noticed > you mentioned the problem with memos.  I currently have that problem with > the set up we're using and it is a pain! > > Thanks! > Floyd > > On Jul 20, 2009, at 3:22 PM, Matt Neimeyer wrote

Re: [PHP] Converting SQL Dialects

2009-07-21 Thread Matt Neimeyer
me) Matt On Tue, Jul 21, 2009 at 1:54 PM, Ashley Sheridan wrote: > On Tue, 2009-07-21 at 13:46 -0400, Matt Neimeyer wrote: >> Has anyone come across / written a script that will convert one >> "flavor" or Dialect of SQL to another? >> >> I need to convert Visu

Re: [PHP] Converting SQL Dialects

2009-07-23 Thread Matt Neimeyer
> You might even be able to convert EMPTY(X) to COALESCE(X, '') = ''. > MySQL seems to be pretty forgiving with its implicit type-casting. Hmm... The new system I've written properly handles the datatype and EMPTY... So this would be a hack to much around with regexs to replace EMPTY in customer b

[PHP] Broken IF behavior? (Changing the branch changes the evaluation)

2009-07-28 Thread Matt Neimeyer
Background: I'm converting a webapp from Visual FoxPro as a backend to MySQL... However one part of our app (a system status checker) is common code between the versions. I've got the following function... In English (in case it's not apparent), if the version of the app is 2.0 or higher, then use

Re: [PHP] Broken IF behavior? (Changing the branch changes the evaluation)

2009-07-28 Thread Matt Neimeyer
e" [1]=> string(11) "Sample Cust" ["value"]=> string(11) "Sample Cust" } On Tue, Jul 28, 2009 at 2:56 PM, Eddie Drapkin wrote: > On Tue, Jul 28, 2009 at 2:48 PM, Matt Neimeyer wrote: >> Background: I'm converting a webapp from Visual

Re: [PHP] Re: Broken IF behavior? (Changing the branch changes the evaluation)

2009-07-29 Thread Matt Neimeyer
>> $Ret = mysql_fetch_array($result); if(!$Ret) { } else { return $Ret; } > I'm assuming that you are calling my_fetch_array() in a loop of some > sort and so at some point there are no more records in the result. Oh... Um... Yeah... Well... So... Checking the docs... "Returns an array of string

[PHP] This isn't infinitely recursive is it?

2009-07-30 Thread Matt Neimeyer
I'm cleaning up some inherited code in our data import module. For a variety of reasons we have to support old standards of the import format. Since some of those old versions were created we have since renamed some fields in our data structure. So right now I've a hard map for some field names...

[PHP] Re: This isn't infinitely recursive is it?

2009-07-31 Thread Matt Neimeyer
I like it... Thanks! On Thu, Jul 30, 2009 at 8:04 PM, Ben Dunlap wrote: >> I don't THINK I need to worry about circular mappings... but I'm not >> sure how to check for it if I did... > Would the following work? It avoids recursion entirely and also checks for > circular mappings. You can plug in

[PHP] Script to Compare Database Structures

2009-07-31 Thread Matt Neimeyer
I know I CAN hack something together but I hate to reinvent the wheel. I want to be able to compare the structure of two different clients databases that might be on different servers that are firewalled away from each other. Given the two structures it will list all the SQL commands needed to mak

Re: [PHP] Script to Compare Database Structures

2009-08-05 Thread Matt Neimeyer
I finally got a chance to play with this and it looks like it is exactly what I need. Thanks! On Fri, Jul 31, 2009 at 11:50 PM, German Geek wrote: > have you tried mysqldiff? >> I want to be able to compare the structure of two different clients >> databases that might be on different servers tha

[PHP] I'm not crazy I swear it... IE vs Safari and Firefox - The impossible!

2009-08-31 Thread Matt Neimeyer
no other explanation of why it DOES matter... I've tried disabling prefetching in Firefox (thinking MAYBE the browser was prefetching the "bailout" link back to step 1 from step 3). The initialize in step 1 fixed another problem we were having but I did try disabling it temporarily to no av

Re: [PHP] I'm not crazy I swear it... IE vs Safari and Firefox - The impossible!

2009-08-31 Thread Matt Neimeyer
> No answers - just more questions to maybe point you in a direction you > haven't been Anything is appreciated... > Is it possible that the query/script is taking too long to build the > response page and FireFox/Safari is asking for an empty query result? I don't think so... the tr

Re: [PHP] I'm not crazy I swear it... IE vs Safari and Firefox - The impossible!

2009-08-31 Thread Matt Neimeyer
> If it were prefetching, or another request clobbering your current request > then you would see a second hit in your server logs. I will admit... I have made (at least) one assumption... Since... 1. This is a difference between IE and Firefox/Safari... 2. I was seeing a tracer email for each hi

Re: [PHP] I'm not crazy I swear it... IE vs Safari and Firefox - The impossible!

2009-08-31 Thread Matt Neimeyer
> In circumstances like this, I would "instrument" the code with > echo/print statements all around where you think the problem is. We did that with no luck. We only saw one call to the initialize function which is why I switched to tracer emails because we "knew" the initialize function was "the

Re: [PHP] I'm not crazy I swear it... IE vs Safari and Firefox - The impossible!

2009-08-31 Thread Matt Neimeyer
> How many PHP scripts correspond to these 4 steps? Is it one script (or > more) for each step? For example: > Or is it just one "dispatcher" script: > Or something in-between? It's a dispatcher script that can call multiple files. For example (without pulling up code)... (each dispatch job would

Re: [PHP] Magnetic Stripe Reader or Barcode to PHP

2010-02-18 Thread Matt Neimeyer
If the scanning device hooks into the keyboard somehow it should be easy. I believe that's called a "keyboard wedge". Basically, you scan and it types. My only exposure to this is using one of the old CueCat scanners to index my personal library into a php app I cobbled together. The CueCat hooked

[PHP] Fun with Streams

2010-02-21 Thread Matt Neimeyer
I created a stream wrapper around the php_writeexcel library found at http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/ My code can be seen at http://www.pastebin.com/m7212eaa2 I'm trying to add an option that will allow us to lower or uppercase the column headers we create by

Re: [PHP] Fun with Streams

2010-02-24 Thread Matt Neimeyer
, it makes it simple to just dump row after row of data into it for exports and simple reports. Matt On Mon, Feb 22, 2010 at 4:14 AM, Rene Veerman wrote: > just curious, why did you choose to use it from behind a stream wrapper? > > On Sun, Feb 21, 2010 at 11:03 PM, Matt Neimeyer wr

[PHP] "Downgrading" HTML

2010-09-16 Thread Matt Neimeyer
I know I could possibly hack something together using the Tidy libraries... (maybe...) but are there any existing php libraries / projects that already have the ability to take some HTML and "downgrade" the version of HTML being used. One example: turn this... Blah ... into ... Blah This

Re: [PHP] redefine a define ...

2012-08-25 Thread Matt Neimeyer
Can you just switch the order? Instead of... define("SOME_CONSTANT","Generic Value"); define("SOME_CONSTANT","Override Value"); Why not do... define("SOME_CONSTANT","Override Value"); if(!defined("SOME_CONSTANT")) { define("SOME_CONSTANT","Generic Value"); } This should avoid any r

[PHP] DOS CLI?

2011-12-02 Thread Matt Neimeyer
Is there (or is there a way to compile) a DOS CLI version of a fairly recent version of PHP? I have not been able to find one using the powers of Google. Not a Windows Command Prompt CLI but an actual CLI version of PHP that can be made to run in a real DOS environment? I'm sure I could find anot

Re: [PHP] DOS CLI?

2011-12-08 Thread Matt Neimeyer
On Thu, Dec 8, 2011 at 7:16 AM, Richard Quadling wrote: > On 2 December 2011 21:00, Matt Neimeyer wrote: >> Is there (or is there a way to compile) a DOS CLI version of a fairly >> recent version of PHP? I have not been able to find one using the >> powers of Google. &g

Re: [PHP] Re: http_referer. what's wrong with that?

2012-01-11 Thread Matt Neimeyer
While perhaps unlikely in "common users" it is also possible to prevent your browser from sending the referrer. IIRC, the referrer can also get mangled when passing through HTTPS (although I don't remember on which side, HTTP->HTTPS or HTTPS->HTTP or both) Matt On Thu, Jan 12, 2012 at 1:11 AM, Ro

[PHP] Recursion... Sort of...

2008-05-08 Thread Matt Neimeyer
Is there a way to tell if a function has been called that has resulted in a call to the same function? We have an in-house CRM app that has a function that draws a tabbed panel on a screen... BUT if there are sub-sub-tabbed panels we want to invert the tab colors and panel colors... So... DrawSu

Re: [PHP] Recursion... Sort of...

2008-05-09 Thread Matt Neimeyer
Wow! Thanks guys! Here's what I ended up doing... To get... Black on White - 1 White on Black - 2 Black on White - 3 Black on White - 3 White on Black - 2 Black on White - 3 I had to do something like... function doStuff() { static $callCount = 0; $callCount++; if($c