Re: [PHP] SOAP in PHP on very restricted host?

2007-09-25 Thread David Christopher Zentgraf

On  26. Sep 2007, at 13:19, mike wrote:


i've downloaded PEAR packages before and used them manually.

all PEAR is is PHP object code modules in a central place. nothing
special, really.

you just have to tweak some script paths and you can use
include/require on the files like normal.


That's what I thought, but PEAR::SOAP seems to depend on the PEAR  
base package. ...which I could probably install manually as well, I  
know.


But I just found out about NuSOAP (http://dietrich.ganx4.com/ 
nusoap/), which seems to be what I'm looking for, a no-strings- 
attached SOAP implementation. I'm trying my luck with this one for  
now. :)


Cheers,
Dav

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



Re: [PHP] SOAP in PHP on very restricted host?

2007-09-26 Thread David Christopher Zentgraf

On  26. Sep 2007, at 15:26, Nathan Nobbe wrote:

i just read the first message in this thread and NuSoap immediately  
came to
mind. though it will solve your problem you may end up like me,  
hating to use
NuSoap under duress.  i think it was really popular back in th php4  
days when there
was nothing solid that could be built right into php.  anyway in my  
experience

its a relic and i try to stay away from it if i can.


I already see what you mean.
A big bummer is that even though it uses the same class name as the  
default PHP SOAP module, it uses a totally different syntax/method  
calls etc, which all seem slightly queer to me. Which is terrible  
since the library the gateway provides wants to call (and extend)  
SoapClient() in very specific ways.


I don't think I wanna go down this road very far...

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



Re: [PHP] SOAP in PHP on very restricted host?

2007-09-26 Thread David Christopher Zentgraf

On  26. Sep 2007, at 16:14, mike wrote:


On 9/25/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:

i try to stay away from it if i can.


i think the same of SOAP. in my opinion a shower is the only place  
for soap.


Well put. :-D
I, too, fail to see what's so terribly special about it.

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



Re: [PHP] SOAP in PHP on very restricted host?

2007-09-26 Thread David Christopher Zentgraf

On  26. Sep 2007, at 16:45, Nathan Nobbe wrote:


i hate to suggest it, but you might want to take a little time and
investigate what other restrictions you host has.  if the list is  
long you may want to consider a
move. it may seem arduous now, but the longer you wait the more  
arduous it will

become.


Oh, we know our host sucks major [primate] [primate][bodypart].
The plan is to eventually have our own servers in-house, but until  
then, there really isn't that much choice unfortunately. As far as we  
observed all of the major hosts in Tokyo (Hi from Japan!) are pretty  
much the same. And hosting abroad is out of the question, since  
latency goes right up and throughput down with every inch off the  
Japanese coast. Unless somebody has a good tip for a good host...



still on php4 (dont ask)


Ditto.

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



Re: [PHP] languages and PHP

2007-09-27 Thread David Christopher Zentgraf
Your biggest problem will be if you accept any kind of user input  
which could be in any kind of language.
Depending on your server configuration you'll probably have some  
serious cleaning and filtering to do.

I often have to employ this line for example:
foreach (array_keys($_POST) as $key) $clean[$key] =  
mb_convert_encoding($_POST[$key], "UTF-8");


Trying to make sure that you'll receive UTF-8 helps as well:
accept-charset="utf-8">


Magic-Quotes can be a mayor pain in the rear, especially if you're on  
a host where you can't turn them off.


Other than that I concur, keep everything in UTF-8, explicitly check  
everything you're not sure about for UTF-8 compliance and explicitly  
set all your database connections to use UTF-8 and store stuff in UTF-8.


Cheers.

UTF-8, UTF-8

On  27. Sep 2007, at 19:15, Angelo Zanetti wrote:


Hi all.

this is more of a general question but Im sure some people will  
have experience and also it will be useful to others who are  
looking for the same answers as I am.


What are the implications of having a site that has many different  
languages, including latin and non latin characters?


Firstly, can a mysql database handle these characters normally? or  
would you have to have a table for each language and set a  
different CHARSET for each language depending on the type of language?


Secondly, PHP and displaying the information: Is there anything  
that needs to change with regards to PHP and handling of these  
characters? OR is it able to handle all characters fine?


HTML: I assume the charset changes in the metatag in the  of  
the document?


