[PHP] PHP and Zend

2005-06-05 Thread JamesBenson
PHP 4.3.11 / Apache 2.0.54 / Zend Optimizer 2.5 I have the above on fedora core 3, Ive ran the zend auto setup to install but when I open phpinfo.php the version of zend says:- This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, I directed apache to load the

[PHP] Re: missing $_GET

2005-06-05 Thread Ric Manalac
What PHP version is known to cause this type of problem? Does anyone know what specific configuration setting causes the $_GET to not catch values passed through the querystring? My hosting company's PHP version is 4.3.4. Below are some info from phpinfo(): register_globals is set to On

Re: [PHP] $date(l-m);

2005-06-05 Thread Jochem Maas
John Taylor-Johnston wrote: $mydata-lastinsalled = 2004-05; take a good look at mktime(); How can I determne if $mydata-lastinsalled is one year or more older than the current $date(l-m); Anyting simple and over looked? I have been browsing the manual::

Re: [PHP] Help with some OOP

2005-06-05 Thread Jochem Maas
JamesBenson wrote: Hello all, Ive been working with PHP for my websites for a few months, just attempted to build my own class, after reading all this stuff about automated robots and XSS attacks etc decided to step up security a bit, my result is an attempt to create a class for using the

[PHP] stripping html tags

2005-06-05 Thread Dotan Cohen
I took this example from php.net, but can't figure out where I went wrong. Why does this: $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i , , $text); throw this error: syntax error at line 265, column 39: $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i , , $text);

[PHP] Unbuffered Reads

