php-general Digest 26 Nov 2007 11:44:02 -0000 Issue 5148

2007-11-26 Thread php-general-digest-help
php-general Digest 26 Nov 2007 11:44:02 - Issue 5148 Topics (messages 265011 through 265021): Re: URL Parsing... 265011 by: Chris How to ask if private IP? 265012 by: Ronald Wiplinger 265013 by: Andrés Robinet 265014 by: mike 265021 by: Jochem Maas

[PHP] question regarding type hinting parameters of php functions

2007-11-26 Thread Dirk Thomas / 4wd media
Hi, i have tried a current snapshot of PHP 5.3 and have a question regarding type hinting. For example when using the function array_slice(array $array, int $offset, int $length) with a non-integer length parameter, what is the desired behavior? When calling array_slice($array, 0,

Re: [PHP] question regarding type hinting parameters of php functions

2007-11-26 Thread T . Lensselink
On Mon, 26 Nov 2007 10:29:40 +0100, Dirk Thomas / 4wd media [EMAIL PROTECTED] wrote: Hi, i have tried a current snapshot of PHP 5.3 and have a question regarding type hinting. For example when using the function array_slice(array $array, int $offset, int $length) with a non-integer

[PHP] Session cookie doesn't work

2007-11-26 Thread Teck
Hi, I'm working to use cookie to maintain session data across multiple pages in PHP4.42. I have the following two scripts, where I think the second file outputs a data in a session variable. file 1 - test_1.php # ?php session_set_cookie_params(360 * 24 * 3600);

Re: [PHP] Session cookie doesn't work

2007-11-26 Thread metastable
Hey, Your session will expire, regardless of the call to session_set_cookie_params. If you're looking to propagate a session across time, you should look at keeping your session data in a database (google: session_set_save_handler, there's a good tutorial on the zend site), then calling a

Re: [PHP] How to ask if private IP?

2007-11-26 Thread Jochem Maas
Ronald Wiplinger wrote: I use $aa=$_SERVER[REMOTE_ADDR]; and if(($aa==192.168.2.108) || ($aa==192.168.2.34)) { $aa=61.64.101.101;// for testing put in a public IP } However, I would like to cover all private IPs (192.168.x.x and 10.x.x.x and 172.??.x.x). How can I do that

Re: [PHP] Session cookie doesn't work

2007-11-26 Thread Teck
Thanks Stijn for your advice. I wonder if my session.save_path /var/lib/php4 is correct. Who should be the owner of the directory? Is there any permission settings I need to care about? I also consider session.cookie_path /. After searching, it means cookies are avaiable for all the

Re: [PHP] How to ask if private IP?

2007-11-26 Thread Jochem Maas
Ronald, I really dont care if my email doesn't reach you, making normal people jump through hoops because you want to avoid spam is not the right way to do things, next time I'll remember not to answer your questions as your not going to ['be able to'] read my answers: BLA BLA BLA This message

Re: [PHP] Session cookie doesn't work

2007-11-26 Thread metastable
Hey Teck, If the session works when you append the session id to the URL, I would think that the session_save_path is ok and writable. You can assure yourself that it is indeed the case, by going to your session.save_path and checking out the contents of the session files there. Better

[PHP] how do i get a printout of original multipart post data

2007-11-26 Thread Olav Mørkrid
hello how can i get a raw and untouched printout of a multipart/form-data POST? i need this to analyze what certain user agents do wrong when uploading files. what happens is that php just fails to put files into $_FILES, and gives no way of seeing the original posting and exactly what is wrong

Re: [PHP] how do i get a printout of original multipart post data

2007-11-26 Thread Robert . Degen
If you're with linux try netcat (nc) at listening mode. Something like (not exactly) nc -vtlp 80 and then submut against any localhost url. greetings - Ursprüngliche Nachricht - Von: Olav Mørkrid [EMAIL PROTECTED] Datum: Montag, November 26, 2007 1:52 pm Betreff: [PHP] how do i

Re: [PHP] Code Critique Please :)

