php-general Digest 2 Sep 2006 03:35:57 -0000 Issue 4325
Topics (messages 241319 through 241330):
Re: Functions vs html outpuit
241319 by: M. Sokolewicz
Re: Working with an existing PDF doc
241320 by: Frank Arensmeier
241324 by: Silent1
241328 by: Silent1
Re: remove SimpleXML nodes
241321 by: Adam Zey
Connecting to Webdav with php
241322 by: Aaron Axelsen
Re: live chat support
241323 by: zerof
problems with clases, methods, HTML_Template_IT, etc.
241325 by: Martin Marques
241326 by: Martin Marques
241327 by: Robert Cummings
Re: Problems with UTF
241329 by: mbneto
Organizing php functions
241330 by: The Doctor
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 ---
Dave Goodchild wrote:
Hi all, this may seem like a silly question, but I am creating a library of
html form element generation function, for example a textarea fucntion that
takes rows and cols as parameters, a function that generates a day, month
and year select box, etc. My question is - is it significantly to switch
off
the parser and emit raw html than calling a function? If it is faster to
just allow the server to send the html I will not bother.
I'm not quite sure I understand your question. Are you asking if it's
faster to parse and process a php script vs. a page of raw HTML?
In that case, OF COURSE SERVING A RAW HTML FILE IS FASTER!!!
Does the server have to do *anything* with the contents of the HMTL file? no
Does the server have to do *anything* with the contents of the PHP file?
yes! of course! it needs to parse and process it BEFORE it can actually
server the RESULT of that script.
So, if possible, stick to raw HTML files.
- tul
--- End Message ---
--- Begin Message ---
Tedd,
this issue has been discussed recently on the PDFlib mailing list.
Search for the topic "search & replace on PDF". Archive is here:
http://groups.yahoo.com/group/pdflib/
regards,
/frank
1 sep 2006 kl. 16.33 skrev tedd:
You seem to use FPDF. Although I never tried working with FPDF,
you might take a look at http://fpdi.setasign.de/ which is a class
that extends FPDF.
If you are looking for a library with support for all PDF
features, maybe PDFlib (http://www.pdflib.com) is the one for you
(sure, PDFlib/PDI costs some money. But if you are looking for a
lib that has support for everything that the PDF format has to
offer, PDFlib is definitely the lib you want to use.).
/frank
Thanks, your links were right-on.
All I have to do now is figure out how to do a search and replace
in a PDF document.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
I actually just finished messing around with something like this.
Basically the task was to have a form where users would input stuff
and that needs to be autofilled into a pdf (already created). I used
pdftk (http://www.accesspdf.com/pdftk/) and a php script called
(forge_fdf http://www.pdfhacks.com/forge_fdf/) which would dump the
data to the pdf.
I took the pdf i was given and I added fields to the original pdf that
would get filled in from the form. pdftk allows to to completly
control the pdf, add passwords (user and owner) and restrict the pdf
(edit,print,view) and encrypt it and even flatten the fields.
On 8/31/06, tedd <[EMAIL PROTECTED]> wrote:
Hi gang:
I can create a pdf document "on-the-fly" pretty easily, as shown here:
http://xn--ovg.com/pdf
However, what I need is to find out how to open an existing pdf
document and insert data into it -- does anyone have any experience
in doing this, or references they can point me to?
As always, mondo thanks for those who reply.
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
--- End Message ---
--- Begin Message ---
Sorry, i was at work but the example i followed is located here.
http://www.accesspdf.com/article.php/20050510131850979
Once you have pdftk compiled/setup this script in the example will
pass the post/get data to the pdf to each field you setup in the pdf.
If need be, i can send you the php i've created based on the example
above. BTW if you're not familiar with pdf's, as i wasn't, you
basically setup in the pdf fields (just like html forms) with names
that you pass data to. You will also need adobe acrobat pro to be able
to edit the pdf's. Hope this helps.
On 9/1/06, tedd <[EMAIL PROTECTED]> wrote:
Silent1:
That sounds like what I need, but from what I've read (no offense),
it's not possible.
Do you have an example?
tedd
>I actually just finished messing around with something like this.
>Basically the task was to have a form where users would input stuff
>and that needs to be autofilled into a pdf (already created). I used
>pdftk (http://www.accesspdf.com/pdftk/) and a php script called
>(forge_fdf http://www.pdfhacks.com/forge_fdf/) which would dump the
>data to the pdf.
>
>I took the pdf i was given and I added fields to the original pdf that
>would get filled in from the form. pdftk allows to to completly
>control the pdf, add passwords (user and owner) and restrict the pdf
>(edit,print,view) and encrypt it and even flatten the fields.
>
>
>On 8/31/06, tedd <[EMAIL PROTECTED]> wrote:
>>Hi gang:
>>
>>I can create a pdf document "on-the-fly" pretty easily, as shown here:
>>
>>http://xn--ovg.com/pdf
>>
>>However, what I need is to find out how to open an existing pdf
>>document and insert data into it -- does anyone have any experience
>>in doing this, or references they can point me to?
>>
>>As always, mondo thanks for those who reply.
>>
>>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 General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
It seems there's no way to do this. You can unset certain things in
simpleXML objects, but it's really strange non-standard behaviour. If I
have this for an XML document:
<?xml version='1.0'?>
<document>
<test>foo</test>
<test>bar</test>
<test>baz</test>
</document>
XML;
and I run that through simplexml into $xml, then doing unset($xml->test)
and then exporting again yields this:
<?xml version='1.0'?>
<document>
</document>
Also, if I echo $xml->test[1], I get "bar". But I can't unset anything
like that. $xml->test says it's an array through var dumps, but it
doesn't seem to be a real array, only a fake array.
I'm tempted to say it can't be done. One thing you might try is, to do
the unset, export to DOM using dom_import_simplexml(), use DOM to unset
the thing, and then use simplexml_import_dom(). Who knows how slow
that'd be, though.
Regards, Adam.
Javier Ruiz wrote:
Thanks a lot to all :)
Using DOM I can do what I need. Anyway I was trying the proposed solutions
with SimpleXML but none of them worked for me :(
I tried splitting $key and $value in the foreach command, but when I dump
the xml (with the asXML function) I still have the nodes that I supposed to
delete... And the same using references, cause I think using unset with
referenced variable names doesn't delete the referenced var, it just
deletes
the link to the referenced var...
Concretely I tried:
TEST ONE:
foreach ($xmlDatabase as $key => $oneTable) if ($oneTable['name'] == 'one')
unset($xmlDatabase[$key]);
$sourceXML = $xmlDatabase->asXML(); // <----- node <table name='one'> is
still there
TEST TWO
foreach ($xmlDatabase as $key => &$oneTable) if ($oneTable['name'] ==
'one')
unset($oneTable);
$sourceXML = $xmlDatabase->asXML(); // <----- node <table name='one'> is
still there
If there's no luck with xml I will use of course DOM for this, but I'm
really curious now :P
Again, thanks a lot for the help.
Javi Ruiz.
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I am looking to create a small script which can connect to a webdav
server, authenticate and spit back the contents of a given directory
on the server. What is the best way to do this? I've bene looking
around and so far haven't found anything. Thanks!
- --
Aaron Axelsen
[EMAIL PROTECTED]
Great hosting, low prices. Modevia Web Services LLC --
http://www.modevia.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFE+FuvuucONIvD0AMRAl94AKCjnoLBQ4n/F3kucQD2KiyVcRrqLgCeKOuP
mp8zPv1ktojV2oDmNfnL9jo=
=sIQc
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
blackwater dev escreveu:
Does anyone have any recommendations on some good live chat support apps?
These are the ones where someone can go to your site, click a button and
open a chat window with a customer service person. I'm particularly
interested in ones where we handled the server and everything.
Thanks!
-----
http://livehelp.stardevelop.com/
http://www.helpcenterlive.com/
-----
zerof
--- End Message ---
--- Begin Message ---
I'm buidling a system in OOP, and I have a main clase which
objects in it. One of the objects inside is of type
HTML_Template_IT, which I use to handle presentation tier.
Now, each time the system gets executed, I get this in my php
error log:
PHP Fatal error: Call to a member function get() on a non-object
in /xxx/xxxx/xxxx/lib/Planta.inc on line 135
Line 135 has:
$this->cascara->loadPrincipal($this->tpl->get("todo"));
It would seam $this->tpl is not an object, but I put an output
of is_object($this->tpl) and it gave me true.
The page gets viewed OK, so it's not really a problem of the
program not working, but I just don't like to have "Fatal Errors"
in my log files.
BTW I with PHP 5.0.4 (it's what comes with Fedora Core 4), and
HTML_Template_IT 1.2.1.
--
---------------------------------------------------------
Lic. Martín Marqués | SELECT 'mmarques' ||
Centro de Telemática | '@' || 'unl.edu.ar';
Universidad Nacional | DBA, Programador,
del Litoral | Administrador
---------------------------------------------------------
--- End Message ---
--- Begin Message ---
On Fri, 01 Sep 2006 18:35:45 -0400, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Fri, 2006-09-01 at 19:30 -0300, Martin Marques wrote:
>>
>> Now, each time the system gets executed, I get this in my php
>> error log:
>>
>> PHP Fatal error: Call to a member function get() on a non-object
>> in /xxx/xxxx/xxxx/lib/Planta.inc on line 135
>>
>> Line 135 has:
>>
>> $this->cascara->loadPrincipal($this->tpl->get("todo"));
>>
>> It would seam $this->tpl is not an object, but I put an output
>> of is_object($this->tpl) and it gave me true.
>
> Maybe it's the "wrong" object. Why don't you do a print_r() or
> var_dump() instead of assuming the correct object type? :p
Did a var_dump earlier, and it gave me the HTML_Template_IT object.
I did a is_object because the error says that:
"Call to a member function get() on a non-object".
>>
>> BTW I with PHP 5.0.4 (it's what comes with Fedora Core 4), and
>> HTML_Template_IT 1.2.1.
>
> Maybe you should upgrade.
It's in my TODO. I may have to hurry it up. :-(
--
---------------------------------------------------------
Lic. Martín Marqués | SELECT 'mmarques' ||
Centro de Telemática | '@' || 'unl.edu.ar';
Universidad Nacional | DBA, Programador,
del Litoral | Administrador
---------------------------------------------------------
--- End Message ---
--- Begin Message ---
On Fri, 2006-09-01 at 19:30 -0300, Martin Marques wrote:
> I'm buidling a system in OOP, and I have a main clase which
> objects in it. One of the objects inside is of type
> HTML_Template_IT, which I use to handle presentation tier.
>
> Now, each time the system gets executed, I get this in my php
> error log:
>
> PHP Fatal error: Call to a member function get() on a non-object
> in /xxx/xxxx/xxxx/lib/Planta.inc on line 135
>
> Line 135 has:
>
> $this->cascara->loadPrincipal($this->tpl->get("todo"));
>
> It would seam $this->tpl is not an object, but I put an output
> of is_object($this->tpl) and it gave me true.
Maybe it's the "wrong" object. Why don't you do a print_r() or
var_dump() instead of assuming the correct object type? :p
> The page gets viewed OK, so it's not really a problem of the
> program not working, but I just don't like to have "Fatal Errors"
> in my log files.
>
> BTW I with PHP 5.0.4 (it's what comes with Fedora Core 4), and
> HTML_Template_IT 1.2.1.
Maybe you should upgrade.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
Hi Peter,
I am returning XML from my php script so I should use the charset in my XML
header?
The database (which holds the data) should be set to utf8 and the same thing
in the XML header, right?
On 8/28/06, Peter Lauri <[EMAIL PROTECTED]> wrote:
Hi,
Have you set
header('Content-Type: text/html; charset=utf-8');
in your php script that you call via AJAX?
Best regards,
Peter
PS! I assumed you were not sending any variables with the AJAX request? If
so, you would need to do an utf-8 encoding of the variables and then a
base64 encoding to make sure the arrive correctly. Of course you would
after
that need to decode the variables with base64_decode in your PHP script
DS!
-----Original Message-----
From: mbneto [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29, 2006 2:57 AM
To: [email protected]
Subject: [PHP] Problems with UTF
Hi,
I have a php based script that is called from a html page via ajax.
Everything runs fine except when I use characters such as á that ends up
like A!
After searching and testing I found that if I remove the
encodeURIComponentfrom the javascript and replace with
escape everything works fine.
So the question is what can I do from PHP side to make it play nice with
those UTF encoded chars generated from encodeURIComponent? Since escape
is
deprecated I'd like to find out before I have tons of files to change....
tks.
--- End Message ---
--- Begin Message ---
The question comes up because:
Sort file in the path interfere with one another
which leads to
web page malfunction.
Question: should all php programmes such as drupal be placed
under /usr/local/lib ?
--
Member - Liberal International
This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED]
God Queen and country! Beware Anti-Christ rising!
New Brunswick kick out the Harper Puppet and VOTE LIBERAL on 18 Sept 2006
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--- End Message ---