[PHP] What type of barcode used for document management system ?

2009-09-04 Thread aveev
Hi, I'm new to using barcode I want to create an online registration in my application, where the user can fill in the form and the application will create a pdf file of the form with the barcode inserted on it. The user then brings the printed form to us and we scan the barcode. After scannin

Re: [PHP] Some help with SimpleXML :`(

2009-09-04 Thread Matthew Croud
Well, you guys are awesome. So the script below doesn't cause any errors (nice), however it doesn't save the newly added child to the xml file (items.xml): $xml = simplexml_load_file("items.xml"); $item = $xml->addChild('item'); $item->addChild('name', $name); $item->addChild('desc', $des

[PHP] Some help with SimpleXML :`(

2009-09-04 Thread J DeBord
On Fri, Sep 4, 2009 at 10:23 AM, Matthew Croud wrote: > > Well, you guys are awesome. > > So the script below doesn't cause any errors (nice), however it doesn't > save the newly added child to the xml file (items.xml): > > > > $xml = simplexml_load_file("items.xml"); > > $item = $xml->addChild('i

Re: [PHP] What type of barcode used for document management system ?

2009-09-04 Thread Sam Stelfox
As a matter of fact... For a while I was using a barcode generator to test out inventory system before getting them professionally made. I personally chose to go with Interleaved 2 of 5 as our barcode scanner was able to read them accurately and it was the same format as our campus ID cards. Th

[PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ralph Deffke
Hi all, I'm a bit under stress, maybe somebody knows the regex on a snap. using PHP_EOL would be great. thanks ralph_def...@yahoo.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ashley Sheridan
On Fri, 2009-09-04 at 14:58 +0200, Ralph Deffke wrote: > Hi all, I'm a bit under stress, maybe somebody knows the regex on a snap. > using PHP_EOL would be great. > > thanks > ralph_def...@yahoo.de > > > The regex that would match a line containing only whitespace would look like this: ^\s*$

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ralph Deffke
ok preg_replace( "/^\s*$/m", "", $somestring) does not take empty lines out "Ashley Sheridan" wrote in message news:1252069539.24700.150.ca...@localhost... > On Fri, 2009-09-04 at 14:58 +0200, Ralph Deffke wrote: > > Hi all, I'm a bit under stress, maybe somebody knows the regex on a snap. > > u

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ashley Sheridan
On Fri, 2009-09-04 at 15:28 +0200, Ralph Deffke wrote: > ok > preg_replace( "/^\s*$/m", "", $somestring) > does not take empty lines out > > "Ashley Sheridan" wrote in message > news:1252069539.24700.150.ca...@localhost... > > On Fri, 2009-09-04 at 14:58 +0200, Ralph Deffke wrote: > > > Hi all,

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ralph Deffke
the problem is some have got \t\n some are just \n\n\n using PHP_EOL is a must I thing must be something with the /../sm attributes to the regex, spend like half an hour, but didn't get it, I'm running against a dead line, doesn't seem to be that easy if regex is not the everydays need u have

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ashley Sheridan
On Fri, 2009-09-04 at 15:37 +0200, Ralph Deffke wrote: > the problem is some have got \t\n > some are just \n\n\n > > using PHP_EOL is a must > > I thing must be something with the /../sm attributes to the regex, spend > like half an hour, but didn't get it, I'm running against a dead line, >

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ralph Deffke
I'm working on DTD's "Ashley Sheridan" wrote in message news:1252071932.24700.153.ca...@localhost... > On Fri, 2009-09-04 at 15:37 +0200, Ralph Deffke wrote: > > the problem is some have got \t\n > > some are just \n\n\n > > > > using PHP_EOL is a must > > > > I thing must be something with t

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ashley Sheridan
On Fri, 2009-09-04 at 15:45 +0200, Ralph Deffke wrote: > I'm working on DTD's > > "Ashley Sheridan" wrote in message > news:1252071932.24700.153.ca...@localhost... > > On Fri, 2009-09-04 at 15:37 +0200, Ralph Deffke wrote: > > > the problem is some have got \t\n > > > some are just \n\n\n > >

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Martin Scotta
On Fri, Sep 4, 2009 at 10:37 AM, Ralph Deffke wrote: > the problem is some have got \t\n > some are just \n\n\n > > using PHP_EOL is a must > > I thing must be something with the /../sm attributes to the regex, spend > like half an hour, but didn't get it, I'm running against a dead line, > d

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ralph Deffke
this works $dtd = preg_replace( "/\n+/", "\n", $dtd); "Martin Scotta" wrote in message news:6445d94e0909040653i44716f79m972f11055599...@mail.gmail.com... > On Fri, Sep 4, 2009 at 10:37 AM, Ralph Deffke wrote: > > > the problem is some have got \t\n > > some are just \n\n\n > > > > using PHP_

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Sam Stelfox
The following snippet is untested and using Ash's regex (it is accurate \s matches any white space). $content is what is getting stripped of the new lines and $filtered is the cleansed output. See if that does the trick for you. $lines = str_split(PHP_EOL, $content); $filtered = ''; foreach ($

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ralph Deffke
and this is the PHP_EOL solution: $dtd = preg_replace( "/[". PHP_EOL . "]+/", "". PHP_EOL . "", $dtd); dont ask me why two empty strings are needed to surround the PHP_EOL but its does it. Why this works? we have got an INTERPRETER here any \n is transtlated into 0x0D an \r into 0x0A so the patte

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Ashley Sheridan
On Fri, 2009-09-04 at 16:13 +0200, Ralph Deffke wrote: > and this is the PHP_EOL solution: > $dtd = preg_replace( "/[". PHP_EOL . "]+/", "". PHP_EOL . "", $dtd); > > dont ask me why two empty strings are needed to surround the PHP_EOL but its > does it. > > Why this works? we have got an INTERPRE

Re: [PHP] Converting URL's to hyperlinks.

2009-09-04 Thread Lupus Michaelis
Daevid Vincent a écrit : Maybe I misunderstood the OP, OP ? but wouldn't this (or something like it) be easier and cleaner than that mess below?? No, it's dirty too. $url = preg_replace("/(\...@\w+\.[a-za-z]{2,3})/i", "$1", $url); This violate the numerous RFC about mail addresses, an

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Lupus Michaelis
Ashley Sheridan a écrit : What's wrong with using the wildcards that are built into most SQL variants? Performance issues. Like is an operator to avoid when possible. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Ashley Sheridan
On Fri, 2009-09-04 at 17:00 +0200, Lupus Michaelis wrote: > Ashley Sheridan a écrit : > > What's wrong with using the wildcards that are built into most SQL > > variants? > >Performance issues. Like is an operator to avoid when possible. > > -- > Mickaël Wolff aka Lupus Michaelis > http://lu

[PHP] Re: Searching on AlphaNumeric Content Only

2009-09-04 Thread Lupus Michaelis
sono...@fannullone.us a écrit : Here's an example: let's say there is an itemID of 4D-2448-7PS but someone omits the dashes and searches on 4D24487PS. Is it possible in PHP to have the find be successful, even if the search criteria doesn't exactly match what's stored in the field? I

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Lupus Michaelis
Ashley Sheridan a écrit : You'll have far greater performance issues if you retrieve all those records and attempt to do the same thing inside of PHP... It's why I speak about « avoiding » and not « bannishing ». Like can be usefull, I used to use it. But it is not the a good answer to all

[PHP] php and ODBC

2009-09-04 Thread Marc Fromm
I am trying to figure out how to use ODBC with PHP. Specifically I need to connect a php script to a SunGard Banner table I know I need to set up some type of DNS connection, but I am not sure what exactly that is. [r...@dev ~]$ odbcinst -j unixODBC 2.2.11 DRIVERS: /etc/odbcinst.ini S

[PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread James Colannino
Hey everyone. I ran into a really weird issue that I was hoping I could find some clarification on. In short, I have javascript functions that operate on hidden text values. Those values may be posted, in which case PHP then prints them back to the page via what comes in on $_POST. The weird th

Re: [PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread Andrew Ballard
On Fri, Sep 4, 2009 at 3:16 PM, James Colannino wrote: > Hey everyone.  I ran into a really weird issue that I was hoping I could > find some clarification on.  In short, I have javascript functions that > operate on hidden text values.  Those values may be posted, in which > case PHP then prints t

[PHP] Include Files in HTML

2009-09-04 Thread sono-io
In my readings, I've run across examples showing include files being called from within the tags, and other examples showing them called within . I've always put them in the header section myself, but I was wondering if one is better than the other, or is it just personal preference? F

RE: [PHP] Include Files in HTML

2009-09-04 Thread Bob McConnell
From: sono-io at fannullone.us > In my readings, I've run across examples showing include files being > called from within the tags, and other examples showing > them called within . I've always put them in the header > section myself, but I was wondering if one is better than the othe

Re: [PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread James Colannino
Andrew Ballard wrote: > Javascript interpolates \n as a newline character inside both double > and single quotes unlike PHP that only interpolates inside double > quotes. If the client browser is running under Windows, it may even be > possible that the \n is recognized by the browser as a line te

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Eddie Drapkin
On Fri, Sep 4, 2009 at 12:02 PM, Lupus Michaelis wrote: > Ashley Sheridan a écrit : > >> You'll have far greater performance issues if you retrieve all those >> records and attempt to do the same thing inside of PHP... > >  It's why I speak about « avoiding » and not « bannishing ». Like can be > u

[PHP] script failing at same line

2009-09-04 Thread jim white
Hi, I have a script that intermittently fails at the same line. I am trying to write some code that will throw an exception after 5 seconds if the command on that line fails and the script freezes. Any ideas? Jim White -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Robert Cummings
Eddie Drapkin wrote: On Fri, Sep 4, 2009 at 12:02 PM, Lupus Michaelis wrote: Ashley Sheridan a écrit : You'll have far greater performance issues if you retrieve all those records and attempt to do the same thing inside of PHP... It's why I speak about « avoiding » and not « bannishing ». Li

RE: [PHP] Converting URL's to hyperlinks.

2009-09-04 Thread Daevid Vincent
> -Original Message- > From: Lupus Michaelis [mailto:mickael+...@lupusmic.org] > Sent: Friday, September 04, 2009 7:46 AM > To: php-general@lists.php.net > Subject: Re: [PHP] Converting URL's to hyperlinks. > > Daevid Vincent a écrit : > > Maybe I misunderstood the OP, >OP ? Origi

Re: [PHP] Converting URL's to hyperlinks.

2009-09-04 Thread Tom Chubb
2009/9/4 Daevid Vincent > > > > -Original Message- > > From: Lupus Michaelis > > [mailto:mickael+...@lupusmic.org > ] > > Sent: Friday, September 04, 2009 7:46 AM > > To: php-general@lists.php.net > > Subject: Re: [PHP] Converting URL's to hyperlinks. > > > > Daevid Vincent a écrit : > >

RE: [PHP] script failing at same line

2009-09-04 Thread Jay Blanchard
[snip] I have a script that intermittently fails at the same line. I am trying to write some code that will throw an exception after 5 seconds if the command on that line fails and the script freezes. Any ideas? [/snip] I have lots of ideas! But those really won't help you :) We need to see the

Re: [PHP] script failing at same line

2009-09-04 Thread jim white
$map = ms_newMapObj($mapfile); The command creates a new mapscript object. Jay Blanchard wrote: [snip] I have a script that intermittently fails at the same line. I am trying to write some code that will throw an exception after 5 seconds if the command on that line fails and the script freez

Re: [PHP] script failing at same line

2009-09-04 Thread Ben Dunlap
> $map = ms_newMapObj($mapfile); > > The command creates a new mapscript object. > > And PHP is hanging somewhere inside that constructor? Is this in a web context or a command-line context? Or both?

RE: [PHP] Include Files in HTML

2009-09-04 Thread Joost
"Bob McConnell" wrote: > From: sono-io at fannullone.us > >> In my readings, I've run across examples showing include files > being >> called from within the tags, and other examples showing > >> them called within . I've always put them in the header > >> section myself, but I was wondering

Re: [PHP] script failing at same line

2009-09-04 Thread jim white
It's a web app that draws maps in a browser. Sometime it will generate a seg fault. The command should not take long, so if there is some script construct that will throw an exception after a few seconds if the command has not completed I could signal the user that the map will not draw and to

[PHP] accessing variable from inside a class

2009-09-04 Thread Lars Nielsen
Hi, How do i access a variable from inside a class? ex. I want to use $template_dir inside Template. $template_dir = 'templates/'; class templateParser { var $output; function templateParser($templateFile='default_template.htm') { (file_exists($t

[PHP] PHP6 Stable Release Schedule

2009-09-04 Thread Bobby Pejman
Hi, Does anyone know when the stable release of PHP6 be ready for download? I hear there's a lot of goodies in version 6 including built-in Caching. Yum. Also, will PHP ever implement the Strict mode similar to Perl's 'using Strict'? Thanks, Bobby

Re: [PHP] accessing variable from inside a class

2009-09-04 Thread James Colannino
Lars Nielsen wrote: > Hi, > > How do i access a variable from inside a class? Add the following statement: global $template_dir; James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP6 Stable Release Schedule

2009-09-04 Thread Daniel Brown
On Fri, Sep 4, 2009 at 17:42, Bobby Pejman wrote: > Hi, > > Does anyone know when the stable release of PHP6 be ready for download?  I > hear there's a lot of goodies in version 6 including built-in Caching. > Yum.  Also, will PHP ever implement the Strict mode similar to Perl's 'using > Strict'?

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Jim Lucas
Sam Stelfox wrote: > The following snippet is untested and using Ash's regex (it is accurate > \s matches any white space). $content is what is getting stripped of the > new lines and $filtered is the cleansed output. See if that does the > trick for you. > > $lines = str_split(PHP_EOL, $content);

[PHP] Re: PHP inserting carriage returns into POST values?

2009-09-04 Thread Nisse Engström
On Fri, 04 Sep 2009 12:16:47 -0700, James Colannino wrote: > Hey everyone. I ran into a really weird issue that I was hoping I could > find some clarification on. In short, I have javascript functions that > operate on hidden text values. Those values may be posted, in which > case PHP then pri

Re: [PHP] Include Files in HTML

2009-09-04 Thread sono-io
On Sep 4, 2009, at 1:05 PM, Bob McConnell wrote: Depends on what you are including. The only tags that can be inside the head are , , ,

Re: [PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread Paul M Foster
On Fri, Sep 04, 2009 at 12:16:47PM -0700, James Colannino wrote: > Hey everyone. I ran into a really weird issue that I was hoping I could > find some clarification on. In short, I have javascript functions that > operate on hidden text values. Those values may be posted, in which > case PHP th

[PHP] Re: accessing variable from inside a class

2009-09-04 Thread Shawn McKenzie
Lars Nielsen wrote: > Hi, > > How do i access a variable from inside a class? ex. I want to use > $template_dir inside Template. > > > $template_dir = 'templates/'; > > class templateParser { > var $output; > > function templateParser($templateFile='default_template.htm') >

Re: [PHP] accessing variable from inside a class

2009-09-04 Thread Lars Nielsen
I cant get it to work. I will use a configuration class instead. function templateParser($templateFile='default_template.htm') { $c = new config(); (file_exists($c->template_dir.$templateFile)) ? $this->output=file_get_contents($c->

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Tommy Pham
- Original Message > From: Robert Cummings > To: Eddie Drapkin > Cc: Lupus Michaelis ; php-general@lists.php.net > Sent: Friday, September 4, 2009 1:36:08 PM > Subject: Re: [PHP] Searching on AlphaNumeric Content Only > > Eddie Drapkin wrote: > > On Fri, Sep 4, 2009 at 12:02 PM, Lupus >

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Paul M Foster
On Fri, Sep 04, 2009 at 04:22:18PM -0400, Eddie Drapkin wrote: > On Fri, Sep 4, 2009 at 12:02 PM, Lupus > Michaelis wrote: > if you're on shared hosting (but then again I am of the opinion > that those who choose to run with shared hosting dig their own graves > in more ways than one). Any time

Re: [PHP] Re: PHP inserting carriage returns into POST values?

2009-09-04 Thread James Colannino
Nisse Engström wrote: > It may be the browser that is converting those line breaks. Ah. That's probably it then. I didn't realize that was a part of the HTML standard. Thanks! James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] script failing at same line

2009-09-04 Thread Ben Dunlap
On Fri, Sep 4, 2009 at 2:38 PM, jim white wrote: > It's a web app that draws maps in a browser. Sometime it will generate a > seg fault. The command should not take long, so if there is some script > construct that will throw an exception after a few seconds if the command > has not completed I c

Re: [PHP] Include Files in HTML

2009-09-04 Thread Tommy Pham
- Original Message > From: "sono...@fannullone.us" > To: PHP General List > Sent: Friday, September 4, 2009 12:57:08 PM > Subject: [PHP] Include Files in HTML > > In my readings, I've run across examples showing include files being > called > from within the tags, and other exampl

Re: [PHP] Include Files in HTML

2009-09-04 Thread Tommy Pham
- Original Message > From: Tommy Pham > To: php-general@lists.php.net > Sent: Friday, September 4, 2009 4:11:31 PM > Subject: Re: [PHP] Include Files in HTML > > - Original Message > > From: "sono...@fannullone.us" > > To: PHP General List > > Sent: Friday, September 4, 2009 1

Re: [PHP] Include Files in HTML

2009-09-04 Thread phphelp -- kbk
On Sep 4, 2009, at 5:03 PM, sono...@fannullone.us wrote: Depends on what you are including. The only tags that can be inside the head are , , ,

Re: [PHP] script failing at same line

2009-09-04 Thread jim white
Hi, Thanks I'll look at libevent. I have also been thinking about using an XHR approach, but wonder how passing PHP references works with javascript. Jim Ben Dunlap wrote: On Fri, Sep 4, 2009 at 2:38 PM, jim white > wrote: It's a web app that draws maps in

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Robert Cummings
Paul M Foster wrote: On Fri, Sep 04, 2009 at 04:22:18PM -0400, Eddie Drapkin wrote: On Fri, Sep 4, 2009 at 12:02 PM, Lupus Michaelis wrote: if you're on shared hosting (but then again I am of the opinion that those who choose to run with shared hosting dig their own graves in more ways than

[PHP] Re: how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Clancy
On Fri, 4 Sep 2009 14:58:55 +0200, ralph_def...@yahoo.de ("Ralph Deffke") wrote: >Hi all, I'm a bit under stress, maybe somebody knows the regex on a snap. >using PHP_EOL would be great. Here is a function which works for files pasted from browser screens: function clean_up($dirty_file)

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Paul M Foster
On Fri, Sep 04, 2009 at 08:15:41PM -0400, Robert Cummings wrote: > Paul M Foster wrote: >> On Fri, Sep 04, 2009 at 04:22:18PM -0400, Eddie Drapkin wrote: >> >>> On Fri, Sep 4, 2009 at 12:02 PM, Lupus >>> Michaelis wrote: >> >>> if you're on shared hosting (but then again I am of the opinion >>> th

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-04 Thread Tommy Pham
- Original Message > From: Paul M Foster > To: php-general@lists.php.net > Sent: Friday, September 4, 2009 9:15:08 PM > Subject: Re: [PHP] Searching on AlphaNumeric Content Only > > On Fri, Sep 04, 2009 at 08:15:41PM -0400, Robert Cummings wrote: > > > Paul M Foster wrote: > >> On Fri,