2007-11-26 Thread Philip Thompson
On Nov 22, 2007 11:52 AM, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-11-22 at 12:46 -0500, Oscar Gosdinski wrote: There is something that i always wonder about Singleton pattern in PHP, do you really have a benefit using this pattern in PHP? The idea behind this pattern is

Re: [PHP] Code Critique Please :)

2007-11-26 Thread Martin Alterisio
2007/11/21, Simeon F. Willbanks [EMAIL PROTECTED]: Hello, I am trying to increase my knowledge and understanding of OO and OO Design Patterns. I'd like to request a critique of a program that extracts MySQL table information and translates it into XML. In the program, I tried to

Re: [PHP] URL Parsing...

2007-11-26 Thread Richard Heyes
Chris wrote: Richard Heyes wrote: well if you take a string (filename) and wish to change the end of it somone then I don't think str_replace() is the correct function. what's to say a script doesn't exist called 'my.cfm.php'? How does this: /\.cfm$/ take into account that? $ in regex's

Re: [PHP] session_destroy AND reload a page

2007-11-26 Thread Philip Thompson
On Nov 26, 2007 12:45 AM, Chris [EMAIL PROTECTED] wrote: Ronald Wiplinger wrote: If my user wants to logout, I want that the session will be destroyed and that he must start with the first page again (index.php) and a new session. Whatever I try he always gets the old sessions or he

Re: [PHP] How to ask if private IP?

