Re: [PHP] Printing

2008-12-17 Thread clive

Dan Shirah wrote:

Hello all,

Could someone please point me in the right direction for printing files
through PHP?

  
On I project I recently worked on, I used php to read a template file 
(rtf) and makes some changes and then save it in a folder on the server. 
This was a windows machine and I used  a small program called 
batchprintpro. It simply monitors a directory and prints any new file 
that should appear. Its quite configurable and seems stable enough to 
print a few hundred documents per week.


Clive


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Yeti
Basic bar code detection is not that difficult. You set a couple of
virtual lines over the images and "crawl" them pixel by pixel. Then
you count the black/white changes and the density of each change. I
could even think of doing this using GD if I had the time. On the
other hand it can get pretty complicated if you need error correction
like a neuronal network would provide it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Missing namespaceURI after importNode()

2008-12-17 Thread Tim Lind

Nathan Rixham wrote:

Tim Lind wrote:

Hi


I am importing a node into a new document so that I can perform an XSL 
transformation on just that node. This works sometimes, however, I've 
come into the following problem, where the namespaceURI is there on 
the node but doesn't make it through the importNode() to the next 
document.


Can you tell me what might be the cause of loosing the namespace on 
importing the node? Bearing in mind that the childnode itself (being 
the result of an xsl transformation) was previously imported into the 
document as a replacement for it's original node.


I'm using PHP 5 DOM and XSL extensions.



Tim


CODE SNIPPET:


# ...$childNode exists previous to this point

echo "\n --- source node --- \n";

echo $this->srcDocument->saveXML($childNode);
var_dump($childNode->namespaceURI);

# importing childnode into a new doc

$newDoc = new DOMDocument();
$newRoot = $newDoc->importNode($childNode, true);
$newDoc->appendChild($newRoot);

echo "\n --- import of source node --- \n";

echo $newDoc->saveXML($newRoot);
var_dump($newRoot->namespaceURI);

# will be using newDoc for an XSL transformation and replacing childNode
# with the new doc,
# (which is what was previously done successfully with child node)


OUTPUT SNIPPET:

 --- source node ---
string(15) "website.com"


 --- import of source node ---
NULL


xmlns for pre isn't in the main doc.. if you add the namespace to the 
node you're importing in element it should stick


I'm not sure I know what you mean, the namespace (website.com) is 
printed there in the original document. Importing the node should copy 
the namespace.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
Yeah, I have played with JOCR/GOCR, but it seemed somewhat inaccurate.
Does anyone have any examples of working with it in code so that I can
figure out how to incorporate it into my solutions?

Adam.

On Wed, Dec 17, 2008 at 5:17 PM, Bastien Koert  wrote:
> On Wed, Dec 17, 2008 at 7:42 PM, Al  wrote:
>
>> If anything can do it, it'll be ImageMagick
>>
>> Adam Randall wrote:
>>
>>> I'm amazed that this either doesn't exist, or is hard to find. I
>>> basically am looking for a way to read in an image into PHP, or shell
>>> out to something on the Linux side, and determine, and see if it has a
>>> barcode in it or not. If it does, I need to decode the barcode so that
>>> I can identify the page as a separator page or not.
>>>
>>> Basically, what I'm doing is reading in a PDF or TIF which will
>>> contain multiple pages (probably a lot of pages) and look for a page
>>> containing a barcode. The barcode will identify the page as a
>>> separator page which will be used to split the multipage document into
>>> smaller single or multipage documents.
>>>
>>> Has anyone ever heard of anything that might help me in this process?
>>>
>>> Adam.
>>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> your best bet would likely be to find an open source OCR package (like
> http://jocr.sourceforge.net/ ) and shell out to it to do the reading in. One
> of our clients wrote a .NET app to just this that renames the file with the
> ocr barcode after which we pick it up and handle the rest
>
> hth
>
> --
>
> Bastien
>
> Cat, the other other white meat
>



-- 
Adam Randall
AIM: blitz574

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
I would have thought so too, but haven't found anything yet. Maybe
there is an answer there (I have Imagick installed for example).
iText, a java utility, has the ability to write barcodes nicely to
PDF, too bad that there's no some reverse there either.

Adam.

On Wed, Dec 17, 2008 at 4:42 PM, Al  wrote:
> If anything can do it, it'll be ImageMagick
>
> Adam Randall wrote:
>>
>> I'm amazed that this either doesn't exist, or is hard to find. I
>> basically am looking for a way to read in an image into PHP, or shell
>> out to something on the Linux side, and determine, and see if it has a
>> barcode in it or not. If it does, I need to decode the barcode so that
>> I can identify the page as a separator page or not.
>>
>> Basically, what I'm doing is reading in a PDF or TIF which will
>> contain multiple pages (probably a lot of pages) and look for a page
>> containing a barcode. The barcode will identify the page as a
>> separator page which will be used to split the multipage document into
>> smaller single or multipage documents.
>>
>> Has anyone ever heard of anything that might help me in this process?
>>
>> Adam.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Adam Randall
AIM: blitz574

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
This completely internal, and highly sensitive. Also, the documents
themselves will different every time likely as they can either be
faxes with who knows what type of skewing/quality/orientation. I need
to be able to read them and find out what the barcodes are, if any.

Adam.

On Wed, Dec 17, 2008 at 4:04 PM, Nathan Rixham  wrote:
> Adam Randall wrote:
>>
>> I'm amazed that this either doesn't exist, or is hard to find. I
>> basically am looking for a way to read in an image into PHP, or shell
>> out to something on the Linux side, and determine, and see if it has a
>> barcode in it or not. If it does, I need to decode the barcode so that
>> I can identify the page as a separator page or not.
>>
>> Basically, what I'm doing is reading in a PDF or TIF which will
>> contain multiple pages (probably a lot of pages) and look for a page
>> containing a barcode. The barcode will identify the page as a
>> separator page which will be used to split the multipage document into
>> smaller single or multipage documents.
>>
>> Has anyone ever heard of anything that might help me in this process?
>>
>> Adam.
>
> ooh ooh why don't you do what recaptcha did and have the public decode them
> for you!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Adam Randall
AIM: blitz574

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
Are you referring to a project, class, or just generally curious about
what I'm asking? Barcode reader can be many things, including a
scanning wand (not applicable to what I am looking for).

On Wed, Dec 17, 2008 at 3:47 PM, Robert Cummings  wrote:
> On Wed, 2008-12-17 at 14:56 -0800, Adam Randall wrote:
>> I'm amazed that this either doesn't exist, or is hard to find. I
>> basically am looking for a way to read in an image into PHP, or shell
>> out to something on the Linux side, and determine, and see if it has a
>> barcode in it or not. If it does, I need to decode the barcode so that
>> I can identify the page as a separator page or not.
>>
>> Basically, what I'm doing is reading in a PDF or TIF which will
>> contain multiple pages (probably a lot of pages) and look for a page
>> containing a barcode. The barcode will identify the page as a
>> separator page which will be used to split the multipage document into
>> smaller single or multipage documents.
>>
>> Has anyone ever heard of anything that might help me in this process?
>
> Barcode reader?
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
>



-- 
Adam Randall
AIM: blitz574

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Form email w/attachment

2008-12-17 Thread jeffery harris
Thanks for the info! sweet!!


"Kastner Mario"  wrote in message 
news:200812180603.34938.off...@unite-it.at...
> use a mailer class, for example phpmailer, to handle this. man i say 
> emailing
> could be a very crazy job for an coder. thank god that some guys make it
> simple for us ;)
>
> http://sourceforge.net/projects/phpmailer
>
>
>> I need to create a php form and mail it to a recipient (that I can do). 
>> My
>> question is how do I create an area for a file (.doc, or .pdf) to be
>> attached emailed along with other form data as well?
>>
>> -Jeff
>
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Form email w/attachment

