RE: [PHP] Creating a unique index ID

2006-03-13 Thread Jared Williams
> Hey all, > > I've got a project where I'm taking form information from the > user and writing records to several tables in a MySQL database. > > The problem I'm having is I need to write a unique number for > the ID column of the records. Auto increment won't work > because I could have

RE: [PHP] class constants

2006-03-07 Thread Jared Williams
Hi, ReflectionClass getConstant getConstants hasConstant http://www.ren.dotgeek.org/classbrowser/class.php?class=ReflectionClass Jared > -Original Message- > From: Arnaldo Gandol [mailto:[EMAIL PROTECTED] > Sent: 07 March 2006 21:03 > To: php-general@lists.php.net > Subject: [PHP] c

RE: [PHP] output Today's date

2006-03-06 Thread Jared Williams
> On Sat, Mar 04, 2006 at 07:01:55PM -0700, Paul Goepfert wrote: > > Hi all, > > > > ls there anyway I can set the date to the timezone of the clients > > timezone? For example, if a person opens the web page at 3/6 12:01 > > EST and another person opens the same page at 3/5 10:01 MST I would

RE: [PHP] PDO Changes from 5.0.x To 5.1.x

2006-03-01 Thread Jared Williams
Hi, Only way I know is to import them into the global scope with define() If (!defined(PDO_FETCH_ASSOC)) define('PDO_FETCH_ASSOC', PDO::FETCH_ASSOC); As for further differences, I'm not aware of any. Jared > > According to documentation, PDO globals constants in 5.0.3+ > were changed to cl

RE: [PHP] $_POST to function?

2006-02-24 Thread Jared Williams
> > Why are you passing the POST array? As it's superglobal why > not just work directly on it within the function? > Passing it has distinct advantages, like being able to test the function. Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/

RE: [PHP] base64_encode, forward slashes and mod_rewrite

2006-02-24 Thread Jared Williams
There are variants of base64, which replace the + / characters with something less likely to cause problems. http://en.wikipedia.org/wiki/Base64 Jared > > sorry Ive done it again, for anyones interest, you might have > to urlencode the string twice for mod_rewrite to accept > encrypted an

RE: [PHP] encrypted urls, mcrypt and mod_rewrite

2006-02-23 Thread Jared Williams
> Subject: Re: [PHP] encrypted urls, mcrypt and mod_rewrite > > Somehow this part of the string is a problem, it has > underscores, but there is probably other things in this. > > _%E5%D4%13%82%C9%DFN%5EFs%5E47%B2v%2F%D7%A4%0C%C6%9EnJ I'd base64 encode that first then urlencode :) > > On 23

RE: [PHP] "Nested Set Model" or "modified preorder tree traversal"

2006-02-22 Thread Jared Williams
Hi, As your using MySQL5, I'd recommend putting all the Nested Set code in stored procedures, that way the client doesn't need to know about anything about the method, and the left, right columns never need to be retrieved. Jared > I've been searching the web for the past few hours

RE: [PHP] Debugging custom streams

2006-02-10 Thread Jared Williams
> WILD GUESS!!! > > Since you're NOT closing off the streams, PHP is trying to > close them for you, but you've unset various variables and > whatnot, and confused PHP into fclose()ing the WRONG thing. Hmm, I said all streams are getting closed. If they were not then a malformed zip would be

RE: [PHP] Debugging custom streams

2006-02-10 Thread Jared Williams
Ahha, after some rethinking, I've dropped the append custom stream, as its not really required. And instead of using a custom in memory stream for handling the central directory stream, just using tmpfile(), the application error has disappeared. Jared > > >>Jar

RE: [PHP] Debugging custom streams

