php-general Digest 18 Dec 2008 11:01:38 -0000 Issue 5852
Topics (messages 284750 through 284779):
Re: Missing namespaceURI after importNode()
284750 by: Nathan Rixham
284772 by: Tim Lind
Re: Good PHP book?
284751 by: Nathan Rixham
284753 by: Matty Sarro
Read/decode barcodes from an image
284752 by: Adam Randall
284754 by: Robert Cummings
284755 by: Nathan Rixham
284756 by: Ashley Sheridan
284757 by: Al
284758 by: Bastien Koert
284768 by: Adam Randall
284769 by: Adam Randall
284770 by: Adam Randall
284771 by: Adam Randall
284773 by: Yeti
284778 by: Per Jessen
Re: Curl with asp pages....
284759 by: Benjamin Hawkes-Lewis
fread question
284760 by: MikeP
284762 by: Robert Cummings
284779 by: MikeP
Re: runtime access to static variable
284761 by: Jack Bates
284763 by: Nathan Rixham
PHP Form email w/attachment
284764 by: jeffery harris
284765 by: Bastien Koert
284766 by: Kastner Mario
284767 by: jeffery harris
284775 by: Carlos Medina
284776 by: Per Jessen
284777 by: Richard Heyes
Re: Printing
284774 by: clive
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
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 ---
<pre:name/>string(15) "xtc:website.com"
--- import of source node ---
<name/>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
--- End Message ---
--- Begin Message ---
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 ---
<pre:name/>string(15) "website.com"
--- import of source node ---
<name/>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.
--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
On Wed, 2008-12-17 at 13:13 -0500, Robert Cummings wrote:
On Wed, 2008-12-17 at 10:47 +0000, 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 :)
--- End Message ---
--- Begin Message ---
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 <
[email protected]> 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
>
>
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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!
--- End Message ---
--- Begin Message ---
On Thu, 2008-12-18 at 00:04 +0000, 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
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
On Wed, Dec 17, 2008 at 7:42 PM, Al <[email protected]> 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
--- End Message ---
--- Begin Message ---
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 <[email protected]> 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
--- End Message ---
--- Begin Message ---
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 <[email protected]> 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
--- End Message ---
--- Begin Message ---
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 <[email protected]> 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
--- End Message ---
--- Begin Message ---
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 <[email protected]> wrote:
> On Wed, Dec 17, 2008 at 7:42 PM, Al <[email protected]> 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
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
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?
I can't say for certain, but have a look at zebra:
http://zebra.sourceforge.net/
Looks like the sort of thing you could use.
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
>From my phpinfo:
magic_quotes_runtime Off
"Robert Cummings" <[email protected]> wrote in message
news:1229567238.8302.35.ca...@localhost...
> 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
>
--- End Message ---
--- Begin Message ---
> 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
<?php
class Test
{
public static
$STEPS = array(
'foo',
'bar');
}
$className = 'Test';
var_dump($className::$STEPS);
ket%
Except that in real life, "$className = get_class($this)"
> 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');
--- End Message ---
--- Begin Message ---
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 :)
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
On Wed, Dec 17, 2008 at 11:02 PM, jeffery harris <
[email protected]> 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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
Thanks for the info! sweet!!
"Kastner Mario" <[email protected]> wrote in message
news:[email protected]...
> 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
>
>
--- End Message ---
--- Begin Message ---
jeffery harris schrieb:
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
Hi Jeffery,
you need to upload the File with the Form inputfield
<form action="input_file.htm" method="post" enctype="multipart/form-data">
<input name="Datei" type="file" size="50" maxlength="100000"
accept="text/*">
When the upload is ready, use is_uploaded_file() function to check and
others to validate the File (important) then move the file with move_
uploaded_ file() to the Directory where you want or attach to the mail
you want.
Kind Regards
Carlos Medina
--- End Message ---
--- Begin Message ---
jeffery harris 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?
>
Take a look at an email you've received with an attachment. That's how
you need to format your email-text.
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
> thank god that some guys make it
> simple for us ;)
You're welcome. :-)
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 5th)
--- End Message ---
--- Begin Message ---
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
--- End Message ---