2008-12-17 Thread Kastner Mario
use a mailer class, for example phpmailer, to handle this. man i say emailing 
could be a very crazy job for an coder. thank god that some guys make it 
simple for us ;)

http://sourceforge.net/projects/phpmailer


> I need to create a php form and mail it to a recipient (that I can do). My
> question is how do I create an area for a file (.doc, or .pdf) to be
> attached emailed along with other form data as well?
>
> -Jeff



Re: [PHP] PHP Form email w/attachment

2008-12-17 Thread Bastien Koert
On Wed, Dec 17, 2008 at 11:02 PM, jeffery harris <
jhar...@harris4interactive.com> wrote:

> I need to create a php form and mail it to a recipient (that I can do). My
> question is how do I create an area for a file (.doc, or .pdf) to be
> attached emailed along with other form data as well?
>
> -Jeff
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> You need to allow the user to upload the file first, using the standard
http file upload. After its on the server, use phpmailer to handle the
mailing...easy peasy


-- 

Bastien

Cat, the other other white meat


[PHP] PHP Form email w/attachment

2008-12-17 Thread jeffery harris
I need to create a php form and mail it to a recipient (that I can do). My 
question is how do I create an area for a file (.doc, or .pdf) to be 
attached emailed along with other form data as well?

-Jeff 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: runtime access to static variable

2008-12-17 Thread Nathan Rixham

Jack Bates wrote:
this does beg the question why don't you know the classname at runtime.. 
seems to be a slight design flaw and may make sense for you to post the 
full problem (you must have chosen to implement this for a reason..)


The full problem is: I started off with a "DeployTask" for deploying a
new instance of my web project to DreamHost:
http://cgi.sfu.ca/~jdbates/tmp/php/200812170/DeployTask.class.phps

(It is a "task" in the symfony framework, but basically the
DeployTask::execute() method gets called)

The task takes about thirty minutes to run, so I broke it up into steps.
After each step, it updates a database row so that a user who started
the task through a web interface can monitor its progress.

Great so far. Now I decided to create an "UpdateTask" for updating
deployed instances to the latest version of my code:
http://cgi.sfu.ca/~jdbates/tmp/php/200812170/UpdateTask.class.phps

Of course it also takes a long time to run, so my first iteration just
extends the DeployTask and defines different steps. UpdateTask inherits
DeployTask::execute(), which drives the steps and updates the database.