2006-02-10 Thread Jared Williams
> > > >>-Original Message- > >>From: Jochem Maas [mailto:[EMAIL PROTECTED] > >>Sent: 10 February 2006 14:17 > >>To: [EMAIL PROTECTED] > >>Cc: php-general@lists.php.net > >>Subject: Re: [PHP] Debugging custom streams > >&

RE: [PHP] Debugging custom streams

2006-02-10 Thread Jared Williams
> -Original Message- > From: Jochem Maas [mailto:[EMAIL PROTECTED] > Sent: 10 February 2006 14:17 > To: [EMAIL PROTECTED] > Cc: php-general@lists.php.net > Subject: Re: [PHP] Debugging custom streams > > Jared Williams wrote: > > > > Hi, > &

[PHP] Debugging custom streams

2006-02-10 Thread Jared Williams
Hi, Short version, is there any way of listing all open resources from within a PHP script? Think I may have a problem relating to the object/resource shutdown order within PHP, but cant see which custom stream handler still has an open resource. Long version... I've

RE: [PHP] Advanced PHP Chat

2006-02-08 Thread Jared Williams
Sitepoints' PAD http://www.sitepoint.com/forums/forumdisplay.php?f=147 Jared > > What would be the definitive PHP chat community to join for > someone who likes to discuss how things *should* be done, or > would be done > *properly* as opposed to the ol' "How do I ..."-style discussions? >

RE: [PHP] Remove atribute from links

2006-01-08 Thread Jared Williams
> I have an HTML document at home (the Firefox bookmarks > output) that I was trying to parse this morning, with many > links as such: > http://www.aximsite.com/articles/link.php?id=22"; > add_date="1130275531" last_charset="windows-1252" > id="rdf:#$FOQot">Knowledge Base: What Can I Do With My

RE: [PHP] load testing tools

2005-12-27 Thread Jared Williams
> Anyone have any opinions or suggestions on cheap/free load > testing tools for dynamic sites? Microsoft WAST http://www.microsoft.com/technet/archive/itsolutions/intranet/downloads/webstres.mspx Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php

RE: [PHP] High load Forum?

2005-12-22 Thread Jared Williams
Take a look at http://www.big-boards.com/ Jared > Hi, > > Im looking for a good forum thats supports high load. (Now > between 300-2.000 active sessions, much more in next 2 years) > > I have heard about vBulletin and PhpBB. At the moment I think > vBulletin is the best choice, because I k

RE: [PHP] Random Images with no duplicates?

2005-12-16 Thread Jared Williams
Hi, Just unset the ones you've picked "; unset($openFile[$r]); } ?> Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] XmlReader & DOC_TYPE

2005-12-15 Thread Jared Williams
Hi, Im using XmlReader to pass through XML which has a doctype, now the problem is I cannot see how to retrieve the publicId and/or systemId of the doctype declaration, is this possible or a limitation of libxml? http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> http://www.w3.org/19

[PHP] XmlReader & XInclude

2005-12-14 Thread Jared Williams
Hi, Does PHPs XmlReader support Xinclude ? Seems libxml does reading this post http://mail.gnome.org/archives/xml/2004-February/msg00190.html , but the corresponding constant seems missing in PHP Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://ww

RE: [PHP] IE6 not returning POST data from a textarea

2005-12-12 Thread Jared Williams
> Anyone know to get IE6 to return POST data from a textarea > when the text is pasted in? > > Works fine for Mozilla, etc. > > print_r($_POST) shows several and > values just fine. > If it doesn't have a name attribute, or is disabled IE won't include it in the post. Jared -- PHP Gene

RE: [PHP] Re: XmlWriter::writeDTD bug...

2005-12-07 Thread Jared Williams
> > Jared Williams wrote: > > > > PS. > > Yeah, thought it was libxml, hence didn't file a pecl > bug report. But > > there does seem a problem with this method as can't just have a > > publicId or a systemId, libxml function uses NULL as

RE: [PHP] Re: XmlWriter::writeDTD bug...

2005-12-07 Thread Jared Williams
> Jared Williams wrote: > > Hi, > > > > $writer = new XmlWriter(); > > ... > > > > $writer->writeDtd('html', '-//W3C//DTD XHTML 1.0 Strict//EN', > > 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#x

[PHP] RE: XmlWriter::writeDTD bug...

2005-12-07 Thread Jared Williams
> -Original Message- > From: Rob Richards [mailto:[EMAIL PROTECTED] > Sent: 07 December 2005 04:21 > To: [EMAIL PROTECTED] > Cc: php-general@lists.php.net > Subject: Re: XmlWriter::writeDTD bug... > > Jared Williams wrote: > > Hi, > &

[PHP] XmlWriter::writeDTD bug...

2005-12-06 Thread Jared Williams
Hi, $writer = new XmlWriter(); ... $writer->writeDtd('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); produces no whitespace between the public & system ids like... http://www.w3.org/TR/xhtml1/DTD/

RE: [PHP] Unnecessary if statement? Programming technique

2005-12-06 Thread Jared Williams
Hi, Why not for ($i = 0; $i < 100/100; ++$i) { for ($j = 0; $j < 100; ++$j) { // do something standard } // do something special for this occurence } Jared > -Original Message- > From: Steve McGill [mailto:[EMAIL PROTECTED] > Sent: 06 December 2005 10:1

RE: [PHP] PHP6, UTF & strlen

2005-11-28 Thread Jared Williams
> > Jared Williams wrote: > > Hi, > > Just been looking over some code, and saw > > > > if (strlen($data) !== file_put_contents($filename, $data)) > > > > > > where $data is UTF8, so wondering if this is going to >

[PHP] PHP6, UTF & strlen

2005-11-28 Thread Jared Williams
Hi, Just been looking over some code, and saw if (strlen($data) !== file_put_contents($filename, $data)) where $data is UTF8, so wondering if this is going to break in PHP6, if so what should be the equivalent code? Jared -- PHP General Mailing Li

[PHP] RecursiveDirectoryIterator & RecursiveFilterIterator

2005-11-26 Thread Jared Williams
Hi, Having trouble writing a RecursiveFilterIterator to exclude linked directories from the recursive listing.. class DXLinkDirectoryRecursiveFilter extends RecursiveFilterIterator { function accept() { return TRUE; } } interface DXDirectoryVisitor { function visit(Direc

RE: [PHP] How to build a XML DTD on "the fly"?

2005-11-18 Thread Jared Williams
> > Jared Williams wrote: > > > > There is no real standard for creating DTDs on the fly, and > therefore libxml/DOM doesn't have any methods afaik. > > > > The one method DOMElement::setIDAttribute() should work I > think, but > > whilst

RE: [PHP] How to build a XML DTD on "the fly"?

2005-11-18 Thread Jared Williams
> The code below lacks the part where the folling DTD attribute is > created: > > How can I create the above DTD attribute in the code below? > > // Creates an instance of the DOMImplementation class > $oDomImp = new DOMImplementation; > > // Creates a DOMDocumentType instance > $oDomDtd =

RE: [PHP] APC caching keys.

2005-11-18 Thread Jared Williams
> I have started making use of the APC extension to cache > opcodes, etc now I'm also trying to cache the output of some > sql queries and I want to use a hash of the query as key to > store/fetch the value e.g: > > apc_fetch(md5($qry)) > > does anyone know of a good reason (including perform

RE: [PHP] recursive queries-tree view implementation

2005-11-18 Thread Jared Williams
> Say I have an ancestry application where the users can enter > parents, children, etc. The children have children, etc. > > table people > id > parent_id > > what is the best way to pull this from the db minimizing the > number of queries to build a tree view of parents to chi

RE: [PHP] Multiple inserts as a single string?

2005-06-02 Thread Jared Williams
> > Thanks Richard that makes it clear. > > Thomas > > Hello Thomas, > > Thursday, June 2, 2005, 10:20:11 AM, you wrote: > > T> I have a bit of strange question: when wanting to insert multiple > T> records into the db, instead of looping through the set > and executing > T> mysql_query (wh

RE: [PHP] DOM: browse childnodes but not recursively

2005-05-28 Thread Jared Williams
> -Original Message- > From: Victor SpÄng Arthursson [mailto:[EMAIL PROTECTED] > Sent: 27 May 2005 17:25 > To: php-general@lists.php.net > Subject: [PHP] DOM: browse childnodes but not recursively > > Ciao! > > I really hope someone can help me on this, since I have been > putting in

RE: [PHP] Sorting Objects in an array by object properties

2005-05-28 Thread Jared Williams
> Hello list, > > I have an array which holds some objects. Each object > represent elements from an email header in a given mailbox. > Each object has properties like "from", "sendtime", "subject" etc. > > I want to sort the order of the objects in the array by their > attribute "sendtime" i

RE: [PHP] libxml_set_streams_context

2005-05-18 Thread Jared Williams
> -Original Message- > From: Bill Hoffman [mailto:[EMAIL PROTECTED] > Sent: 19 May 2005 00:46 > To: php-general@lists.php.net > Subject: Re: [PHP] libxml_set_streams_context > > > On May 18, 2005, at 4:10 PM, Jared Williams wrote: > > > Sure the ser

RE: [PHP] libxml_set_streams_context

2005-05-18 Thread Jared Williams
> > I'm trying to use libxml_set_streams_context() to load a > remote xml file via HTTP conditional GET with > DOMDocument::load() by stuffing an > 'If-Modified-Since: --- " HTTP header into the stream, but no > matter how I try it I always get an HTTP 200 response when I > know the last- modi

RE: [PHP] RSS news feed (slightly 0T)

2005-05-18 Thread Jared Williams
> > Hey, > > Can anyone suggest a few places where i can get some decent > tech/programming/php news feeds? > > I presently have the PHP.net feed (but its not too good > because the news does not change much in days) and I am using > yahoo's feeds for "software", "digital music" and "internet

RE: [PHP] RSS news feed (slightly 0T)

2005-05-18 Thread Jared Williams
> Hey, > > Can anyone suggest a few places where i can get some decent > tech/programming/php news feeds? > > I presently have the PHP.net feed (but its not too good > because the news does not change much in days) and I am using > yahoo's feeds for "software", "digital music" and "internet".

RE: [PHP] DOMDocument and html doctype

2005-05-14 Thread Jared Williams
> > On Sat, 2005-05-14 at 07:57, Jared Williams wrote: > > > Hi, > > > I've used loadHTML() to read a HTML file to DOM. This file starts > > > with a string like > > Transitional//EN"> > > > > > > Do someone know ho

RE: [PHP] DOMDocument and html doctype

2005-05-14 Thread Jared Williams
> Hi, > I've used loadHTML() to read a HTML file to DOM. This file > starts with a string like HTML 4.01 Transitional//EN"> > > Do someone know how I can access this string? By reading the > doctype back from DOMDocument I only found the name (HTML) > but nothing more... > Use $doc

RE: [PHP] libxslt and xml prolouge

2005-05-12 Thread Jared Williams
> Using libxslt and DOM to load up an xml file and display > within another file via 'include'.. Something is adding in > '' is there a switch or something that > turns this off? in the xsl stylesheet? Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http:

RE: [PHP] While and echoing HTML

2005-05-10 Thread Jared Williams
> > I guess it is the missing semicolon. > > > And you can write: > > echo "" > > as simply > > echo "$product_type" > I prefer echo '', $product_type, ''; No string concatenation, or variable replacement required. Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe

RE: [PHP] Any alternative to POST method FTP uploads from client computer?

2005-05-09 Thread Jared Williams
> Hi All, > > > > I need to implement the ability to ftp upload files from > client machines via a form in a web application I'm developing. > > > > From reading the PHP help, all I can find to perform this is > the POST method for handling file uploads > (http://au2.php.net/manual/en/f

[PHP] PHP5 DOM & compressed xml

2005-05-04 Thread Jared Williams
Hi, Has anyone got the DOM extension to load compressed XML transparently? libxml2 apparently has this feature, but it appears not present in PHP build. Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP5 DOM & compressed xml

2005-05-04 Thread Jared Williams
Hi, Has anyone got the DOM extension to load compressed XML transparently? libxml2 apparently has this feature, but it appears not present in PHP. Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Re: Templating engines

2005-04-28 Thread Jared Williams
> > Evert | Rooftop Solutions wrote: > > Yes, and that's how I read this reply =) > > > > About the subject, > > > > I'm working on a xml-based templating system, which caches all the > > steps it does, so it overcomes the slowness =) And ofcource > because I > > like xml and all the neith th

RE: [PHP] Round to the nearest X

2005-04-28 Thread Jared Williams
> I realize this is a dumb question but I just can't come up > with an equation that will do this and I don't see an > internal PHP function (for version 4.3) that will do this... > Basically I need to come up with an equation/algorithm that > will round any number up/down to the nearest X. >

RE: [PHP] Timetables

2005-04-26 Thread Jared Williams
> > On Mon, April 25, 2005 3:14 pm, Richard Collyer said: > > This is probably more of a db question but... > > Probably. > > > I am writing an employee database for work. The majority of it is > > simple enough however I am stuck on the timetabling. It has > to be done > > in PHP as there ar

RE: [PHP] To mysqli or not to mysqli

2005-04-20 Thread Jared Williams
> On 4/20/05, Jared Williams <[EMAIL PROTECTED]> wrote: > > Why not use PDO :) > > Pacific Decadal Oscillation? > > I'm stumped. PHP Data Objects http://www.php.net/pdo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] To mysqli or not to mysqli

2005-04-20 Thread Jared Williams
> Looks like mysqli is the new method of talking to mysql? > Should I be moving away from the legacy mysql_* functions? > I'm running php5 and mysql 4.1.11 on IIS5 and Apache 2. Why not use PDO :) Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.

php-general@lists.php.net

2005-04-19 Thread Jared Williams
> > For documents to conform to the XHTML recommendation, > ampersand characters much be encoded as &. The > documentation for PHP recognises this. The same applies to > HTML (with some exceptions that the session code will never > encounter), although the PHP documentation makes no mention of

RE: [PHP] Single SQL-statement in PHP to order...

2005-04-19 Thread Jared Williams
> > Hi there! > > > > I guess this is off-topic? but I want to know if this is > possible. (If > > there's anyone out there that have a solution, I would appreciate it > > though) > > > > I want to know if there is anyway of showing tables in PHP > in an order > > like this in a single SQL-stat

RE: [PHP] XSL problem

2005-04-18 Thread Jared Williams
> === > Problem: can't retrieve the "1" from the ERRORCODE tag. > > I've narrowed down the source to the xmlns attribute inside > the FMPXMLRESULT tag. Still can't figure out how to code it > to grab the "1" though. Any ideas? I've tried: > > /ERRORCODE > FMPXMLRESULT/ERRORCO

RE: [PHP] Re: Limiting Cpu usage

2005-04-11 Thread Jared Williams
> but i must give them php support or else they coulnot do > anything on the server... > im limiting them by functions , safe mode and more.. I've known atleast one hosting operation that compile their own custom PHP, to limit the impact of problematic code. The only thing I can remember that

RE: [PHP] php and javascript

2005-04-11 Thread Jared Williams
> On Sun, April 10, 2005 4:32 pm, Marek Kilimajer said: > > Assuming your form is named "Selection", you will have a javascript > > array document.forms['Selection'].elements['distID[]'] > available. You > > can try: > > > > alert(document.forms['Selection'].elements['distID[]'][0].value); > >

RE: [PHP] Including class of Exception in exception message

2005-04-09 Thread Jared Williams
> 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 Exce

RE: [PHP] How do I get the first element's key of an array of objects?

2005-04-07 Thread Jared Williams
> There has to be a better way. Something more elegant? key() http://php.net/key Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: Re[6]: [PHP] asking comment

2005-03-30 Thread Jared Williams
> > JW> I'll take absolutely bullet-proof and handled/supressed warnings, > JW> over relatively bullet-proof. > > That would be fine if your previous solution was absolutely > bullet-proof, or for that matter provided a solution for the > original problem of renaming uploaded files and keeping

RE: Re[4]: [PHP] asking comment

2005-03-30 Thread Jared Williams
> Sure, at the base level the issue is simply the uniqueness of > the filename. So there are several options open in this > regard. Either use an md5'd uniqid rand combination (as on > the uniqid manual page) and just go with that, operating > under the assumption that the chances of a conf

RE: Re[2]: [PHP] asking comment

2005-03-30 Thread Jared Williams
> JW> You cannot guarentee the filename you think doesn't exist with the > JW> file_exists() doesn't exist when you eventually fopen() it, > JW> otherwise. > > Using the original posters method, I agree. But there are > plenty of ways around this without forcing a warning to occur > (or having

RE: [PHP] asking comment

2005-03-30 Thread Jared Williams
> JW> If want to create a unique filename, and are using PHP4.3.2 or > JW> better, use fopen() with the 'x' or 'x+' mode, rather than > JW> file_exists(). > > If you're happy with your scripts generating E_WARNING's all > over the place then yes. Personally, I'm not. Use @ to surpress them.

RE: [PHP] asking comment

2005-03-30 Thread Jared Williams
> > I got a bit frustrated with image upload stuff with different > image name problems. So I created a system that gives the > uploaded imaged a random numeric name between 1-10 000 000 > and saves the file to a server folder and the image name to mysql DB. > > Is there a so sort of a problem

RE: [PHP] String format best practice

2005-03-29 Thread Jared Williams
> > I need to output a Hex value, e.g.: > > > > 686E8AF8 > > > > In the following format: > > > > 68 6E 8A F8 > > > > In other words, separated by spaces. Now I realize there > are a million > > ways to do this, but I would like a suggestion on which you > think is > > the most efficient? Incid

[PHP] Re: Weird WMV/Media Player behaviour (Loading media file twice)

2005-03-07 Thread Jared Williams
> Does anyone have any idea why this is happening and how I can avoid > this double request? Try checking the UserAgent for each request. http://support.microsoft.com/default.aspx?scid=kb;en-us;293792 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/uns

RE: [PHP] Illegal characters in HTML form element names.

2002-09-17 Thread Jared Williams
ems to me, the rules for valid IDs & NAMEs are the same... -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]] Sent: 17 September 2002 12:43 To: 'Jared Williams'; [EMAIL PROTECTED] Subject: RE: [PHP] Illegal characters in HTML form element names. > -Or

[PHP] Illegal characters in HTML form element names.

2002-09-11 Thread Jared Williams
Hi, The HTML standard defines the set of characters that are valid in form element names. It does not include [ or ] and yet this seems to be the only way to get a set of form elements grouped into an array for server side processing. Why doesnt PHP do (Perl/ASP) automatically create an array