[PHP] Get list of timezones from UTC offset

2007-08-05 Thread Norbert Wenzel
As far as I understand it is only possible to create a DateTimeZone Object from a string, which describes the timezone. On the other hand it is not possible (at least I did not find any possibility) to get the users tz string, it is only possible to get the current UTC offset. (via JavaScript

[PHP] Iteration through letter

2006-09-14 Thread Norbert Wenzel
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 idea how these letters get printed out, so I'd

[PHP] Re: Iteration through letter

2006-09-14 Thread Norbert Wenzel
Norbert Wenzel wrote: 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 idea how these letters get

[PHP] Built-in Interface to rewrite empty() ?

2006-09-12 Thread Norbert Wenzel
Hi, I think I once knew a PHP5 interface, which forces a class to implement a function empty(). If an object $myObject implements this interface, it should be possible to call empty($myObject) as it seems to work with the interface Countable, which does the same for count(). The problem is

[PHP] Re: Accessing data posted from a different URL

2006-03-21 Thread Norbert Wenzel
Manuel Lemos wrote: For instance, if you use method=post because XHTML specification says everything should be in lower case, you will have problems with some browsers and e-mail programs that only accept POST in upper case and fallback to GET when they find something else. i would call that a

Re: [PHP] Callbacks in XML Parser

2005-12-18 Thread Norbert Wenzel
://php.net/manual/en/function.xml-set-object.php Norbert Wenzel wrote: Robert Cummings wrote: On Sat, 2005-12-10 at 11:25, mail wrote: xml_set_element_handler($parser, xml_start_element, xml_stop_element); //can't find function use array notation for object method handlers

[PHP] XML Parsing german special chars

2005-12-14 Thread Norbert Wenzel
I did some easy xml parsing on the last.fm[1] recent tracklist. I do read in all the tracks and output them encoded with htmlentities(). A lot of german special chars like the Ä (Auml;) are transfered to strange followings of an A with any sort of available accent. But it isn't replaced by

Re: [PHP] OO XML Parser

2005-12-11 Thread Norbert Wenzel
Robert Cummings wrote: On Sat, 2005-12-10 at 11:25, mail wrote: xml_set_element_handler($parser, xml_start_element, xml_stop_element); //can't find function use array notation for object method handlers: xml_set_element_handler ( $parser, array( $this, 'xml_start_element' ),

[PHP] Re: PDF Generator

2005-12-05 Thread Norbert Wenzel
Dan Harrington wrote: I have a TON of forms that I have to populate, can I make a PDF file using Acrobat Professional, and then use PHP to populate those forms and have text inserted into the pre-made text fields that I made using Acrobat? And if so, what is the best tool for that? I'd prefer

[PHP] Re: PDF Generator

2005-12-04 Thread Norbert Wenzel
Rick Lim wrote: What is the best FREE pdf generator for PHP? i used FPDF without any problems. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: italic, bold and underline with GD ?

2005-11-07 Thread Norbert Wenzel
David wrote: Can we use some function with GD to make text italic, bold and/or underline? http://php.net/imagettftext I see we can change size and font, but not style it's not possible in PHP? Thanks in advance David I'm not familiar with GD, but as every good font has different versions

[PHP] Re: Making functions available from another script

2005-11-07 Thread Norbert Wenzel
Richard Leclair wrote: Hi PHP-ers, Here's an easy one: Q: How can I make a function available from within another php script? Eg. B.php contains: ?php include .../fns.php ? Which has a function fn($x); Later on, I want to include this function in B.php somewhere. In short: B.php wants to

Re: [PHP] Re: Making functions available from another script

2005-11-07 Thread Norbert Wenzel
Richard Leclair wrote: Hi Norbert, Thanks for your reply. Yeah, you were almost there - it wasn't quite what I had in mind. I probably should have elaborated on this one. I'm looking at building up a library of handy functions that can be included in a current script. Only problem is:

Re: [PHP] prevent user from getting scripts outside the web folder[this better?]

2005-10-14 Thread Norbert Wenzel
Ben wrote: My understanding is that mysql_real_escape_string will only work while you are connected to mysql. Not sure if that is the case in your situation. At least it requires a connection to mysql. I had an error, when using it without any connection opened before, that

[PHP] Auto unzip uploaded file

2005-09-30 Thread Norbert Wenzel
I know a script (it's a webgallery) where you upload your images.zip with any amount of images in it. After uploading the .zip get unzipped and the images will be placed into the gallery. How did they unzip (or better, how is it possible to unzip) the file with php? and is it possible to

Re: [PHP] Auto unzip uploaded file

2005-09-30 Thread Norbert Wenzel
Jochem Maas wrote: Norbert Wenzel wrote: I know a script (it's a webgallery) where you upload your images.zip with any amount of images in it. After uploading the .zip get unzipped and the images will be placed into the gallery. How did they unzip (or better, how is it possible to unzip

Re: [PHP] Strange behaviour overriding methods in 5.0.4

2005-09-29 Thread Norbert Wenzel
I have to say thank you to you both. In fact I still don't know what exactly was wrong or may have caused this error (output buffering was off, and there was no @ in the whole file) but after a night of sleep I tried again before reinstalling the server and everything worked as fine as it

[PHP] Re: updating forms

2005-09-29 Thread Norbert Wenzel
(hope) wrote: i have a text area on my page. As page is uploaded it displays certain text in it. It has also has a text area with same text that is being displayed above in the page . If user changes this text of text area n presses submit button the page needs to display updated text in the

[PHP] Strange behaviour overriding methods in 5.0.4

2005-09-28 Thread Norbert Wenzel
Hi, i have a very strange example of code. Maybe you know where my mistake could be. I've got an index.php with a few div's and a short php code, like: divecho $_SESSION['view']-getContent();/div The view is in every case one of my view objects. And there's the problem. In my specific case

[PHP] Re: Strange behaviour overriding methods in 5.0.4

2005-09-28 Thread Norbert Wenzel
Norbert Wenzel wrote: divecho $_SESSION['view']-getContent();/div of course this echo IS in ?php ?, i just forgot here in my message -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] passing a variable with php_self

2005-09-27 Thread Norbert Wenzel
A.J. Brown wrote: a href=?=$PHP_SELF?action=bigger? works well too works only if register_globals is on, doesn't it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: session

2005-09-20 Thread Norbert Wenzel
Roman Duriancik wrote: ? session_start(); session_register('pocet'); $count++; echo $count; session_destroy(); ? a href=test.php??php echo(SID)?link/a and when i click on link always I have in $count value 1 but I need value 2,3, how to do it ? i think this is what you

[PHP] Dynamically determine class

2005-09-14 Thread Norbert Wenzel
Hi, I'm using PHP5 and try to do something like this: I have a base class called 'Entry' and a child class called 'ExtendedEntry'. I want to read all Entries to a certain topic from a database. While constructing the EntryObject I would like to look if Entry is a simple Entry or an

Re: [PHP] Dynamically determine class

2005-09-14 Thread Norbert Wenzel
Thanks. Norbert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: How to force a variable to be a custom object?

2005-09-02 Thread Norbert Wenzel
Alex Gemmell wrote: Just a quickie today: I was wondering if I can declare a Class variable as a certain type of object. I'm using PHP 4 by the way. I don't know if this works in PHP4, but I would suggest to clear this in your constructur. But I don't know if this is always called in PHP4.

[PHP] Re: Catching all errors and redirecting

2005-08-19 Thread Norbert Wenzel
Thomas Hochstetter wrote: Hi again, Is it possible to catch all parser errors (notices), and as that happens redirecting to a 'sorry-page-not-available-at-this-moment' page, whilst storing the error (or notice) message somewhere else (e.g. emailing it to the developer). thanks Thomas From

[PHP] [OFF: logical question] rounding in steps of 15

2005-08-18 Thread Norbert Wenzel
Excuse me, I know my question is not PHP specific, but I hope there are some logical and mathematical talents in here, since I've always been fighting with maths. ;-) I have to provide a textfield, where workers enter their time they worked on a certain subject. The smallest degree should be

Re: [PHP] [OFF: logical question] rounding in steps of 15

2005-08-18 Thread Norbert Wenzel
Richard Lynch wrote: You're on your own converting 1:38 or 357 into minutes, but: $minutes = 357; $minutes = 15 * round($minutes / 15); echo minutes: $minutes\n; Thank you both. The conversion from 1:38 to 98 is no problem, but I knew there was a more beautiful way round to 15 minutes.

Re: [PHP] force download

2005-08-11 Thread Norbert Wenzel
Sebastian wrote: some of my users are complaining that when they try download media files (mp3, mpeg, etc) their media player opens and doesn't allow them to physically download the media. These are IE users, firefox seems to like my code, but IE refuses to download the file and plays it

Re: [PHP] force download

2005-08-11 Thread Norbert Wenzel
Richard Lynch wrote: Right-click is NOT universal. Macs don't even *have* a right-click! Doesn't Ctrl-Click do the same as a right click? Norbert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] display error line in object method

2005-08-11 Thread Norbert Wenzel
Richard Lynch wrote: There may also be some fancy new way to output the whole stack of functions called... I haven't really checked that out yet. The function stack is printed by debug_backtrace(), isn't it? Supported by PHP since 4.3.0. Norbert -- PHP General Mailing List

[PHP] Re: dynamically selecting a function

2005-08-08 Thread Norbert Wenzel
Thomas wrote: Hi there, How can I do something like this: [snip - theoretical code] if( isset($step) ) echo step.$step() ) [/snip] $step would be an int (I would check that before) and then I would have all sorts of functions like step1(), step2() . etc. Any ideas?