Unfortunately, in the inherited DeployTask::execute(), "self::$STEPS"
does not refer to UpdateTask::$STEPS, it refers to DeployTask::$STEPS
: (



Yup I follow, been here myself too; infact doing very similar at the mo 
making an event handler / listener for the hell of it!


anyhow.. stick this in you're DeployTask and run it :p

protected function execute($arguments = array(), $options = array()) {
// you're existing code here up to..
  $job->pid = getmypid();

  $thisClass = new ReflectionClass( get_class($this) );
  $steps = $thisClass->getStaticPropertyValue('STEPS');
  while ($job->step < count($steps))
  {
$job->save();
call_user_func(array($this, $steps[$job->step]), $arguments, $options);
$job->step++;
  }
  $job->delete();
}

untested but should work :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fread question

2008-12-17 Thread Robert Cummings
On Wed, 2008-12-17 at 19:54 -0500, MikeP wrote:
> Hello,
> I have been trying to use fread to open a file, but it always escapes 
> special characters.
> How do I open  afile without it modifying my original file:
> 
> $_POST[$fname] = fread($fileHandle, $_POST[$fname.'_size']);
> I use this and get slashes everywhere.This kills my REGex that gets coded 
> next.

Check this magically shitty setting in your php.ini:

magic_quotes_runtime

It should be off unless someone with less brains than a turd got a hold
of your ini file.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: runtime access to static variable

2008-12-17 Thread Jack Bates
> this does beg the question why don't you know the classname at runtime.. 
> seems to be a slight design flaw and may make sense for you to post the 
> full problem (you must have chosen to implement this for a reason..)

The full problem is: I started off with a "DeployTask" for deploying a
new instance of my web project to DreamHost:
http://cgi.sfu.ca/~jdbates/tmp/php/200812170/DeployTask.class.phps

(It is a "task" in the symfony framework, but basically the
DeployTask::execute() method gets called)

The task takes about thirty minutes to run, so I broke it up into steps.
After each step, it updates a database row so that a user who started
the task through a web interface can monitor its progress.

Great so far. Now I decided to create an "UpdateTask" for updating
deployed instances to the latest version of my code:
http://cgi.sfu.ca/~jdbates/tmp/php/200812170/UpdateTask.class.phps

Of course it also takes a long time to run, so my first iteration just
extends the DeployTask and defines different steps. UpdateTask inherits
DeployTask::execute(), which drives the steps and updates the database.

Unfortunately, in the inherited DeployTask::execute(), "self::$STEPS"
does not refer to UpdateTask::$STEPS, it refers to DeployTask::$STEPS
: (

I gather with "late static bindings" in PHP 5.3, "static::$STEPS" does
what I want? Anyway, DeployTask::execute() is not static, so I know
whether $this is an instance of DeployTask of UpdateTask:
"get_class($this)" returns it. Which brought me to my contrived example:

ket% cat test.php 
 Check this out:
> http://us2.php.net/manual/en/language.oop5.static.php
> 
> It actually won't work until 5.3.0 when they add late static binding.

I ran my contrived example with PHP 5.3alpha3, and it worked!
"$className::$STEPS" is not a parse error in 5.3, which is cool : )

Except that in 5.3, I will probably just use "static::$STEPS" anyway : P

In the meantime, I will probably use reflection as suggested:

// HACK: Use "static::$STEPS" in PHP 5.3:
// http://php.net/oop5.late-static-bindings
$class = new ReflectionClass($this);
$steps = $class->getStaticPropertyValue('STEPS');


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] fread question

2008-12-17 Thread MikeP
Hello,
I have been trying to use fread to open a file, but it always escapes 
special characters.
How do I open  afile without it modifying my original file:

$_POST[$fname] = fread($fileHandle, $_POST[$fname.'_size']);
I use this and get slashes everywhere.This kills my REGex that gets coded 
next.
Thanks
Mike 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Curl with asp pages....

2008-12-17 Thread Benjamin Hawkes-Lewis

Ashley Sheridan wrote:

There is a slight difference in how ASP handles multiple form fields
that share the same name (as well as SELECT MULTIPLE lists) such that
ASP does not need (and should not use) square brackets in field names
the way PHP does.

Andrew


I thought that square brackets were actually part of the HTML spec, not
PHP, so the fact that ASP.Net cannot use them is just another example of
M$ doing their own thing again...


Why did you think that?

I think you'll find square brackets are a PHPism and that PHP is 
actually a freakish oddball in not interpreting key=bar&key=foo&key=quux 
as $_GET['key'] = array( 'bar', 'foo', 'quux' );


Contrast:

* PERL CGI module: http://docstore.mik.ua/orelly/linux/cgi/ch05_02.htm

* Python urlparse library: 
http://docs.python.org/library/urlparse.html#urlparse.parse_qs


* Ruby on Rails: http://dev.rubyonrails.org/ticket/6645

IIRC there's nothing in the URI, HTML, or CGI specs that enforces how 
these should be interpreted.


--
Benjamin Hawkes-Lewis

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Bastien Koert
On Wed, Dec 17, 2008 at 7:42 PM, Al  wrote:

> If anything can do it, it'll be ImageMagick
>
> Adam Randall wrote:
>
>> I'm amazed that this either doesn't exist, or is hard to find. I
>> basically am looking for a way to read in an image into PHP, or shell
>> out to something on the Linux side, and determine, and see if it has a
>> barcode in it or not. If it does, I need to decode the barcode so that
>> I can identify the page as a separator page or not.
>>
>> Basically, what I'm doing is reading in a PDF or TIF which will
>> contain multiple pages (probably a lot of pages) and look for a page
>> containing a barcode. The barcode will identify the page as a
>> separator page which will be used to split the multipage document into
>> smaller single or multipage documents.
>>
>> Has anyone ever heard of anything that might help me in this process?
>>
>> Adam.
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
your best bet would likely be to find an open source OCR package (like
http://jocr.sourceforge.net/ ) and shell out to it to do the reading in. One
of our clients wrote a .NET app to just this that renames the file with the
ocr barcode after which we pick it up and handle the rest

hth

-- 

Bastien

Cat, the other other white meat


[PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Al

If anything can do it, it'll be ImageMagick

Adam Randall wrote:

I'm amazed that this either doesn't exist, or is hard to find. I
basically am looking for a way to read in an image into PHP, or shell
out to something on the Linux side, and determine, and see if it has a
barcode in it or not. If it does, I need to decode the barcode so that
I can identify the page as a separator page or not.

Basically, what I'm doing is reading in a PDF or TIF which will
contain multiple pages (probably a lot of pages) and look for a page
containing a barcode. The barcode will identify the page as a
separator page which will be used to split the multipage document into
smaller single or multipage documents.

Has anyone ever heard of anything that might help me in this process?

Adam.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Ashley Sheridan
On Thu, 2008-12-18 at 00:04 +, Nathan Rixham wrote:
> Adam Randall wrote:
> > I'm amazed that this either doesn't exist, or is hard to find. I
> > basically am looking for a way to read in an image into PHP, or shell
> > out to something on the Linux side, and determine, and see if it has a
> > barcode in it or not. If it does, I need to decode the barcode so that
> > I can identify the page as a separator page or not.
> > 
> > Basically, what I'm doing is reading in a PDF or TIF which will
> > contain multiple pages (probably a lot of pages) and look for a page
> > containing a barcode. The barcode will identify the page as a
> > separator page which will be used to split the multipage document into
> > smaller single or multipage documents.
> > 
> > Has anyone ever heard of anything that might help me in this process?
> > 
> > Adam.
> 
> ooh ooh why don't you do what recaptcha did and have the public decode 
> them for you!
> 
I knew I'd read about something like this recently. In Linux Magazine
Dec08, one of the projects is a Perl script that uses a scanner attached
to the machine to read barcodes and use the free service at Amazon to
retrieve information about it. I think it may be the scanner itself
which reads the barcode and converts that into a number, rather than it
being purely software based as there's nothing in the Perl code example
that seems to do this.

Not sure if this is any help?


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Nathan Rixham

Adam Randall wrote:

I'm amazed that this either doesn't exist, or is hard to find. I
basically am looking for a way to read in an image into PHP, or shell
out to something on the Linux side, and determine, and see if it has a
barcode in it or not. If it does, I need to decode the barcode so that
I can identify the page as a separator page or not.

Basically, what I'm doing is reading in a PDF or TIF which will
contain multiple pages (probably a lot of pages) and look for a page
containing a barcode. The barcode will identify the page as a
separator page which will be used to split the multipage document into
smaller single or multipage documents.

Has anyone ever heard of anything that might help me in this process?

Adam.


ooh ooh why don't you do what recaptcha did and have the public decode 
them for you!


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Read/decode barcodes from an image

2008-12-17 Thread Robert Cummings
On Wed, 2008-12-17 at 14:56 -0800, Adam Randall wrote:
> I'm amazed that this either doesn't exist, or is hard to find. I
> basically am looking for a way to read in an image into PHP, or shell
> out to something on the Linux side, and determine, and see if it has a
> barcode in it or not. If it does, I need to decode the barcode so that
> I can identify the page as a separator page or not.
> 
> Basically, what I'm doing is reading in a PDF or TIF which will
> contain multiple pages (probably a lot of pages) and look for a page
> containing a barcode. The barcode will identify the page as a
> separator page which will be used to split the multipage document into
> smaller single or multipage documents.
> 
> Has anyone ever heard of anything that might help me in this process?

Barcode reader?

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Good PHP book?

2008-12-17 Thread Matty Sarro
When you really want to learn a language, I find it useful to have a book
that teaches you the language, and then a book for reference.

Head First PHP is a GREAT starter book, especially if you're the type whose
eyes glaze over when you're presented with walls of text. Its easy to read
and very visually appealing. Plus it does a great job of teaching.
http://www.amazon.com/Head-First-MySQL-Lynn-Beighley/dp/0596006306

As for reference, php.net is the best book out there. Beyond that, the Zend
Certification guide and the o'reilly books you really can't lose.


On Sun, Dec 14, 2008 at 5:33 PM, jeffery harris <
jhar...@harris4interactive.com> wrote:

> Hi guys/gals. I'm a first time user. Does anyone know of a good php book?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
I'm amazed that this either doesn't exist, or is hard to find. I
basically am looking for a way to read in an image into PHP, or shell
out to something on the Linux side, and determine, and see if it has a
barcode in it or not. If it does, I need to decode the barcode so that
I can identify the page as a separator page or not.

Basically, what I'm doing is reading in a PDF or TIF which will
contain multiple pages (probably a lot of pages) and look for a page
containing a barcode. The barcode will identify the page as a
separator page which will be used to split the multipage document into
smaller single or multipage documents.

Has anyone ever heard of anything that might help me in this process?

Adam.
-- 
Adam Randall
AIM: blitz574

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Good PHP book?

2008-12-17 Thread Nathan Rixham

Ashley Sheridan wrote:

On Wed, 2008-12-17 at 13:13 -0500, Robert Cummings wrote:

On Wed, 2008-12-17 at 10:47 +, Richard Heyes wrote:

Floppies hold 1.4 megs now?  Mine don't and they're even dual-sided. :(

What are "Floppies"? Is it a reference to a particular male problem?

If so, then I want to know what dual sided means?

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP



Maybe it means the state affects you independent of sexual
preference? ;)


Ash
www.ashleysheridan.co.uk



and if you tape over the little whole in you're floppy you can use it 
again :)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Missing namespaceURI after importNode()

2008-12-17 Thread Nathan Rixham

Tim Lind wrote:

Hi


I am importing a node into a new document so that I can perform an XSL 
transformation on just that node. This works sometimes, however, I've 
come into the following problem, where the namespaceURI is there on the 
node but doesn't make it through the importNode() to the next document.


Can you tell me what might be the cause of loosing the namespace on 
importing the node? Bearing in mind that the childnode itself (being the 
result of an xsl transformation) was previously imported into the 
document as a replacement for it's original node.


I'm using PHP 5 DOM and XSL extensions.



Tim


CODE SNIPPET:


# ...$childNode exists previous to this point

echo "\n --- source node --- \n";

echo $this->srcDocument->saveXML($childNode);
var_dump($childNode->namespaceURI);

# importing childnode into a new doc

$newDoc = new DOMDocument();
$newRoot = $newDoc->importNode($childNode, true);
$newDoc->appendChild($newRoot);

echo "\n --- import of source node --- \n";

echo $newDoc->saveXML($newRoot);
var_dump($newRoot->namespaceURI);

# will be using newDoc for an XSL transformation and replacing childNode
# with the new doc,
# (which is what was previously done successfully with child node)


OUTPUT SNIPPET:

 --- source node ---
string(15) "xtc:website.com"


 --- import of source node ---
NULL


xmlns for pre isn't in the main doc.. if you add the namespace to the 
node you're importing in element it should stick


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Good PHP book?

2008-12-17 Thread Ashley Sheridan
On Wed, 2008-12-17 at 13:13 -0500, Robert Cummings wrote:
> On Wed, 2008-12-17 at 10:47 +, Richard Heyes wrote:
> > > Floppies hold 1.4 megs now?  Mine don't and they're even dual-sided. :(
> > 
> > What are "Floppies"? Is it a reference to a particular male problem?
> 
> If so, then I want to know what dual sided means?
> 
> Cheers,
> Rob.
> -- 
> http://www.interjinn.com
> Application and Templating Framework for PHP
> 
> 
Maybe it means the state affects you independent of sexual
preference? ;)


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing

2008-12-17 Thread Dan McCullough
I did something similar, but it was some work I did for a company and the
application was an internal application that used PHP and a Java applet to
send the file to a workers local printer since it cant be accomplished by
PHP itself.

On Wed, Dec 17, 2008 at 3:30 PM, Dan Shirah  wrote:

> >
> >   You can't, the best you can do is send the PDF down and let the user
> >> choose to do with it what they will
> >
> >
> >
> > --
> >
> > Bastien
> >
>
> So you think I should try and look into a way to have FPDF append each
> document to the already created document, and once all pages have been
> added
> to the PDF force it back to the user to open in the broswer?
>


Re: [PHP] Printing

2008-12-17 Thread Dan Shirah
>
>   You can't, the best you can do is send the PDF down and let the user
>> choose to do with it what they will
>
>
>
> --
>
> Bastien
>

So you think I should try and look into a way to have FPDF append each
document to the already created document, and once all pages have been added
to the PDF force it back to the user to open in the broswer?


Re: [PHP] Printing

2008-12-17 Thread Bastien Koert
On Wed, Dec 17, 2008 at 3:16 PM, Dan Shirah  wrote:

> >
> >   Do you want to print this on your office printer or on the website
> users
> > printer?
> >
> > If you are looking for away to print it on their printer, why not just
> grab
> > all the files that need to be printed, make a PDF of it, and then use the
> > browsers print feature?
> >
> >
> >
> >  --
> > Jason Pruim
> > japr...@raoset.com
> > 616.399.2355
> >
>
> I want it to print to the users local printer.
>
> Basically the user has a form and based on their search criteria they will
> get multiple results.
>
> Next to each result I have a checkbox that the user will use to select the
> documents they want to print.
>
> Once they have selected everything they want to print, they click on a
> "Print Selection" link.
>
> The checkboxes all have the same name but different dynamically assigned
> values, so once they click to print, an array of values for the checkbox
> name is passed to my next page.
>
> I have a for () loop on the next page that extracts each individual value
> and uses it in a query to extract information and build a pdf which is
> automatically output to a file.
>
> Once a PDF has been generated I want to send it to the users printer to be
> printed.
>

You can't, the best you can do is send the PDF down and let the user choose
to do with it what they will

-- 

Bastien

Cat, the other other white meat


Re: [PHP] Printing

2008-12-17 Thread Dan Shirah
>
> Does it save them to a folder on the server? Or does it save them on the
> client?
>
> If it is on the server then the server would have to send the docs to a
> printer queue.
>
> If it is on the client PHP cannot really do anything about. PHP cannot
> force the client to print but it could send the docs to the client once
> a request has been made.
>

Yes, it saves the created documents to a folder on the server.  Since any
user could request to print the same document I first check to see if the
document already exists.

If it does exist I naturally want to skip the creation process and just
print it and move on to the next selection.

I have another process that clears out this folder once every 24 hours so it
doesn't accumulate a massive store of files.


Re: [PHP] Printing

2008-12-17 Thread Dan Shirah
>
>   Do you want to print this on your office printer or on the website users
> printer?
>
> If you are looking for away to print it on their printer, why not just grab
> all the files that need to be printed, make a PDF of it, and then use the
> browsers print feature?
>
>
>
>  --
> Jason Pruim
> japr...@raoset.com
> 616.399.2355
>

I want it to print to the users local printer.

Basically the user has a form and based on their search criteria they will
get multiple results.

Next to each result I have a checkbox that the user will use to select the
documents they want to print.

Once they have selected everything they want to print, they click on a
"Print Selection" link.

The checkboxes all have the same name but different dynamically assigned
values, so once they click to print, an array of values for the checkbox
name is passed to my next page.

I have a for () loop on the next page that extracts each individual value
and uses it in a query to extract information and build a pdf which is
automatically output to a file.

Once a PDF has been generated I want to send it to the users printer to be
printed.


RE: [PHP] Printing

2008-12-17 Thread Jay Blanchard
[snip]
Could someone please point me in the right direction for printing files
through PHP?

I already have my application setup so that it creates documents and
saves
them to a folder.  How would I go about printing all of the files in the
folder via PHP?

I've looked into the Print functions in the manual (
http://us2.php.net/manual/en/ref.printer.php) but this does not seem to
be
the right thing to use to print documents that already exist.
[/snip]

Does it save them to a folder on the server? Or does it save them on the
client?

If it is on the server then the server would have to send the docs to a
printer queue.

If it is on the client PHP cannot really do anything about. PHP cannot
force the client to print but it could send the docs to the client once
a request has been made.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing

2008-12-17 Thread Jason Pruim


On Dec 17, 2008, at 2:57 PM, Dan Shirah wrote:


Hello all,

Could someone please point me in the right direction for printing  
files

through PHP?

I already have my application setup so that it creates documents  
and saves
them to a folder.  How would I go about printing all of the files  
in the

folder via PHP?

I've looked into the Print functions in the manual (
http://us2.php.net/manual/en/ref.printer.php) but this does not  
seem to be

the right thing to use to print documents that already exist.


Do you want to print this on your office printer or on the website  
users printer?


If you are looking for away to print it on their printer, why not  
just grab all the files that need to be printed, make a PDF of it,  
and then use the browsers print feature?




--
Jason Pruim
japr...@raoset.com
616.399.2355





Re: [PHP] Printing

2008-12-17 Thread Bastien Koert
On Wed, Dec 17, 2008 at 2:57 PM, Dan Shirah  wrote:

> Hello all,
>
> Could someone please point me in the right direction for printing files
> through PHP?
>
> I already have my application setup so that it creates documents and saves
> them to a folder.  How would I go about printing all of the files in the
> folder via PHP?
>
> I've looked into the Print functions in the manual (
> http://us2.php.net/manual/en/ref.printer.php) but this does not seem to be
> the right thing to use to print documents that already exist.
>
> Thanks,
> Dan
>
I would suggest sending a PDF to the client and allowing the client to
handle the rest.


-- 

Bastien

Cat, the other other white meat


[PHP] Printing

2008-12-17 Thread Dan Shirah
Hello all,

Could someone please point me in the right direction for printing files
through PHP?

I already have my application setup so that it creates documents and saves
them to a folder.  How would I go about printing all of the files in the
folder via PHP?

I've looked into the Print functions in the manual (
http://us2.php.net/manual/en/ref.printer.php) but this does not seem to be
the right thing to use to print documents that already exist.

Thanks,
Dan


Re: [PHP] Phpmyadmin password

2008-12-17 Thread VamVan
Yeah I felt the same. It should be config.inc.php. Well I dont think its in
clear text though (alteast in the latest version). May be u can do a bowl
fish encryption of your new custom password and reset it in the file.

Thanks,
V

On Wed, Dec 17, 2008 at 9:01 AM, Jim Lucas  wrote:

> Micah Gersten wrote:
> > It flance wrote:
> >> Hi,
> >>
> >> I lost phpmyadmin password. Is there anyway to recover it?
> >>
> >> Thank you
> >>
> >>
> >
> > PHPMyAdmin uses MySQL's internal authentication.  Log into your MySQL
> > server and reset your password.
> >
> > http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
> >
> > Thank you,
> > Micah Gersten
> > onShore Networks
> > Internal Developer
> > http://www.onshore.com
> >
> >
> >
>
> That is the case, but only if the op is using http auth
>
> if they are using config or cookie based, then it might/should be stored in
> the config.inc.php file.
>
> --
> Jim Lucas
>
>   "Some men are born to greatness, some achieve greatness,
>   and some have greatness thrust upon them."
>
> Twelfth Night, Act II, Scene V
>by William Shakespeare
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Good PHP book?

2008-12-17 Thread Robert Cummings
On Wed, 2008-12-17 at 10:47 +, Richard Heyes wrote:
> > Floppies hold 1.4 megs now?  Mine don't and they're even dual-sided. :(
> 
> What are "Floppies"? Is it a reference to a particular male problem?

If so, then I want to know what dual sided means?

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Create unique non-autoincrement key for 700,000 records?

2008-12-17 Thread Robert Cummings
On Wed, 2008-12-17 at 11:32 +0100, Jochem Maas wrote:
> >
> > 
> >> sometimes less is more (although oddly more is never less ;-)
> > 
> > What about when more is black holes?
> 
> hmm. I guess that would depend on which side of the event horizon
> you were at. :-)

Is there conservation of reality across the event horizon? If so, then
there's neither more or less ;)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] error flashing on redirect

2008-12-17 Thread ceo

Change php.ini (or .htacces or ini_set) so that display_errors is OFF and 
log_errors is ON and log them to some file you do this to, all day, every day:



tail -f /var/log/httpd/error_log



You'll definitely need this as you get more complex site interaction, 
particularly with Ajax calls that don't have any visible output to the screen.



Also use error_reporting E_ALL to find all your uninitialized variables and 
typos in array indices.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Phpmyadmin password

2008-12-17 Thread Jim Lucas
Micah Gersten wrote:
> It flance wrote:
>> Hi,
>>
>> I lost phpmyadmin password. Is there anyway to recover it?
>>
>> Thank you
>>
>>   
> 
> PHPMyAdmin uses MySQL's internal authentication.  Log into your MySQL
> server and reset your password.
> 
> http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
> 
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
> 
> 
> 

That is the case, but only if the op is using http auth

if they are using config or cookie based, then it might/should be stored in the 
config.inc.php file.

-- 
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] error flashing on redirect