Is there anything else that I might be missing or other problems  
that I should be aware of?


Thanks in advance.


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



Re: [PHP] MySQL connector installation/upgrade problems

2007-10-23 Thread David Christopher Zentgraf

On  23. Oct 2007, at 19:55, Martin Marques wrote:


Wouldn't it be easier to upgrade to CentOS 5?


We tried to explain that to our host, but their service *major  
expletive*, and other hosts in Tokyo ain't better either. :-(


Chrs,
Dav

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



Re: [PHP] Re: [PHP-INSTALL] MySQL connector installation/upgrade problems

2007-10-23 Thread David Christopher Zentgraf

On  23. Oct 2007, at 20:33, Colin Guthrie wrote:


If you compile PHP and it finds v3 of mysql that means that you must
have the old development libraries for mysql 3 installed in some
capacity (I believe).

What is the output of:
rpm -qa --nosignature --nodigest | grep -i mysql

This should give some clues.


$ rpm -qa --nosignature --nodigest | grep -i mysql
MySQL-server-community-5.0.45-0.rhel3
mod_auth_mysql-20030510-2.ent
MySQL-shared-compat-5.0.45-0.rhel3
MySQL-client-community-5.0.45-0.rhel3
mysql-bench-3.23.58-16.RHEL3.1
MySQL-python-0.9.1-6
libdbi-dbd-mysql-0.6.5-5
perl-DBD-MySQL-2.1021-4.EL3
qt-MySQL-3.1.2-17.RHEL3
php-mysql-4.3.2-43.ent
MySQL-devel-community-5.0.45-0.rhel3

Now I'm even more confused, the 5.0.45 devel package *is* there.

I would imagine (don't know) that PHP would use the mysql_config  
program

to work out which mysql is installed and get the relevent cflags and
linking options. For me this is provided by the
MySQL-devel-community-5.0.27 package from MySQL... Is this definitely
installed?


$ mysql_config
Usage: /usr/bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/include/mysql -g -pipe -march=i386 - 
mcpu=i686]

--include[-I/usr/include/mysql]
--libs   [-L/usr/lib/mysql -lmysqlclient -lz -lcrypt  
-lnsl -lm]
--libs_r [-L/usr/lib/mysql -lmysqlclient_r -lz - 
lpthread -lcrypt -lnsl -lm -lpthread]

--socket [/var/lib/mysql/mysql.sock]
--port   [3306]
--version[5.0.45]
--libmysqld-libs [-L/usr/lib/mysql -lmysqld -lz -lpthread - 
lcrypt -lnsl -lm -lpthread -lrt]


Doing a simple ls -l on both /usr/lib/mysql and /usr/include/mysql  
shows me that all libraries in there are from Jul 5th, which is too  
old to be my recent MySQL install. So these seem to be the files that  
need updating. Which package will do that for me?


Chrs,
Dav

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



Re: [PHP] Re: [PHP-INSTALL] MySQL connector installation/upgrade problems

2007-10-23 Thread David Christopher Zentgraf

On  23. Oct 2007, at 21:07, Colin Guthrie wrote:


No, I reckon Jul 5th could be about right when was .45 released? I
had it in my head it was august but Jul doesn't seem too far before  
that

so entirely possible.


Ah sorry, I was thinking about source installs. RPMs keep the  
original creation date I guess. Not overly used to that.



Use rpm -qf  to see which package owns which files.


Probing two random files in include/mysql and and lib/mysql show they  
belong to MySQL-devel-community-5.0.45-0.rhel3.



you can also use rpm -V  to verify that the package has not be
modified on disk.


$ rpm -V MySQL-devel-community-5.0.45-0.rhel3
missing  d /usr/share/man/man1/comp_err.1.gz
missing  d /usr/share/man/man1/mysql_config.1.gz

I suppose this is, albeit not ideal, tolerable?


Does PHP 4 perhaps come with it's own mysql library in the source?
Perhaps you have to pass an argument?


Yes, as of PHP4 the --with-mysql is on by default. I tried specifying  
--with-mysql-dir=/usr and also shared,/usr, but to no avail.


Chrs,
Dav

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



[PHP] Stopping objects from auto-serializing

2007-10-30 Thread David Christopher Zentgraf

Hi,