2007-11-26 Thread William Betts
Below is a quick example. This isn't the best way to do it, just another way. I personally would convert them to integers then compare instead of doing it the way I'm doing it below. ?php function privateIP($ip) { if ( (($ip = 10.0.0.0) ($ip = 10.255.255.255)) || (($ip =

[PHP] Emailing dilemma

2007-11-26 Thread George Pitcher
Hi, I have almost 30 websites that use PEAR::Mail to send emails on behalf of users at universities (one site for each) to lecturers at the same university. The problem I have is that if a lecturer sets an 'Out of Office' status, it gets bounced back to my server instead of to the user at the

[PHP] Representing microtime() values

2007-11-26 Thread Tomi Kaistila
Hi everyone Here's a small problem that I haven't been able to figure out and hence I figured I'd post and see if anyone can explain this to me. It concerns the values that are being returned to me by the microtime() function. When I run a simple line, e.g. print microtime(true); or

Re: [PHP] URL Parsing...

2007-11-26 Thread Jochem Maas
Richard Heyes wrote: Chris wrote: Richard Heyes wrote: well if you take a string (filename) and wish to change the end of it somone then I don't think str_replace() is the correct function. what's to say a script doesn't exist called 'my.cfm.php'? How does this: /\.cfm$/ take into

[PHP] Re: dgettext vs. xgettext

2007-11-26 Thread news_yodpeirs
No ideas? Am I the only one using different domains with dgettext? What's the sense of it if you can't get the translations apart? Any hint is welcome ... [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Hi! I'm using dgettext() with different domains in one set of scripts

Re: [PHP] Emailing dilemma

2007-11-26 Thread Miles Thompson
George, Had this problem a year ago, although I'm not using PEAR. Have a look at http://ca3.php.net/manual/en/function.mail.php and this down in the additional_parameters(optional) section: For example, this can be used to set the envelope sender address when using sendmail with the *-f*

[PHP] SimpleXML error

2007-11-26 Thread Skip Evans
Hey all, I have some XML files I need to parse and then display (they have HTML formatting in them as well). They contain the following: ?xml version=1.0 ? !DOCTYPE html PUBLIC -//Gale//DTD Gale eBook Document DTD 20031113//EN galeeBkdoc.dtd html gale:versionNumber=OEB 1.2, Gale 1.3 head

Re: [PHP] SimpleXML error

2007-11-26 Thread Casey
I'm not sure, but try casting $xml-title to string, like this: $title = (string) $xml-title; On Nov 26, 2007, at 1:44 PM, Skip Evans [EMAIL PROTECTED] wrote: Hey all, I have some XML files I need to parse and then display (they have HTML formatting in them as well). They contain the

[PHP] PHP file slow, same file in HTML faster

2007-11-26 Thread Jose Toroscani Hernandez
All .php files are displayed in 10 seconds (aprox). Example: test.php htmlbodyhello world/body/html But, the same file with extension html (test.html), is displayed in 1 second. The system is: - RHEL 5 - PHP 5.1 - Apache I apreciate your help. Toroscani

[PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread David Christopher Zentgraf
Hi, I want to offer visitors of my site the possibility of downloading printable, foldable pocket guides for certain things that come out of my database. The problem is that items will be entered into the database very frequently, so I need to automate the process of creating these

Re: [PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread Chris
David Christopher Zentgraf wrote: Hi, I want to offer visitors of my site the possibility of downloading printable, foldable pocket guides for certain things that come out of my database. The problem is that items will be entered into the database very frequently, so I need to automate the

Re: [PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread David Christopher Zentgraf
On 27 Nov 2007, at 11:51, Chris wrote: There are a few packages you can use. http://pear.php.net/package/File_PDF http://www.fpdf.org/ are two I know of, I'm sure there are more. Thanks! The built-in PDFlib functions didn't seem to appealing, but FPDF looks pretty good. I'll certainly

Re: [PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread tedd
At 11:46 AM +0900 11/27/07, David Christopher Zentgraf wrote: Hi, I want to offer visitors of my site the possibility of downloading printable, foldable pocket guides for certain things that come out of my database. The problem is that items will be entered into the database very frequently,

Re: [PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread tedd
At 12:16 PM +0900 11/27/07, David Christopher Zentgraf wrote: On 27 Nov 2007, at 11:51, Chris wrote: There are a few packages you can use. http://pear.php.net/package/File_PDF http://www.fpdf.org/ are two I know of, I'm sure there are more. Thanks! The built-in PDFlib functions didn't seem

RE: [PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread Bastien Koert
you could also look at http://www.digitaljunkies.ca/dompdf/ bastien CC: php-general@lists.php.net From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Tue, 27 Nov 2007 12:16:45 +0900 Subject: Re: [PHP] Create PDFs with a strict layout automatically On 27 Nov 2007, at 11:51, Chris wrote:

Re: [PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread David Christopher Zentgraf
On 27 Nov 2007, at 12:25, Bastien Koert wrote: you could also look at http://www.digitaljunkies.ca/dompdf/ Looks alright, but I'm wondering whether the results might be more accurate by laying the PDF out by hand, instead of going through an intermediary step with CSS? I was also looking

Re: [PHP] Representing microtime() values

2007-11-26 Thread tedd
At 9:30 PM +0200 11/26/07, Tomi Kaistila wrote: Hi everyone Here's a small problem that I haven't been able to figure out and hence I figured I'd post and see if anyone can explain this to me. -snip- How exactly does PHP handle these values internally? Does anyone know? Tomi: Try this:

Re: [PHP] Create PDFs with a strict layout automatically

2007-11-26 Thread Brady Mitchell
David Christopher Zentgraf wrote: I'll certainly play around with it to see what it can do, but right of the bat it seems that templates aren't supported the way I would like them to. Importing a PDF is possible, but apparently they can only be treated like images. I had a similar situation

RE: [PHP] Representing microtime() values

2007-11-26 Thread Tomi Kaistila
Hi everyone Here's a small problem that I haven't been able to figure out and hence I figured I'd post and see if anyone can explain this to me. -snip- How exactly does PHP handle these values internally? Does anyone know? Tomi: Try this: http://www.webbytedd.com/b/timed/ HTH's tedd