2008-12-17 Thread Stut
2008/12/17 Terion Miller :
> I am working on the login script I have been troubling over, and when I hit
> submit it throws an error and even though I have error reporting E_All on
> because its on a redirect or something I can see the error for only a split
> second so I can't catch it to figure it out (does this make sense?) how
> would I go about making that error visible long enough to read?

Erm... find out what's redirecting it, and remove it. Or have I missed
something?

-Stuart

-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] error flashing on redirect

2008-12-17 Thread Terion Miller
I am working on the login script I have been troubling over, and when I hit
submit it throws an error and even though I have error reporting E_All on
because its on a redirect or something I can see the error for only a split
second so I can't catch it to figure it out (does this make sense?) how
would I go about making that error visible long enough to read?

Thanks Guys!
Terion


Re: [PHP] Re: Create unique non-autoincrement key for 700,000 records?

2008-12-17 Thread tedd

At 9:23 PM -0500 12/16/08, Robert Cummings wrote:

I haven't come accross UUID() before. It looks time based to me.


Yeah, it stops the nine month thing.  :-)

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Secure uploads tutorial

2008-12-17 Thread tedd

At 1:55 PM +1100 12/17/08, Tim Starling wrote:

There are some file types, such as .png and .wav, where that approach is
not at all secure. The file command will tell you that the file is
image/png, but IE 6 will detect it as text/html and run scripts in it.