I'm trying to set up my PHP app at my host, but am stumbling over the  
PHP configuration there. register_globals is enabled, which seems to  
auto-serialize my objects into $_SESSION, which in some cases  
overwrites variables in there. I'm not sure if register_globals is  
where the auto-serialization comes from, but it seems to be closely  
related at least and I'm not in my best form today...


I tried putting "php_flag register_globals off" into an .htaccess  
file, but that throws an Apache misconfiguration error.

Using set_ini() doesn't seem to do anything either.

Any advise on how to turn serialization off without dabbling with the  
configuration file?


Chrs,
Dav

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



Re: [PHP] Stopping objects from auto-serializing

2007-10-30 Thread David Christopher Zentgraf

On 31 Oct 2007, at 13:50, Larry Garfield wrote:


Try:

php_value register_globals Off


Same Apache misconfiguration error. Even though the host actually  
requires me to enable PHP processing via an "AddHandler" .htaccess  
directive, php_flag/value directives are throwing an error. Weird.



...but turning register globals off anyway is a good thing.


Indeed.

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



Re: [PHP] Stopping objects from auto-serializing

2007-10-30 Thread David Christopher Zentgraf

On 31 Oct 2007, at 15:32, Jochem Maas wrote:

aside from this error (my guess is your not allowed to override it)  
I can't

see the problem of serialization .. don't put the object in $_SESSION?

...

what are you doing? show us the code?


I'm not putting the object in $_SESSION, but PHP apparently does on  
this specific configuration.
I'm saving an array of ids in $_SESSION["basket"], and on some pages I  
have an object called $basket.
Somehow this $basket gets saved into $_SESSION["basket"], where it  
simply does not belong because it makes my code barf.


Seems I'll have to rename my variables, but aside from this specific  
fix, I don't want any unneeded variables floating around my $_SESSION  
and I certainly don't want them to be globally_registered.


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



Re: [PHP] Stopping objects from auto-serializing

2007-10-30 Thread David Christopher Zentgraf


On 31 Oct 2007, at 16:16, Jochem Maas wrote:


are you using session_register()? (dont)
also are you setting the value in $_SESSION by reference?


No and no. The only time I'm writing to $_SESSION["basket"] is by  
setting $_SESSION["basket"][] = "foo", I'm never touching the actual  
$_SESSION["basket"] variable as such, but which is exactly what's  
happening.


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



Re: [PHP] Stopping objects from auto-serializing

2007-10-31 Thread David Christopher Zentgraf

After some more playing around and a lot of print_r($SESSION)'s:

This specific PHP configuration seems to replace every entry in  
$_SESSION if a variable with the same name is used in the main script  
with that variable.


I.e.
session_start() // $_SESSION["foo"] is now "bar"
$foo = "12345";
$var = "";

function test() {
$foo = "67890";
}
test();

After execution finished $_SESSION["foo"] is now "12345", but there's  
no $_SESSION["var"].

What's going on here?

On 31 Oct 2007, at 16:25, David Christopher Zentgraf wrote:



On 31 Oct 2007, at 16:16, Jochem Maas wrote:


are you using session_register()? (dont)
also are you setting the value in $_SESSION by reference?


No and no. The only time I'm writing to $_SESSION["basket"] is by  
setting $_SESSION["basket"][] = "foo", I'm never touching the actual  
$_SESSION["basket"] variable as such, but which is exactly what's  
happening.




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



Re: [PHP] Re: Stopping objects from auto-serializing

2007-10-31 Thread David Christopher Zentgraf

On 31 Oct 2007, at 17:23, hochprior wrote:


I got the following in my main .htaccess (and it works just fine...):
php_flag register_globals 0


Well apparently I'm not allowed to override register_globals.

Looking at the problem a little closer, it also doesn't seem like  
register_globals is the culprit. Browsing through the PHP bug reports  
a bit brought my attention to --enable-track-vars, which is enabled in  
my case. It sounds a little more like it has something to do with my  
problem, but I can't seem to find any documentation on this flag...


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



Re: [PHP] crop an image

2007-10-31 Thread David Christopher Zentgraf

Copying half a pixel? I dare say that's where the problem is.

Chrs,
Dav

On 31 Oct 2007, at 19:34, Merlin wrote:


Hi there,

