php-general Digest 15 Sep 2006 06:36:58 -0000 Issue 4348

2006-09-15 Thread php-general-digest-help
php-general Digest 15 Sep 2006 06:36:58 - Issue 4348 Topics (messages 241800 through 241806): Re: R: [PHP] session_start() and fopen 241800 by: Christopher Weldon R: [PHP] R: [PHP] session_start() and fopen 241801 by: Fabri Re: Question on explode and join. 241802

php-general Digest 15 Sep 2006 18:39:46 -0000 Issue 4349

2006-09-15 Thread php-general-digest-help
php-general Digest 15 Sep 2006 18:39:46 - Issue 4349 Topics (messages 241807 through 241840): Re: Form to subscribe a yahoo group 241807 by: Manuel Lemos Re: RSS Creator 241808 by: Manuel Lemos Re: Pre-printed forms 241809 by: Google Kreme 241831 by:

[PHP] Months between two dates

2006-09-15 Thread Phillip Baker
Greetings Gents, I want to take two dates formatted as 11/1/1998 10/1/2008 And find out how many months have elapsed between them. I was wondering if there was a quick and dirty way to do this without a for loop. -- Blessed Be Phillip The House has passed a law that would abandon the

Re: [PHP] Months between two dates

2006-09-15 Thread Kyle
I will assume that your dates are stored in two variables $date1 and $date2 code $date1array = explode(/,$date1); $date2array = explode(/,$date2); // Assume Date 2 is later than Date 1 $months_apart = ($date2array[2] - $date1array[2])*12; // Month is later in date 1 than in date 2 // Find the

[PHP] Re: Form to subscribe a yahoo group

2006-09-15 Thread Manuel Lemos
Hello, on 09/06/2006 10:57 AM Wagner Garcia Campagner said the following: I have a web site and a yahoo group aswell. I want to add a form in my site so that the visitor can put his/her e-mail address and get subscribed in a yahoo group that i own. I already have this form working... but

[PHP] Re: RSS Creator

2006-09-15 Thread Manuel Lemos
Hello, on 08/31/2006 02:58 AM John Taylor-Johnston said the following: Has anyone created an RSS feed creator in PHP? I could make one fast enough, but ... You may want to take a look at this RSS writer class: http://www.phpclasses.org/rsswriter -- Regards, Manuel Lemos Metastorage -

Re: [PHP] Pre-printed forms

2006-09-15 Thread Google Kreme
On 14 Sep 2006, at 05:35 , Man-wai Chang wrote: How do you guys and gals use PHP+HTML+CSS to print a report to preprinted forms with precision? PDF. Printing support in HTML, even with CSS2 and 3, is primitive (and not well supported). Generating a PDF is pretty straight forward though.

Re: [PHP] Question on explode and join.