Oh, I see the problem (I think).

I was thinking it was a server-side problem -- IOW, how do you stop 
someone from uploading a clever script that the server will somehow 
run.


But instead, this is how to stop someone from uploading a script that 
will become evil when someone else views it using IE. Is that it?


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Missing namespaceURI after importNode()

2008-12-17 Thread Tim Lind

Hi


I am importing a node into a new document so that I can perform an XSL 
transformation on just that node. This works sometimes, however, I've 
come into the following problem, where the namespaceURI is there on the 
node but doesn't make it through the importNode() to the next document.


Can you tell me what might be the cause of loosing the namespace on 
importing the node? Bearing in mind that the childnode itself (being the 
result of an xsl transformation) was previously imported into the 
document as a replacement for it's original node.


I'm using PHP 5 DOM and XSL extensions.



Tim


CODE SNIPPET:


# ...$childNode exists previous to this point

echo "\n --- source node --- \n";

echo $this->srcDocument->saveXML($childNode);
var_dump($childNode->namespaceURI);

# importing childnode into a new doc

$newDoc = new DOMDocument();
$newRoot = $newDoc->importNode($childNode, true);
$newDoc->appendChild($newRoot);

echo "\n --- import of source node --- \n";

echo $newDoc->saveXML($newRoot);
var_dump($newRoot->namespaceURI);