Re: [PHP] Re: dynamically selecting a function

2005-08-08 Thread Norbert Wenzel
Thomas wrote: Thanks Burhan. Is there much overhead? Norbert: that's what I am doing now, just wanted to save some code. :-) Thomas -Original Message- From: Norbert Wenzel [mailto:[EMAIL PROTECTED] Sent: 08 August 2005 11:18 AM To: php-general@lists.php.net Subject: [PHP] Re

[PHP] Inherit Methods

2005-08-08 Thread Norbert Wenzel
Is it possible to run inherited methods in the scope of the child class? In my case I have an abstract class called 'Company' and some child classes. There is a non abstract function in 'Company' which prints '$this-phoneList'. That function should be the same to all child classes, without

Re: [PHP] Inherit Methods

2005-08-08 Thread Norbert Wenzel
Jochem Maas wrote: Norbert Wenzel wrote: private $var; get rid of the 'private' here and replace it with 'protected' too stupid. I'm sorry for my question. thank you for opening my eyes. norbert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

[PHP] Re: overwrite private class members in php5?

2005-08-05 Thread Norbert Wenzel
Matthew Weier O'Phinney wrote: * Norbert Wenzel [EMAIL PROTECTED]: Hi, I've done something like this: class MyClass { private $var; function __construct($value) { $this-var = $value; } public function printVar() { echo($this-var); } } $object = new MyClass('1'); $object

[PHP] Exceptions: function x throws Exception

2005-08-05 Thread Norbert Wenzel
If there is a class with a function, that might throw exceptions and does NOT catch them, may I write that like in Java? class FooClass { public function foo() throws Exception { } } Or is there another possibility to tell a function throws an exception and to force the

Re: [PHP] Exceptions: function x throws Exception

2005-08-05 Thread Norbert Wenzel
Torgny Bjers wrote: The Java way doesn't work here. The best approach would be to simply run a try/catch/finally around the call to your function/method, and inside the function itself you do the following: if (...) { throw new Exception(My message.); } } Hello Torgny, Thanky you for your

[PHP] overwrite private class members in php5?

2005-07-29 Thread Norbert Wenzel
Hi, I've done something like this: class MyClass { private $var; function __construct($value) { $this-var = $value; } public function printVar() { echo($this-var); } } $object = new MyClass('1'); $object-printVar(); // prints 1 $object-var = 3; // Fatal Error as expected

[PHP] Re: overwrite private class members in php5?

2005-07-29 Thread Norbert Wenzel
Norbert Wenzel wrote: public function printVar() { echo($this-var); } I have to do a little correction, i wrote $this-$var to see the variable, otherwise i don't see anything. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php