2006-09-15 Thread Google Kreme
On 13 Sep 2006, at 11:02 , Dave Goodchild wrote: $_SESSION['profane'] = false; foreach ($_POST as $value) { foreach ($swearbox as $profanity) { if (preg_match(/$profanity/i, $value)) { $errors = true; $_SESSION['profane'] = true;

Re: [PHP] security include from remote server

2006-09-15 Thread Miguel Vaz
Yes, 10 minutes after i sent my last email i realized that. They would be txt files, easily read anywhere. Encoders, you say? What do you mean? Pag At 02:16 15-09-2006, Jon Anderson wrote: If your sysadmins are trying to steal the code, all they'd have to

[PHP] Class question

2006-09-15 Thread Roger Helgesen
I have 3 classes, CLASS A,B and C class A { var $some_var; var $class_B; function A(){ $this-class_B = new B(); $this-some_var=2; } } class B { var $some_var; var $class_C; function B(){

Re: [PHP] Class question

2006-09-15 Thread Thomas Munz
Use 'extends' syntax for sub classes class A { var $some_var; var $class_B; function A(){ $this-class_B = new B(); $this-some_var=2; } } class B extends A { var $class_C; function B(){

Re: [PHP] Class question

2006-09-15 Thread Andrei
Well in this example it will get to an infinite loop, but anyway like Thomas said you must check into extending classes. Andy Thomas Munz wrote: Use 'extends' syntax for sub classes class A { var $some_var; var $class_B; function A(){

Re: [PHP] Class question

2006-09-15 Thread Roger Helgesen
What does $this-A(); do ?(in constructor of class B) does it make another instance of class A, and if not why do I have to parse vars to the A constructor ($this-A($var1,$var2))?. I dont think that is what I want. A can have many instances of B. B can have many instances of C.

[PHP] Just say hello

2006-09-15 Thread AraDaen
Hi from Spain. This is my first post and im sure it wont be last :) AraDaen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] correctly reading binary data from http post

2006-09-15 Thread Marek 'MMx' Ludha
Hi. I need to send large binary data over http post (so that urlencoding or base64 encoding is not an option). I use request like this: http://people.ksp.sk/~mmx/request (there is a zero byte between A and B). There are 3 bytes of data, but when I do ?php echo strlen($HTTP_POST_VARS['DATA']); ?

Re: [PHP] Just say hello

2006-09-15 Thread Joe Wollard
Hi AraDaen, and welcome to the list ;-) On Sep 15, 2006, at 7:32 AM, AraDaen wrote: Hi from Spain. This is my first post and im sure it wont be last :) AraDaen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing

[PHP] php - mysql query issue

2006-09-15 Thread Dave Goodchild
Hi all. I am building an online events listing and when I run the following query I get the expected result set: SELECT events.id AS eventid, name, postcode, start_time, dates.date FROM events, dates_events, dates WHERE dates_events.event_id = events.id and dates_events.date_id = dates.id AND

Re: [PHP] php - mysql query issue

2006-09-15 Thread Brad Bonkoski
Have you tried echoing out your query to run on the backend itself? Maybe there is some problem with how your join is being constructed... Perhaps a left outer join is called for? Hard to tell without having knowledge of your table structure and table data... -B Dave Goodchild wrote: Hi all.

Re: [PHP] php - mysql query issue

2006-09-15 Thread Dave Goodchild
On 15/09/06, Brad Bonkoski [EMAIL PROTECTED] wrote: Have you tried echoing out your query to run on the backend itself? Maybe there is some problem with how your join is being constructed... Perhaps a left outer join is called for? Hard to tell without having knowledge of your table structure

Re: [PHP] correctly reading binary data from http post

2006-09-15 Thread Arpad Ray
Marek 'MMx' Ludha wrote: I need to send large binary data over http post (so that urlencoding or base64 encoding is not an option). I use request like this: http://people.ksp.sk/~mmx/request (there is a zero byte between A and B). There are 3 bytes of data, but when I do ?php echo

Re: [PHP] security include from remote server

2006-09-15 Thread Jon Anderson
Miguel Vaz wrote: Yes, 10 minutes after i sent my last email i realized that. They would be txt files, easily read anywhere. Encoders, you say? What do you mean? This is one example. There are many more. http://www.zend.com/products/zend_guard I'm not sure if there are any

Re: [PHP] Months between two dates

2006-09-15 Thread Larry Garfield
Depending on what you mean by how many months, this could work too. $months = (strtotime($time2) - strtotime($time1)) / (60*60*24*30) That is, the number of seconds between those two dates divided by the number of seconds in a month (where month is normalized to 30 days). That may or may not

Re: [PHP] php - mysql query issue

2006-09-15 Thread Andrei
Also you should check if dates.date is a DATE type, not DATETIME. Lost some time on that when I wanted to select enregs for a specific date, field was DATETIME and I was querying `date` = '2006-01-01'... :p Andy Dave Goodchild wrote: On 15/09/06, Brad Bonkoski [EMAIL PROTECTED]

[PHP] Odd PHP memory issue

2006-09-15 Thread Matthew H. North
Hello All, I've been struggling with a rather obscure PHP memory issue for the last few days. Here's my setup: FreeBSD 5.5 Apache2.0, PHP 5.1.6, and MySQL 4.1.x compiled from scratch (that is, we're not using FreeBSD ports) PHP is compiled with --enable-memory-limit and the limit is set to 8MB

Re: [PHP] Odd PHP memory issue

2006-09-15 Thread Michael B Allen
On Fri, 15 Sep 2006 08:42:26 -0700 Matthew H. North [EMAIL PROTECTED] wrote: 6) Resources (think database resources) are automatically freed by garbage collection when there are no more references to them Resources can be persistent. Try traversing a small tree and print memory usage after

[PHP] !diff = same

2006-09-15 Thread Richard Lynch
I'm working on a project where I believe the code could be re-factored for a vast improvement. I'm interested in hearing about tools that are the opposite of diff The goal is to locate common chunks of code, and to re-factor them into include files, functions, whatever. -- Like Music?

Re: [PHP] Odd PHP memory issue

2006-09-15 Thread Richard Lynch
On Fri, September 15, 2006 10:42 am, Matthew H. North wrote: We're developing a web application that involves traversal of a hierarchical database structure (MySQL, PEAR::DB, and PEAR::DB::DataObject). Currently that traversal is done recursively, and involves visiting thousands of nodes in

Re: [PHP] php - mysql query issue

2006-09-15 Thread Richard Lynch
On Fri, September 15, 2006 7:35 am, Dave Goodchild wrote: Hi all. I am building an online events listing and when I run the following query I get the expected result set: Any ideas why not? I know it's more of a mySQL question so apologies in advance! Well, you'd have to tell us what's in

Re: [PHP] Pre-printed forms

2006-09-15 Thread Richard Lynch
On Thu, September 14, 2006 6:35 am, Man-wai Chang wrote: How do you guys and gals use PHP+HTML+CSS to print a report to preprinted forms with precision? I'm not good enough with CSS to answer this directly. If you find, as I suspect, that printers are just too diverse and outright flaky for

Re: [PHP] DOM Question. No pun intended.

2006-09-15 Thread Richard Lynch
Crude outside-the-box work-around... You are only looking for div and /div and what's between them, right? Playing with strpos and a simple stack for nested DIVs should let you hack this in a crude parser: ?php //Untested code, off the top of my head: $divs = array(); $stack = array(); $offset

[PHP] Session issues

2006-09-15 Thread Dave Goodchild
Hi all. I am using php sessions in an online events listing to carry around user data until all data is clean and then entering it into a database after the final form has been submitted. On the first form the user selects a category and postcode, and the processing script validates and cleans

Re: [PHP] Just say hello

2006-09-15 Thread Ryan A
RTFM Oops, sorry, that seems to be everyone favourite so thought i would be the first one to say it... and welcome to the list :) Cheers! -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron.

Re: [PHP] Just say hello

2006-09-15 Thread Dave Goodchild
Lea el f**king manual! On 15/09/06, Ryan A [EMAIL PROTECTED] wrote: RTFM Oops, sorry, that seems to be everyone favourite so thought i would be the first one to say it... and welcome to the list :) Cheers! -- - The faulty interface lies between the chair and the keyboard. -

RE: [PHP] Session issues

2006-09-15 Thread Brad Fuller
Is this only happening when the user clicks the back button in the browser? I recently had a similar problem with IE caching pages even when the header is set to (supposedly) prevent caching. Apparently there is a bug with IE which requires a specific workaround. The fields are pre-filled with

Re: [PHP] correctly reading binary data from http post

2006-09-15 Thread Marek 'MMx' Ludha
As I read through my first email again I see I didn't write clearly what I intended, sorry for this. I already have an application that sends binary data with requests like the one mentioned before. Now I need to parse those requests using PHP. Since the content-type is multipart/form-data,

Re: [PHP] security include from remote server

2006-09-15 Thread Richard Lynch
On Wed, September 13, 2006 6:48 pm, Miguel Vaz wrote: I am doing a php+mysql website at my office, hosted locally but open to the web, but i wouldnt like to host my files on our office server. You can use allow_url_fopen and then http://php.net/require (and include) will be able to suck

Re: [PHP] security include from remote server

2006-09-15 Thread Richard Lynch
On Thu, September 14, 2006 8:00 pm, Miguel Vaz wrote: Yes, right on the spot. Main reasons being code theft and using it on other projects. This being done by our office (its actually a college and i work in a multimedia department) system administrators, which are nothing left than

Re: [PHP] R: [PHP] session_start() and fopen

2006-09-15 Thread Richard Lynch
On Thu, September 14, 2006 1:17 pm, Fabri wrote: Hi Christopher: this is just a simplified code, I use it to generate some xml file, no loop is present. Try it as it is: you will find that two files will be generated while it should be only one. If you remove 'session_start()' then only

Re: [PHP] Question on explode and join.

2006-09-15 Thread Richard Lynch
$clean = $input; foreach($badwords as $badword){ $clean = preg_replace('/(\\W)$badword(\\W)/ims', '\\1' . str_repeat('*', strlen($badword)) . '\\2', $clean); } On Wed, September 13, 2006 11:51 am, Beauford wrote: Hi, I have a form which I want to check for inappropriate words before it is

[PHP] readdir

2006-09-15 Thread Toby Osbourn
I have been writing some code that visits each directory stored within one directory in turn, pics a random image from it and displays that image. I have the code working fine, apart from one small quirk that I can't really understand. In one version of the implementation, the directories

[PHP] loadHTML/loadHTMLFile - DOM functions

2006-09-15 Thread Leonidas Safran
Hello all, Again a question on the new DOM functions... The loadHTML function doesn't support any attribute and I'm wondering how to handle non-text content. Image tags from source webpage are loaded as objects or whatever; they appear as special chars(show source from browser shows big empty

RE: [PHP] readdir

2006-09-15 Thread Brad Fuller
According to php.net, the readdir() function simply reads the contents of the directory in the order which they are stored by the filesystem. One way to force the order would be to loop through the contents of the directory and store the directory names into an array, and use the functions

[PHP] Re: loadHTML/loadHTMLFile - DOM functions

2006-09-15 Thread Rob
How are you getting that output? Remember most of the functionality - other than the saveXML(), saveHTML() functions - output using UTF-8 (which you would need to convert to what ever encoding you need). Rob Leonidas Safran wrote: Hello all, Again a question on the new DOM functions...

[PHP] Re: loadHTML/loadHTMLFile - DOM functions

2006-09-15 Thread Leonidas Safran
Hello Rob, Thanks for answering (so fast)... :-) Remember most of the functionality - other than the saveXML(), saveHTML() functions - output using UTF-8 (which you would need to convert to what ever encoding you need). Well I did try before loadHTML call: $doc = new DomDocument('1.0',

Re: [PHP] Iteration through letter

2006-09-15 Thread Martin Alterisio
2006/9/14, Norbert Wenzel [EMAIL PROTECTED]: Hi, just for fun I tried the following code: code for($letter = 'A'; $letter = 'Z'; ++$letter) { echo($letter . ' '); } /code What surprised me was the output, which looked like this: A B C [...] Y Z AA AB AC [...] YY YZ I don't have any

[PHP] Re: loadHTML/loadHTMLFile - DOM functions

2006-09-15 Thread Rob
Is there a meta tag that specifies the encoding? When loading HTML that is also used to determine the encoding. I think I need to clarify the encoding issue: I'll bet when the document is loading, the encoding is being properly detected. When working with the elements however you are getting

Re: [PHP] readdir

2006-09-15 Thread Richard Lynch
On Fri, September 15, 2006 2:18 pm, Toby Osbourn wrote: I suppose my question put simply is, what is the default ordering of directories when PHP uses the readdir method? Whatever order the OS decides to use. In practice, it's whatever is convenient for that particular file system. So FAT,

Re: [PHP] PHP and mySQL dates

2006-09-15 Thread Richard Lynch
On Wed, September 13, 2006 5:56 am, Dave Goodchild wrote: Hi all. I am building an online events registry and have mapped out all the dates between Oct 1 2006 and Dec 31 2030, stored in the database as timestamps incremented by 86400 to give daily slots. I have output the values using the php

Re: [PHP] Affiliate system

2006-09-15 Thread Richard Lynch
On Wed, September 13, 2006 12:58 am, Peter Lauri wrote: What should I do if they do not allow cookies? I could amend a=1234 onto every url that they pass, but that would not be a beautiful solution. PHP's use transsid setting in php.ini does exactly that, only with the session ID, and you

Re: [PHP] Filter MS Word Garbage

2006-09-15 Thread Richard Lynch
The user contributed notes on php.net for str_replace has several solutions... On Tue, September 12, 2006 5:02 pm, Kevin Murphy wrote: I have a web form where trusted people will be inputing information that they usually copy/paste out of MS Word. While the people are trusted... MS Word isn't.

Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-15 Thread Richard Lynch
See if /Volumes exists. Then if /Volumes/foresight exists. Then iterate through each with opendir/readdir and see what's in there. Eventually, you will probably stumble over the issue... Like, maybe you have permissions on the share, but not the file, or ... On Tue, September 12, 2006 4:41

Re: [PHP] readdir

2006-09-15 Thread Larry Garfield
On Friday 15 September 2006 14:18, Toby Osbourn wrote: I suppose my question put simply is, what is the default ordering of directories when PHP uses the readdir method? And is there anyway to force a specific ordering to the directories before PHP searches down them? If you're on PHP 5, look

Re: [PHP] security include from remote server

2006-09-15 Thread Miguel Vaz
Hehe, you gave me some pretty good ideas to make my code sit safely elsewhere and leave them wondering where the entire site is coming from. Even if i dont get anything done remotely, at least i learned some nice things from you guys, so thanks anyway. And i love my

[PHP] Please tell me I dont know regex

2006-09-15 Thread william(at)elan.net
Please try below page/program on your system entering ab-cd and please tell me I dont know regex - because the way I see it the results of those tests should have been the same... --- htmlbodyform method=post action=?php