# will be using newDoc for an XSL transformation and replacing childNode
# with the new doc,
# (which is what was previously done successfully with child node)


OUTPUT SNIPPET:

 --- source node ---
string(15) "xtc:website.com"


 --- import of source node ---
NULL

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] checking local file size

2008-12-17 Thread John Pillion


> > I tried installing it like the documentation said... but I got the
> > following errors. I contacted the hosting service (dreamhost) and they
> > said they don't
> > provide support for pecl, though they do support perl.  Anyone?
> > 
> > --
> > 
> > $ pecl install uploadprogress
> > 
> > Failed to download pecl/uploadprogress within preferred state "stable",
> > latest release is version 0.9.1, stability "beta", use
> > "channel://pecl.php.net/uploadprogress-0.9.1" to install Cannot
initialize
> > 'uploadprogress', invalid or missing package file Package
"uploadprogress"
> > is not valid install failed
> > 
> > 
> > 
> > $ pecl install uploadprogress-beta
> > 
> > Cannot install, php_dir for channel "pecl.php.net" is not writeable by
the
> > current user
> > .com/
> 
> Um, sudo? Or be root when you install as the PEAR/PECL structure is
usually
> owned by root.


Just tried that - I don't have the permissions to sudo :(


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Curl with asp pages....

2008-12-17 Thread shiplu
On Wed, Dec 17, 2008 at 6:28 AM, ioannes  wrote:
> shiplu wrote:
>>
>> On Sun, Dec 7, 2008 at 8:22 AM, ioannes  wrote:
>>
>>>
>>> shiplu wrote:
>>>

 When you are dealing with curl, anything can be done as long as its a
 HTTP
 request.Its all about sending HTTP headers and content.

 To parse HTML content you can use HTML parser. Regular expression may
 not
 work each time.
 Pattern changes over time.

 Download Wireshark. Collect 2 sample request and response packet from
 there.
 Make a format and use it with CURL.
 Thats it. So Simple. You never gonna  need to know who is generating the
 site, PHP or ASP.NET.




>>>
>>> I downloaded Wireshark onto Windows XP, got as far as Capture Options
>>> from
>>> Ethernet, Capture Filter is host , click
>>> Start,
>>> go to browser and access page, Stop Wireshark, Save captured file or
>>> Export
>>> as HTTP object which gives me the source of the page again.  Is this what
>>> you mean?   What do you mean by make a format - do you mean for instance
>>> parse the page with string finder functions etc.   How is this helping
>>> over
>>> identifying the correct POST variables (using LiveHTTP etc) of the
>>> request
>>> and feeding into a curl function?  What do you mean by 'make a format'
>>> versus 'pattern changes over time' - is format a Wireshark function, if
>>> so
>>> where do I find it.   Thanks, John
>>>
>>>
>>>
>>
>>
>> "make a format" is not like a button in wireshirk that has label "make
>> a format" and it will do everything for you. You have to do it
>> yourself. By wireshirk you'll see every type of headers and contents
>> for almost every type of protocols. So you'll use this soft for
>> analyzing the http conversation. Data will not only be in content but
>> also in headers. so parse both if needed. then use the same data and
>> make successive requests.
>> If you are using regular expression it will fail to match if pattern
>> changes. Your pattern '/> id="__VIEWSTATE" value="([^"]*?)" \/>/ will match > name="__VIEWSTATE" id="__VIEWSTATE" value="ABC7D5ACSE" /> but wont
>> match > value="ABC7D5ACSE">. Do you see the difference?? It wont mach > type="hidden" id="__VIEWSTATE" name="__VIEWSTATE"  value="ABC7D5ACSE"
>> /> too. Because the attributes order is changed. Your regex will not
>> work but their website will render very well. to overcome this, you
>> have to use html/xml parser. So you can go to input element. then look
>> for name attribute and if the name attribute is "__VIEWSTATE" then
>> fetch the value attributes content.  To make any input element name,
>> value attribute must be present. So your code will match every time.
>> It wont fail in 99.99% case.
>>
>> Hope that make sense
>>
>>
>
> Yes, thanks.  What HTML parser do you suggest?
>
> John
>

For php there is a dom extension.
Documentation can be found in http://www.php.net/dom