I do have a small problem with the proportions of image copy

The image is originally vertical in 100px width and 141px height.
Now I want to crop it to 80 px width and 60px height. There should  
be no black area and the proportions should be OK. That means that I  
have to copy only part of the image. In this case it would be 40.5px  
from above (141-60 / 2 ) and until 100.5 (40.5+60).

This would crop the middle part of the image.

Now with imagecoyresampled I can set the starting point of 40.5px,  
but not the ending point. The image will have a black bottom.


Here is the code I am using:
imagecopyresampled($outputImg, $inputImg, 0,0, 0 , 40.5, 80, 60,  
$srcX, $srcY);


Thank you for any hint. Maybe somebody has a good idea on how to  
crop that image.


Best regards,

Merlin

--
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



Re: [PHP] Rendering problem (IE browser on windows + php on linux host)

2007-11-03 Thread David Christopher Zentgraf
What about comparing the pure HTML output of both servers _including  
headers_, for example with curl?


On 3 Nov 2007, at 23:46, Erick Paquin wrote:


Hi All,

If someone has seen this before it would greatly help me.

I have done a php site at work on my windows server. The site renders
perfectly in both Firefox & IE.

Transferred my site to my home server which is a ubuntu server.

Site renders perfect in Firefox but goes wacky in IE.

Thought this might be an apache/php config problem on my ubuntu server
so I tried to compare both my php.ini + apache config file and nothing
works so far.

Any Ideas?

Erick P.

--
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



[PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread David Christopher Zentgraf

Hi,

I want to offer visitors of my site the possibility of downloading  
printable, foldable pocket guides for certain things that come out of  
my database. The problem is that items will be entered into the  
database very frequently, so I need to automate the process of  
creating these guides. Since they're supposed to work like flyers,  
with a proper front and back etc, the layout will need to be very  
strict and adhere to a template. I was thinking about PDFs, since they  
should keep their layout in print no matter what. But how would I  
create PDFs from a template on the fly using PHP?

Or is HTML with a special print style sheet the better solution?

Anybody have any experience?

Chrs,
Dav

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



Re: [PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread David Christopher Zentgraf

On 27 Nov 2007, at 11:51, Chris wrote:


There are a few packages you can use.

http://pear.php.net/package/File_PDF
http://www.fpdf.org/

are two I know of, I'm sure there are more.


Thanks! The built-in PDFlib functions didn't seem to appealing, but  
FPDF looks pretty good. I'll certainly play around with it to see what  
it can do, but right of the bat it seems that templates aren't  
supported the way I would like them to. Importing a PDF is possible,  
but apparently they can only be treated like images.


Chrs,
Dav

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



Re: [PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread David Christopher Zentgraf

On 27 Nov 2007, at 12:25, Bastien Koert wrote:


you could also look at http://www.digitaljunkies.ca/dompdf/


Looks alright, but I'm wondering whether the results might be more  
accurate by laying the PDF out "by hand", instead of going through an  
intermediary step with CSS? I was also looking at http://pdml.sourceforge.net 
 with the same mixed feelings.


Chrs,
Dav

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



Re: [PHP] Create PDFs with a strict layout automatically

2007-11-27 Thread David Christopher Zentgraf

On 27 Nov 2007, at 14:09, Brady Mitchell wrote:

I had a similar situation where I needed to fill in the blanks on an  
existing PDF file. I used the createFDF function from http://koivi.com/fill-pdf-form-fields 
 in combination with pdftk (http://www.accesspdf.com/pdftk/) to  
merge the fdf data and pdf file into one.


Take a look at the fill_form and flatten options of pdftk.


Thanks, but by now I'm pretty much sold on the idea of FPDF and  
creating PDFs on the fly, inserting data I need as I go. Is there any  
advantage using pdftk?


Chrs,
Dav

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



Re: [PHP] Create PDFs with a strict layout automatically

2007-11-27 Thread David Christopher Zentgraf

On 27 Nov 2007, at 17:57, Brady Mitchell wrote:

FPDF is a great way to go - I've used it for other projects. Thought  
I'd share this method so you'd have more options. :)


Very much appreciated. :o)

I do want to include graphics dynamically as well, not just form data,  
so I think your approach wouldn't be quite as suited anyway(?).


Chrs,
Dav

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