[PHP] PHP Source File Encoding

2006-11-11 Thread C Drozdowski
Gotta a question whose answer should be really obvious to me but, for some reason, is just eluding me. Which encodings can PHP handle for source files? I've been using iso-8859-1 but what about utf-8? Thanks, C Drozdowski -- PHP General Mailing List (http://www.php.net/) To unsubscribe

[PHP] Including class of Exception in exception message

2005-04-09 Thread C Drozdowski
I'm using Exceptions and variously handling them in try..catch blocks or defaulting to my set_exception_handler handler. When I create an Exception I'd like to prepend the class of the Exception to the message. Can this be done with code or do I have to hard code the name of the Exception class

[PHP] Smart Trimming of UTF-8 Entities for Database

2005-04-07 Thread C Drozdowski
I need to be able to store UTF-8 characters from a form into a MySQL table. But I need to support pre-UTF-8 MySQL ( 4.1). So I'm converting UTF-8 characters into their numeric entities (e.g. ñ = #241;). The problem is that if the user enters a character that gets converted to an entity, the

[PHP] Why do I have to declare __set if I declare __get for read-only properties?

2005-04-04 Thread C Drozdowski
Howdy, I'd like to access some of the private members of my classes as read-only properties without resorting to function calls to access them. (e.g. $testClass-privateMember instead of $testClass-privateMember(), etc) Based on my research and testing, using the __get and __set overloading

[PHP] Using header(0 to manage user inactivity

2005-04-03 Thread C Drozdowski
I'd like to be able to timeout a user if they are inactive for X minutes. Say, if they walk away from the browser leaving sensivive data in plain view. Is there any reason that using the header() function as below wouldn't be a reliable way to do this (albeit user-unfriendly)? It works for me

[PHP] Re: mySQL outputting XML

2005-03-25 Thread C Drozdowski
There is a pear package that does this: XML_sql2xml. It's at: http://pear.php.net/package-info.php?pacid=18 There is more info at: http://php.chregu.tv/sql2xml/ It's pretty flexible. But not so complicated that you cannot read through the code to figure out what's going on. -- PHP General

[PHP] Borrowed code- how to give credit

2005-03-22 Thread C Drozdowski
Hey, I used a single line of code (ver batim) from a pear class in my own code. I try to always be honest and not steal code but this single line does exactly what I need. The code is for a NPO website and will never be sold or anything like that. How should I give credit for the line of code

[PHP] PHP 5 DOM, XPath, UTF-8, and Form Input

2005-03-19 Thread C Drozdowski
I have been doing some testing and need confirmation that the following is correct. You have a DOMDocument that potentially contains UTF-8 encoded data (it might not however). You want to search it via DOMXpath-query() using a value that comes from a $_POST value. If the page that posts the

[PHP] XPath Query Exressions and Quote Characters

2005-03-16 Thread C Drozdowski
I've got a problem with quote characters and building XPath query expressions (PHP 5.0.3). What do I need to do to get them to work? I've tried various encoding functions but cannot figure it out. Given this expression, if $id contains one or more double quotes, an error is thrown. $query =

[PHP] Re: XPath Query Exressions and Quote Characters

2005-03-16 Thread C Drozdowski
. ']'; Variable Assignment: $name = utf_encode('Home'); Using the expression throws the Invalid Predicate Error. On 2005-03-16 12:06:24 -0500, [EMAIL PROTECTED] (Jason Barnett) said: C Drozdowski wrote: ... $query = '//book/chapter' . '[EMAIL PROTECTED]:id=' . $id . ']'; First of all check the XPath