Thanks.

-- 
A K M Mokaddim
http://talk.cmyweb.net
http://twitter.com/shiplu
Stop Top Posting !!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] checking local file size

2008-12-17 Thread David Robley
John Pillion wrote:

>> > I already downloaded that, thanks.  How do I apply it is my question.
>> > There's no documentation for the installation of it, that I see
>> 
>> 'Course it is :)
>> 
>> http://www.php.net/manual/en/install.pecl.php
>> 
>> Linked from here: http://pecl.php.net/doc/index.php
>> 
> 
> I tried installing it like the documentation said... but I got the
> following errors. I contacted the hosting service (dreamhost) and they
> said they don't
> provide support for pecl, though they do support perl.  Anyone?
> 
> --
> 
> $ pecl install uploadprogress
> 
> Failed to download pecl/uploadprogress within preferred state "stable",
> latest release is version 0.9.1, stability "beta", use
> "channel://pecl.php.net/uploadprogress-0.9.1" to install Cannot initialize
> 'uploadprogress', invalid or missing package file Package "uploadprogress"
> is not valid install failed
> 
> 
> 
> $ pecl install uploadprogress-beta
> 
> Cannot install, php_dir for channel "pecl.php.net" is not writeable by the
> current user
> .com/

Um, sudo? Or be root when you install as the PEAR/PECL structure is usually
owned by root.


Cheers
-- 
David Robley

"This is a sick bird," said Tom illegally.
Today is Sweetmorn, the 59th day of The Aftermath in the YOLD 3174. 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Good PHP book?

2008-12-17 Thread David Robley
Daniel Brown wrote:

> On Tue, Dec 16, 2008 at 17:11, Jay Moore  wrote:
>>
>> Ok.  Let me back them up to these reel-to-reel tapes quick, just in case.
> 
> Just be careful that you don't get the Michaelangelo or Friday The
> 13th viruses especially if you're converting over on a C-64 1541
> drive.
> 

What? They were cross platform? I recall copping Michaelangelo on Win 3.n
from some commercial software floppy. Not nice - it cleaned out the FAT or
something equally nasty. A reinstall was called for :-)


Cheers
-- 
David Robley

"I already showed you how to do that," Tom said tautly.
Today is Sweetmorn, the 59th day of The Aftermath in the YOLD 3174. 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Good PHP book?

2008-12-17 Thread Richard Heyes
> Floppies hold 1.4 megs now?  Mine don't and they're even dual-sided. :(

What are "Floppies"? Is it a reference to a particular male problem?

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 5th)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Good PHP book?

2008-12-17 Thread Richard Heyes
> Sounds like you need "Self Esteem for Dummies."

Lol. It's not a question of self-esteem, more based on the number of
non-starter businesses I've attempted to start.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 5th)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Create unique non-autoincrement key for 700,000 records?

2008-12-17 Thread Jochem Maas
Robert Cummings schreef:
> On Wed, 2008-12-17 at 02:03 +0100, Jochem Maas wrote:
>> or just:
>>
>> mysql_query("UPDATE test SET mykey=UUID()");
>>
>> can't see any reason to go down the 'loop the dataset and roll your
>> own much less random, much more likely to collide, unique value' road.
> 
> Not terribly random:
> 
> 7e55a4d0-1d31-102c-8104-001fd05507bc
> 7e8e9ed4-1d31-102c-8104-001fd05507bc
> 7ec56be4-1d31-102c-8104-001fd05507bc
> 7efbb50a-1d31-102c-8104-001fd05507bc
> 7f339bf0-1d31-102c-8104-001fd05507bc
> 
> But it's about as good as what has already come up :) I haven't come
> accross UUID() before. It looks time based to me.

it is, amongst other things. ands no it doesn't look very random,
but it's garanteed (in your lifetime) to be unique even when you
make the call simultaneous on any number of machines.

I guess you could do better by doing something more complex than
the single query I suggested ... but the first 8 chars are pretty
much random enough to avoid simple (or even complex) guess work ...
they're more random than the passwords most people use to log into
'whatever'. :-)

my point was more that it's a bit silly to go about creating reams
of code to generate random strings when there are prebuilt functions
in the various tools we use written by people much cleverer than us
(well me anyway) ... i.e. Leverage (siedenote: enjoyable TV show) the
work of some crypto wizard and write a single LOC rather than create stacks
of code you have to maintain which is probably not as good as the pre-built
'wheels'.

that said UUID() is an interesting thing in it's own right, worthy of
investigation.

> 
>> sometimes less is more (although oddly more is never less ;-)
> 
> What about when more is black holes?

hmm. I guess that would depend on which side of the event horizon
you were at. :-)

> Cheers,
> Rob.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Good PHP book?

2008-12-17 Thread David Robley
Lupus Michaelis wrote:

> Daniel Brown a écrit :
> 
>> You'd be surprised.  The "For Dummies" series is one of the
>> best-selling franchises in mainstream publishing history.
> 
>Best-selling are not a proof of quality.
> 

Viz: Windows Version xx.x


Cheers
-- 
David Robley

Windows: XT emulator for an AT.
Today is Sweetmorn, the 59th day of The Aftermath in the YOLD 3174. 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Can PHP be used to snatch images cross-domain?

2008-12-17 Thread Jan Kaštánek
Chris:
>
> curl can handle timeouts much better (file_get_contents will timeout when
> the server on the other end says so).

If you use stream context, you can set timeout to file_get_contents() as well.

-- 
toby

http://toby.cz/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Good PHP book?

2008-12-17 Thread Lupus Michaelis

Daniel Brown a écrit :


You'd be surprised.  The "For Dummies" series is one of the
best-selling franchises in mainstream publishing history.


  Best-selling are not a proof of quality.

--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php