2005-06-05 Thread Steven James Samuel Stapleton
Is there any way to perform an unbuffered read in PHP when reading from STDIN? I.E. if I have the code - $chr = ; while(!feof(STDIN)) { $chr = fgetc(STDIN); //I could just as easily do fread(STDIN, 1) if($chr == ) break; } - and enter the

Re: [PHP] ampersands in href's

2005-06-05 Thread Jack Jackson
Thanks! Leon Poon wrote: The simplest way to make sure everything work well regardless of what the values are: ? $url = somepage.php?var1=.urlencode($var1).var2=.urlencode($var2); echo a href=\.htmlspecialchars($url).\; ? htmlspecialchars() changes characters '', '', ''', '', '' into the

Re: [PHP] mozilla urlencode

2005-06-05 Thread Marek Kilimajer
John Taylor-Johnston wrote: This works: District of St. Francis http://www.glquebec.org/tezt.php#District+of+St.+Francis a name=District+of+St.+Francis/a This does not: Montréal District #2 http://www.glquebec.org/tezt.php#Montr%E9al+District+%232 a name=Montr%E9al+District+%232/a I'm

Re: [PHP] Deerpark (aka Firefox 1.1 alpha) URI's and PHP

2005-06-05 Thread Marek Kilimajer
Richard Lynch wrote: On Sat, June 4, 2005 3:53 am, Chris Drozdowski said: Will PHP scripts that work properly with the current version (1.0.4) of Firefox need to be modified for the feature detailed below in Firefox 1.1? See: http://www.mozilla.org/projects/deerpark/new-web-dev-features.html

Re: [PHP] stripping html tags

2005-06-05 Thread Marek Kilimajer
Dotan Cohen wrote: I took this example from php.net, but can't figure out where I went wrong. Why does this: $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i , , $text); throw this error: syntax error at line 265, column 39: $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i

[PHP] Parsing wml files as php

2005-06-05 Thread Dotan Cohen
I have gone over and over through google and various archives, but cannot come up with a solution even though I am convinced that this is a FAQ: I want to parse my .wml files. So in .htaccess I have: AddType application/x-httpd-php .wml AddType text/vnd.wap.wml .wml But it does not parse! If I

Re: [PHP] stripping html tags

2005-06-05 Thread Dotan Cohen
On 6/5/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Dotan Cohen wrote: I took this example from php.net, but can't figure out where I went wrong. Why does this: $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i , , $text); throw this error: syntax error at line 265, column 39:

Re: [PHP] Parsing wml files as php

2005-06-05 Thread Marek Kilimajer
Dotan Cohen wrote: I have gone over and over through google and various archives, but cannot come up with a solution even though I am convinced that this is a FAQ: I want to parse my .wml files. So in .htaccess I have: AddType application/x-httpd-php .wml AddType text/vnd.wap.wml .wml But it

[PHP] What is faster?

2005-06-05 Thread Andy Pieters
Hi all Of these two expressions, which one is faster? if(!(is_null($customMenu)) (is_array($customMenu))) $menu=$customMenu; else $menu=array('Documentation','Settings'); OR $menu=(!(is_null($customMenu)) (is_array($customMenu))?$customMenu:$menu); Anybody have any documentation on

Re: [PHP] Parsing wml files as php

2005-06-05 Thread Dotan Cohen
On 6/5/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Dotan Cohen wrote: I have gone over and over through google and various archives, but cannot come up with a solution even though I am convinced that this is a FAQ: I want to parse my .wml files. So in .htaccess I have: AddType

Re: [PHP] What is faster?

2005-06-05 Thread Mark Cain
I checked the first expression with 1,000 iterations and it took 0.00745 seconds. Here is the code I used. You can use it find the time for the second expression and any future which is faster queries you might have. This way you can create you own documentation. ? $start1 =

[PHP] Re: Exporting to MS Word or Excel

2005-06-05 Thread janbro
Hi, for Excel I'd use the pear package. If you need MS Word your only chance is probably DCOM. But that requires Windows and knowledge about configuration in DCOM. There is some docu on www.zend.com. Another chance could be to work with rtf files, but I remember only reading about it, never used

[PHP] Re: What is faster?

2005-06-05 Thread Matthew Weier O'Phinney
* Andy Pieters [EMAIL PROTECTED]: Of these two expressions, which one is faster? if(!(is_null($customMenu)) (is_array($customMenu))) $menu=$customMenu; else $menu=array('Documentation','Settings'); OR $menu=(!(is_null($customMenu)) (is_array($customMenu))?$customMenu:$menu);

Re: [PHP] Re: Unit testing ?

2005-06-05 Thread mbneto
Hi Matthew, Thanks for the reply. Your email confirmed what I've read/thought about the tests. I'll look this SimpleTest even tough PHPUnit2 seems to do the job fine. If you have more info (like books, urls, examples) please send me. regards. On 6/2/05, Matthew Weier O'Phinney [EMAIL

[PHP] Re: stripping html tags

2005-06-05 Thread Matthew Weier O'Phinney
* Dotan Cohen [EMAIL PROTECTED]: I took this example from php.net, but can't figure out where I went wrong. Why does this: $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i , , $text); throw this error: syntax error at line 265, column 39: $text =

Re: [PHP] Parsing wml files as php

2005-06-05 Thread Marek Kilimajer
Dotan Cohen wrote: On 6/5/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Dotan Cohen wrote: I have gone over and over through google and various archives, but cannot come up with a solution even though I am convinced that this is a FAQ: I want to parse my .wml files. So in .htaccess I have:

Re: [PHP] What is faster?

2005-06-05 Thread Robert Cummings
On Sun, 2005-06-05 at 12:24, Andy Pieters wrote: Hi all Of these two expressions, which one is faster? if(!(is_null($customMenu)) (is_array($customMenu))) $menu=$customMenu; else $menu=array('Documentation','Settings'); OR $menu=(!(is_null($customMenu))

Re: [PHP] ampersands in href's

2005-06-05 Thread Jochem Maas
Marek Kilimajer wrote: Jack Jackson wrote: Murray @ PlanetThoughtful wrote: If I want to make a link to a URL which includes some GETs can I just do: a href='{$_SERVER['PHP_SELF']}?p={$p}c={$s}' ... etc etc or must I escape the ampersand somehow? ... You should use amp; for all

Re: [PHP] Parsing wml files as php

2005-06-05 Thread Dotan Cohen
On 6/5/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Dotan Cohen wrote: On 6/5/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Dotan Cohen wrote: I have gone over and over through google and various archives, but cannot come up with a solution even though I am convinced that this is a FAQ:

Re: [PHP] Parsing wml files as php

2005-06-05 Thread M. Sokolewicz
Dotan Cohen wrote: On 6/5/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Dotan Cohen wrote: On 6/5/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Dotan Cohen wrote: I have gone over and over through google and various archives, but cannot come up with a solution even though I am convinced

Re: [PHP] mozilla urlencode

2005-06-05 Thread Jochem Maas
John Taylor-Johnston wrote: This works: District of St. Francis http://www.glquebec.org/tezt.php#District+of+St.+Francis a name=District+of+St.+Francis/a This does not: Montréal District #2 http://www.glquebec.org/tezt.php#Montr%E9al+District+%232 a name=Montr%E9al+District+%232/a I'm

Re: [PHP] Re: stripping html tags

2005-06-05 Thread Dotan Cohen
On 6/5/05, Matthew Weier O'Phinney [EMAIL PROTECTED] wrote: * Dotan Cohen [EMAIL PROTECTED]: I took this example from php.net, but can't figure out where I went wrong. Why does this: $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i , , $text); throw this error: syntax error at line

[PHP] looping through an array problem

2005-06-05 Thread Jack Jackson
This is something dumb I am doing but: Trying to pull all names of publishers in db. This sql: SELECT art.art_id,art.publisher_id,publisher.publisher_name, FROM art LEFT JOIN publisher ON publisher.publisher_id=art.publisher_id pulls (in phpmyadmin) four rows: artID pubID Publisher_name

Re: [PHP] How to find random records in a subset?

2005-06-05 Thread Jochem Maas
Brian Dunning wrote: I am using a routine to find 50 random records in a large MySQL how random does it need to be? if *psuedo* (nobody start on the computer random is not really random argument - go watch What the bleep do we know? instead) random is okay maybe you could define a list of

Re: [PHP] Re: stripping html tags

2005-06-05 Thread Paul Waring
On 6/5/05, Dotan Cohen [EMAIL PROTECTED] wrote: I don't want to strip out all the tags, just certain ones. You can use strip_tags() and tell it not to strip certain tags if you want, that feature has been available since PHP 3. -- Rogue Tory http://www.roguetory.org.uk -- PHP General Mailing

Re: [PHP] looping through an array problem

2005-06-05 Thread Mark Cain
One way to do it is to change this : $pub_sidebar[] = ul class='sidebar-menu'a class='img-link' to this: $pub_sidebar[$cartoon['publisher_id']] = ul class='sidebar-menu'a class='img-link' Mark Cain - Original Message - From: Jack Jackson [EMAIL PROTECTED] To: php-general@lists.php.net

[PHP] Re: looping through an array problem

2005-06-05 Thread M. Sokolewicz
Jack Jackson wrote: This is something dumb I am doing but: Trying to pull all names of publishers in db. This sql: SELECT art.art_id,art.publisher_id,publisher.publisher_name, FROM art LEFT JOIN publisher ON publisher.publisher_id=art.publisher_id pulls (in phpmyadmin) four rows: artID

Re: [PHP] looping through an array problem

2005-06-05 Thread Paul Waring
On 6/5/05, Jack Jackson [EMAIL PROTECTED] wrote: I'd like to stop the NY Sun from appearing twice! What have i missed here? There's nothing wrong with your PHP code as such (although you could filter out duplicates there if you wanted), all you should need to do is add the DISTINCT keyword to

Re: [PHP] Frames or iframes? (Basically The devil or deap sea or A rock and a hard place etc) - - - - (0T)

2005-06-05 Thread Rory Browne
On 6/4/05, Ryan A [EMAIL PROTECTED] wrote: Hey, .swf files are not cached by the browsers? Seems they are, so you don't need to care about frames. Simply output the html needed to load the flash file each time, the flash will be downloaded only once. .. Yep, but the

Re: [PHP] Re: missing $_GET

2005-06-05 Thread Chris Shiflett
Ric Manalac wrote: What PHP version is known to cause this type of problem? Does anyone know what specific configuration setting causes the $_GET to not catch values passed through the querystring? Well, $_GET hasn't always been around, so that's why the version can matter. Of course, this

Re: [PHP] looping through an array problem

2005-06-05 Thread Jochem Maas
Jack Jackson wrote: This is something dumb I am doing but: Trying to pull all names of publishers in db. This sql: its a mysql question in disguise, maybe...: SELECT DISTINCT art.art_id,art.publisher_id,publisher.publisher_name FROM art LEFT JOIN publisher ON

Re: [PHP] looping through an array problem

2005-06-05 Thread Brian V Bonini
On Sun, 2005-06-05 at 16:37, Jack Jackson wrote: This is something dumb I am doing but: Trying to pull all names of publishers in db. This sql: SELECT art.art_id,art.publisher_id,publisher.publisher_name, FROM art LEFT JOIN publisher ON publisher.publisher_id=art.publisher_id pulls

Re: [PHP] Re: stripping html tags

2005-06-05 Thread Brian V Bonini
On Sun, 2005-06-05 at 16:05, Dotan Cohen wrote: I don't want to strip out all the tags, just certain ones. But the problem turned out not to be in this peice of code- the script simply wasn't parsing. I started another thread with that problem after failing to fix it on my own. The

Re: [PHP] looping through an array problem

2005-06-05 Thread Jack Jackson
Thanks for all the replies. Jochem, thank you for this code, which will take me all night to understand (though I bet it works). I also note that SELECT DISTINCT worked here, too Also as many of you noticed before me, the art_id was in there as a fly in the ointment. Thanks all! Jochem

Re: [PHP] ampersands in href's

2005-06-05 Thread Rory Browne
I actually forgot that 's are supposed to be amp;'ed when putting them into SGML(HTML . XML, etc). I retract my previous statments on the matter. On 6/4/05, Jack Jackson [EMAIL PROTECTED] wrote: Rory Browne wrote: On 6/4/05, Jack Jackson [EMAIL PROTECTED] wrote: Hi, Rory Rory Browne

Re: [PHP] looping through an array problem

2005-06-05 Thread M. Sokolewicz
Jack Jackson wrote: Thanks for all the replies. Jochem, thank you for this code, which will take me all night to understand (though I bet it works). I also note that SELECT DISTINCT worked here, too Also as many of you noticed before me, the art_id was in there as a fly in the ointment. by

Re: [PHP] Re: stripping html tags

2005-06-05 Thread Dotan Cohen
On 6/6/05, Brian V Bonini [EMAIL PROTECTED] wrote: On Sun, 2005-06-05 at 16:05, Dotan Cohen wrote: I don't want to strip out all the tags, just certain ones. But the problem turned out not to be in this peice of code- the script simply wasn't parsing. I started another thread with that

Re: [PHP] Parsing wml files as php

2005-06-05 Thread Dotan Cohen
On 6/5/05, M. Sokolewicz [EMAIL PROTECTED] wrote: Dotan Cohen wrote: On 6/5/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Dotan Cohen wrote: On 6/5/05, Marek Kilimajer [EMAIL PROTECTED] wrote: Dotan Cohen wrote: I have gone over and over through google and various archives, but

Re: [PHP] looping through an array problem

2005-06-05 Thread Jack Jackson
M. Sokolewicz wrote: Jack Jackson wrote: Thanks for all the replies. Jochem, thank you for this code, which will take me all night to understand (though I bet it works). I also note that SELECT DISTINCT worked here, too Also as many of you noticed before me, the art_id was in there as a

Re: [PHP] Re: stripping html tags

2005-06-05 Thread Brian V Bonini
On Sun, 2005-06-05 at 18:13, Dotan Cohen wrote: On 6/6/05, Brian V Bonini [EMAIL PROTECTED] wrote: On Sun, 2005-06-05 at 16:05, Dotan Cohen wrote: I don't want to strip out all the tags, just certain ones. But the problem turned out not to be in this peice of code- the script simply

[PHP] Rnyhasnfb

2005-06-05 Thread Post Office
ALERT! This e-mail, in its original form, contained one or more attached files that were infected with a virus, worm, or other type of security threat. This e-mail was sent from a Road Runner IP address. As part of our continuing initiative to stop the spread of malicious viruses, Road Runner

Re: [PHP] Re: stripping html tags

2005-06-05 Thread Dotan Cohen
On 6/6/05, Brian V Bonini [EMAIL PROTECTED] wrote: On Sun, 2005-06-05 at 18:13, Dotan Cohen wrote: On 6/6/05, Brian V Bonini [EMAIL PROTECTED] wrote: On Sun, 2005-06-05 at 16:05, Dotan Cohen wrote: I don't want to strip out all the tags, just certain ones. But the problem turned

Re: [PHP] looping through an array problem

2005-06-05 Thread Jochem Maas
Jack Jackson wrote: M. Sokolewicz wrote: Jack Jackson wrote: Thanks for all the replies. Jochem, thank you for this code, which will take me all night to understand (though I bet it works). I also note that SELECT DISTINCT worked here, too Also as many of you noticed before me, the

Re: [PHP] mozilla urlencode

2005-06-05 Thread John Taylor-Johnston
Egads!! But thank you for the research. Back to the drawing board. John Jochem Maas wrote: John Taylor-Johnston wrote: a name=District+of+St.+Francis/a a name=Montr%E9al+District+%232/a I'm beginning to see the problem lies with the French character é. I don't see it being #. In any case, I

Re: [PHP] stripping html tags

2005-06-05 Thread Richard Lynch
On Sun, June 5, 2005 7:05 am, Dotan Cohen said: I took this example from php.net, but can't figure out where I went wrong. Why does this: $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i , , $text); throw this error: syntax error at line 265, column 39: $text =

Re: [PHP] Re: missing $_GET

2005-06-05 Thread Richard Lynch
On Sun, June 5, 2005 2:45 am, Ric Manalac said: What PHP version is known to cause this type of problem? Does anyone know what specific configuration setting causes the $_GET to not catch values passed through the querystring? I believe that in ALL PHP versions, if G is missing from that GPC

Re: [PHP] PHP and Zend

2005-06-05 Thread Richard Lynch
On Sun, June 5, 2005 12:08 am, JamesBenson said: This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.7, Copyright (c) 2003-2005, by Zend Technologies with Zend Optimizer v2.5.10, Copyright

[PHP] OO: inheritance and function naming

2005-06-05 Thread Script Head
i have the following structure: class product { function create() { // db stuff } } class product_model { function create() { // db stuff } } class product_submodel { function create() { // db class } } i would like class product to extend class product_model and class

[PHP] replace striing éèêà

2005-06-05 Thread John Taylor-Johnston
Can someone show me how to get rid of international characters in $string? Is there a function already made? You cannot use accented characters in a name reference : a name=montréal. I guess this below is a start. Is there a better way? John http://ca.php.net/manual/en/function.str-replace.php

Re: [PHP] Frames or iframes? (Basically The devil or deap sea or A rock and a hard place etc) - - - - (0T)

2005-06-05 Thread Ryan A
/* Personally I reckon: a) you should simplify that flash banner quite a bit. It keeps animating for a long time(forever?). You're drawing the readers attention away from the site, and to a flash banner. I think for subsequent pages, there should be no animation(at all), and for the initial page

Re: [PHP] OO: inheritance and function naming

2005-06-05 Thread Richard Lynch
On Sun, June 5, 2005 4:56 pm, Script Head said: i have the following structure: class product { function create() { // db stuff } } class product_model { function create() { // db stuff } } class product_submodel { function create() { // db class } } i would

Re: [PHP] replace striing éèêà

2005-06-05 Thread Chris
Look into strtr() http://www.php.net/strtr It seems to be precisely what you want. John Taylor-Johnston wrote: Can someone show me how to get rid of international characters in $string? Is there a function already made? You cannot use accented characters in a name reference : a

Re: [PHP] stripping html tags

2005-06-05 Thread Dotan Cohen
On 6/6/05, Richard Lynch [EMAIL PROTECTED] wrote: On Sun, June 5, 2005 7:05 am, Dotan Cohen said: I took this example from php.net, but can't figure out where I went wrong. Why does this: $text = preg_replace(/head(.|\s)*?(.|\s)*?\/head/i , , $text); throw this error: syntax error at

Re: [PHP] Re: stripping html tags

2005-06-05 Thread Chris Shiflett
Dotan Cohen wrote: IF you know every single tag that exists! And being how I only wanted to remove four of them, the list of 'what to remove' is so much more compact than the 'leave those' list! For what purpose are you wanting to remove tags? If this is for data that you plan to send to the

Re: [PHP] What is faster?

2005-06-05 Thread Chris Shiflett
Mark Cain wrote: I checked the first expression with 1,000 iterations and it took 0.00745 seconds. Here is the code I used. [snip] $start1 = vsprintf('%d.%06d', gettimeofday()); Although many would argue that it's pointless to worry over such small details (and they have valid

Re: [PHP] looping through an array problem

2005-06-05 Thread Jack Jackson
Forgive me if this comes twice: my ISP had a service blackout for three hours and I don't know what went: If my last post read (and I see that it did) that I was defending myself as opposed to falling ALL OVER my sword, I apologize: allow me to be clear: No, you're all correct and M.

Re: [PHP] looping through an array problem

2005-06-05 Thread Jack Jackson
Ah. I just remembered one reason I had done it involving the art_id field: I have more publishers in the db than are currently associated with artworks. I don't want a publisher to appear unless there is at least one image associated with it. So I did this to avoid having people see a link to

Re: [PHP] looping through an array problem

2005-06-05 Thread Jack Jackson
If my last post read (and I see that it did) that I was defending myself as opposed to falling ALL OVER my sword, I apologize: allow me to be clear: No, you're all correct and M. Sokolewicz doubly so: I had unintentionally selected fields from the wrong table for no reason other than lack of

[PHP] Displaying an Outlook Calendar on a webpage using PHP

2005-06-05 Thread Justin.Baiocchi
Hello all, I am trying to publish an Outlook Calendar on a web page using PHP and COM. I have managed to track down on the net some examples of how it could be done. The most promising is the code below. However, all that happens is that outlook.exe is started on the server, but nothing is