Re: [PHP] Re: How to re-order an array

2006-06-13 Thread Paul Novitski
At 07:53 PM 6/11/2006, jekillen wrote: I force the user to have javascript enabled Oops. Unless you're working IT in a penal colony, I suspect that what you really mean is that you choose to serve broken pages or no content at all to users who don't have JavaScript enabled, whether by

[PHP] Dettach problem

2006-06-13 Thread grape
Hi all, I would like run a php-script via CLI which outputs some information to stdout, and then go into background. I use code similar to this to fork and to dettach the child I/O from the TTY (some error handling removed to improve readability) ? echo Hello from parent\n;

[PHP] Help with some clever bit operations

2006-06-13 Thread Niels
Hi, I have a problem I can solve with some loops and if-thens, but I'm sure it can be done with bit operations -- that would be prettier. I've tried to work it out on paper, but I keep missing the final solution. Maybe I'm missing something obvious... The problem: A function tries to update an

[PHP] Re: Help with some clever bit operations

2006-06-13 Thread Barry
Niels schrieb: Hi, I have a problem I can solve with some loops and if-thens, but I'm sure it can be done with bit operations -- that would be prettier. I've tried to work it out on paper, but I keep missing the final solution. Maybe I'm missing something obvious... The problem: A function

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread David Tulloh
The example starting values $existing = 181; # = 10110101 $new = 92; # = 01011100 $mask = 15; # = Get the bits that will be changed $changing = $new $mask; # = 12 = 1100 Get the bits that won't be changed $staying = $existing ~$mask; # = 176 = 1011 Combine them together

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread Jochem Maas
Niels wrote: Hi, I have a problem I can solve with some loops and if-thens, but I'm sure it can be done with bit operations -- that would be prettier. I've tried to work it out on paper, but I keep missing the final solution. Maybe I'm missing something obvious... The problem: A function

[PHP] Seeking recommendations for use of include()

2006-06-13 Thread Dave M G
PHP List, Up until now, in order to get all the functions and classes I need in my scripts, I have always made a file called includes.php that contains a series of include() statements for all of the files that I want to include. Then I just include that one file at the top of all my PHP

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread Jochem Maas
David Tulloh wrote: The example starting values $existing = 181; # = 10110101 $new = 92; # = 01011100 $mask = 15; # = Get the bits that will be changed $changing = $new $mask; # = 12 = 1100 Get the bits that won't be changed $staying = $existing ~$mask; # = 176 =

RE: [PHP] Help with some clever bit operations

2006-06-13 Thread Ford, Mike
On 13 June 2006 10:31, Niels wrote: Hi, I have a problem I can solve with some loops and if-thens, but I'm sure it can be done with bit operations -- that would be prettier. I've tried to work it out on paper, but I keep missing the final solution. Maybe I'm missing something obvious...

RE: [PHP] Help with some clever bit operations

2006-06-13 Thread Niels
On Tuesday 13 June 2006 12:32, Ford, Mike wrote: On 13 June 2006 10:31, Niels wrote: Hi, I have a problem I can solve with some loops and if-thens, but I'm sure it can be done with bit operations -- that would be prettier. I've tried to work it out on paper, but I keep missing the

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread Niels
On Tuesday 13 June 2006 12:22, Jochem Maas wrote: Niels wrote: Hi, I have a problem I can solve with some loops and if-thens, but I'm sure it can be done with bit operations -- that would be prettier. I've tried to work it out on paper, but I keep missing the final solution. Maybe I'm

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread Niels
On Tuesday 13 June 2006 12:18, David Tulloh wrote: The example starting values $existing = 181; # = 10110101 $new = 92; # = 01011100 $mask = 15; # = Get the bits that will be changed $changing = $new $mask; # = 12 = 1100 Get the bits that won't be changed $staying =

Re: [PHP] Re: How to re-order an array

2006-06-13 Thread tedd
At 11:26 PM -0700 6/12/06, Paul Novitski wrote: Aside, the whole client-side/server-side debate depends on today's internet connection response time being as slow as it is. In a few years a seemingly sexy technology like Ajax, which appears useful today in pages so heavy with content that

[PHP] GetText string not found

2006-06-13 Thread Ruben Rubio Rey
Hi, I am using gettext to get a web page in several languages. When gettext does not found an string, it shows the string. Is it possible to detect when a string is not found, in order to advis me ? Thanks in advance, Ruben Rubio Rey -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread Satyam
- Original Message - From: David Tulloh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Tuesday, June 13, 2006 12:18 PM Subject: Re: [PHP] Help with some clever bit operations The example starting values $existing = 181; # = 10110101 $new = 92; # =

[PHP] Setting headers for file download

2006-06-13 Thread Peter Lauri
Best group member, This is how I try to push files to download using headers: header(Content-type: $file_type); header(Content-Disposition: attachment; filename=$filename); print $file; It works fine in FireFox, but not that good in IE. I have been googled to find the fix for IE, but I can not

Re: [PHP] GetText string not found

2006-06-13 Thread Jochem Maas
Ruben Rubio Rey wrote: Hi, I am using gettext to get a web page in several languages. When gettext does not found an string, it shows the string. Is it possible to detect when a string is not found, in order to advis me ? sure in a very simplistic manner; function __($s) { $r =

Re: [PHP] Seeking recommendations for use of include()

2006-06-13 Thread tedd
At 7:22 PM +0900 6/13/06, Dave M G wrote: PHP List, Up until now, in order to get all the functions and classes I need in my scripts, I have always made a file called includes.php that contains a series of include() statements for all of the files that I want to include. Then I just include

Re: [PHP] php-html rendering

2006-06-13 Thread Ryan A
--- Larry Garfield [EMAIL PROTECTED] wrote: clip 1 that said it could take a week to figure out all the parameters. ;-) /clip 1 ... /clip 2 That's why I included the switches I did. :-) I had to do something very similar just last week. ... -m means mirror. That is,

Re: [PHP] Seeking recommendations for use of include()

2006-06-13 Thread Andrei
Anyway when you include files by script (not scpecifying the order in which u include them) check out class inheritage and class usage in files you include. Classes that are inherited must be included first. Andy At 7:22 PM +0900 6/13/06, Dave M G wrote: PHP List, Up until now,

[PHP] Please help me with a query

2006-06-13 Thread Jesús Alain Rodríguez Santos
First of all I'm sorry for my english I don't know speak very well, I will try to explain it, I hope you understain what I need. I have two tables: centers and peoples, in table centers I have the centers values and in table peoples I have the peoples values and in table columns center the id

[PHP] SimpleXMLElement writing problem while in a reference

2006-06-13 Thread defragger
Hi all, I found out (while playing with xpath()) that you cant edit the content of a node when you use a reference on a SimpleXMLElement object. An example: --- $xmlString = '?xml version=1.0 encoding=UTF-8? container texte text user=user1asdfasdfeorpqi/text

Re: [PHP] Please help me with a query

2006-06-13 Thread Jochem Maas
if you want to ask a question don't be so lazy as to simply reply to a post in an existing thread - it's considered rude. send a new email. Jesús Alain Rodríguez Santos wrote: ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Sending UTF-8 mail with mail()

2006-06-13 Thread Peter Lauri
How can I send UTF-8 mails with the mail() function. Right now I am doing: mail('[EMAIL PROTECTED]', 'Subject', 'Message', From: The Sender [EMAIL PROTECTED] \n . Content-Type: text/plain; charset=utf-8 \n . Content-Transfer-Encoding: 7bit\n\n) The message is being sent, but the UTF-8 specific

RE: [PHP] Please help me with a query

2006-06-13 Thread Jef Sullivan
Your query is wrong. You are selecting only one result yet you are referencing three. I suggest... SELECT * FROM centers ORDER BY idc asc Jef -Original Message- From: Jesús Alain Rodríguez Santos [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 13, 2006 8:49 AM To:

Re: [PHP] php-html rendering

2006-06-13 Thread Larry Garfield
On Tuesday 13 June 2006 07:22, Ryan A wrote: Hey, Thanks for the explanation of the switches. One part that I dont really understand is: blah?foo=bar links into [EMAIL PROTECTED] having a link such as [EMAIL PROTECTED] is not going to work to link to the second document...right? (I

[PHP] Re: trapping fatal errors...?

2006-06-13 Thread Christopher J. Bottaro
Adam Zey wrote: Christopher J. Bottaro wrote: Hello, How can I trap a fatal error (like calling a non existant method, requiring a non existant file, etc) and go to a user defined error handler? I tried set_error_handler(), but it seems to skip over the errors I care about. Thanks for

[PHP] Re: Sending UTF-8 mail with mail()

2006-06-13 Thread Barry
Peter Lauri schrieb: How can I send UTF-8 mails with the mail() function. Right now I am doing: mail('[EMAIL PROTECTED]', 'Subject', 'Message', From: The Sender [EMAIL PROTECTED] \n . Content-Type: text/plain; charset=utf-8 \n . Content-Transfer-Encoding: 7bit\n\n) The message is being

[PHP] URL Rewrite???

2006-06-13 Thread Keith
Hi all Not really a php issue per se - sorry. But I'm sure someone here is bound to know the answer. :-) I have a main site that is accessible at say http://www.somedomain.com/somedir/; but I want visitors to be able to access the site using simply http://www.somedomain.com; AND for the

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread Robert Cummings
On Tue, 2006-06-13 at 06:22, Jochem Maas wrote: My brain needs a crutch when trying doing this kind of thing (normally I only write hex number literally when dealing with bitwise stuff - the conversion stuff still makes my head spin) - this is what this table is for: 128 64 32 16 8 4 2 1

Re: [PHP] date_sunrise accuracy

2006-06-13 Thread Jochem Maas
KI wrote: I posted this Thursday as a PHP bug: http://bugs.php.net/bug.php?id=37743 Basically this function is off by 2 minutes from the US UK governments calculations. not today it isn't - U.S. Naval Observatory (http://aa.usno.navy.mil/data/docs/RS_OneDay.html) gives me 5.23 for sunrise

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread Jochem Maas
Robert Cummings wrote: On Tue, 2006-06-13 at 06:22, Jochem Maas wrote: My brain needs a crutch when trying doing this kind of thing (normally I only write hex number literally when dealing with bitwise stuff - the conversion stuff still makes my head spin) - this is what this table is for:

Re: [PHP] URL Rewrite???

2006-06-13 Thread Jochem Maas
Keith wrote: Hi all Not really a php issue per se - sorry. But I'm sure someone here is bound to know the answer. :-) I have a main site that is accessible at say http://www.somedomain.com/somedir/; but I want visitors to be able to access the site using simply

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread Robert Cummings
On Tue, 2006-06-13 at 11:03, Jochem Maas wrote: Robert Cummings wrote: On Tue, 2006-06-13 at 06:22, Jochem Maas wrote: My brain needs a crutch when trying doing this kind of thing (normally I only write hex number literally when dealing with bitwise stuff - the conversion stuff still

Re: [PHP] Re: trapping fatal errors...?

2006-06-13 Thread Eric Butera
Sometimes unexpected errors happen. We write hundreds of lines of code a day. Typos happen, I forget some includes, I type $d-appendCild() instead of $d-appendChild(). It's all a part of the development process. Our application makes extensive use of AJAX and JSON. Sometimes we make an AJAX

Re: [PHP] Help with some clever bit operations

2006-06-13 Thread Jochem Maas
Robert Cummings wrote: On Tue, 2006-06-13 at 11:03, Jochem Maas wrote: Robert Cummings wrote: On Tue, 2006-06-13 at 06:22, Jochem Maas wrote: My brain needs a crutch when trying doing this kind of thing (normally I only write hex number literally when dealing with bitwise stuff - the

RE: [PHP] Re: Sending UTF-8 mail with mail()

2006-06-13 Thread Peter Lauri
That worked better. Now I at least am getting something that looks like the same it looks in MySQL database table. However, in the email client (outlook, gmail, hotmail) it is being showed like this: Document name: ´¡¿Ë Document summary: ´¡Ë¿ /Peter -Original Message- From: Barry

Re: [PHP] Re: trapping fatal errors...?

2006-06-13 Thread Jochem Maas
Christopher J. Bottaro wrote: Adam Zey wrote: Christopher J. Bottaro wrote: Hello, How can I trap a fatal error (like calling a non existant method, requiring a non existant file, etc) and go to a user defined error handler? I tried set_error_handler(), but it seems to skip over the

Re: [PHP] GD

2006-06-13 Thread Tom Ray [Lists]
Beauford wrote: I'm using Slackware 10 and installed GD as an install package. I also changed some lines in the php.ini file for GD. Tom: I have no idea how this program works, all I know is that I need it for the captcha program to display the image. I wouldn't even bother otherwise.

[PHP] Re: Re: trapping fatal errors...?

2006-06-13 Thread Christopher J. Bottaro
Jochem Maas wrote: Christopher J. Bottaro wrote: Adam Zey wrote: Christopher J. Bottaro wrote: Hello, How can I trap a fatal error (like calling a non existant method, requiring a non existant file, etc) and go to a user defined error handler? I tried set_error_handler(), but it seems

RE: [PHP] Re: Sending UTF-8 mail with mail()

2006-06-13 Thread tedd
At 5:25 PM +0700 6/13/06, Peter Lauri wrote: That worked better. Now I at least am getting something that looks like the same it looks in MySQL database table. However, in the email client (outlook, gmail, hotmail) it is being showed like this: Document name: ´¡¿Ë Document summary: ´¡Ë¿ /Peter

RE: [PHP] Re: Sending UTF-8 mail with mail()

2006-06-13 Thread Peter Lauri
No they do not. It should be ฟหกด if it is correct. The process is like this: 1. The user enter the data in a form 2. The form data will be used to insert data into the database and send an alert via email about the name and summary of the document. The below is inserted into the database,

Re: [PHP] Dettach problem

2006-06-13 Thread Jochem Maas
pure guess work coming up... grape wrote: Hi all, I would like run a php-script via CLI which outputs some information to stdout, and then go into background. I use code similar to this to fork and to dettach the child I/O from the TTY (some error handling removed to improve readability)

RE: [PHP] Re: Sending UTF-8 mail with mail()

2006-06-13 Thread tedd
At 6:14 PM +0700 6/13/06, Peter Lauri wrote: No they do not. It should be øÀ°¥ if it is correct. The process is like this: 1. The user enter the data in a form 2. The form data will be used to insert data into the database and send an alert via email about the name and summary of the document.

RE: [PHP] Re: Sending UTF-8 mail with mail()

2006-06-13 Thread Peter Lauri
What do you mean with the display fonts? Do you mean the text that is inserted in the form? -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 12:55 AM To: Peter Lauri; 'tedd'; 'Barry'; php-general@lists.php.net Subject: RE: [PHP] Re: Sending UTF-8

[PHP] preg_replace \\1 yIKES!

2006-06-13 Thread sam
Wow this is hard I can't wait till I get the hang of it. Capitalize the first letter of a word. echo preg_replace('/(^)(.)(.*$)/', strtoupper('\\2') . '\\3', 'yikes!'); // outputs yikes! Nope didn't work. So I want to see if I'm in the right place: echo preg_replace('/(^)(.)(.*$)/', '\\1' .

Re: [PHP] preg_replace \\1 yIKES!

2006-06-13 Thread sam
for Eyes burning; caffein shakes; project overdue Thanks Why not just use ucfirst http://us2.php.net/manual/en/ function.ucfirst.php? -Original Message- From: sam [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 13, 2006 2:34 PM To: PHP Subject: [PHP] preg_replace \\1 yIKES! Wow this

Re: [PHP] preg_replace \\1 yIKES!

2006-06-13 Thread Jochem Maas
sam wrote: Wow this is hard I can't wait till I get the hang of it. Capitalize the first letter of a word. echo preg_replace('/(^)(.)(.*$)/', strtoupper('\\2') . '\\3', 'yikes!'); // outputs yikes! Nope didn't work. So I want to see if I'm in the right place: echo

Re: [PHP] preg_replace \\1 yIKES!

2006-06-13 Thread Jochem Maas
sam wrote: for Eyes burning; caffein shakes; project overdue nobody here cares whether your project is overdue - waiting 7 minutes before sending a 'reminder' about the question you asked suggests you need to take a PATIENCE lesson. or did some fraudster sell you a php support contract? ...

Re: [PHP] preg_replace \\1 yIKES!

2006-06-13 Thread Robert Cummings
On Tue, 2006-06-13 at 15:07, Jochem Maas wrote: sam wrote: for Eyes burning; caffein shakes; project overdue nobody here cares whether your project is overdue - waiting 7 minutes before sending a 'reminder' about the question you asked suggests you need to take a PATIENCE lesson.

Re: [PHP] Sending UTF-8 mail with mail()

2006-06-13 Thread M
Peter Lauri wrote: How can I send UTF-8 mails with the mail() function. Right now I am doing: mail('[EMAIL PROTECTED]', 'Subject', 'Message', From: The Sender [EMAIL PROTECTED] \n . Content-Type: text/plain; charset=utf-8 \n . Content-Transfer-Encoding: 7bit\n\n) The message is being sent,

Re: [PHP] preg_replace \\1 yIKES!

2006-06-13 Thread tedd
At 11:33 AM -0700 6/13/06, sam wrote: Wow this is hard I can't wait till I get the hang of it. Capitalize the first letter of a word. Try: ?php $word = yikes; $word[0]=strtoupper($word[0]); echo($word); ? tedd --

Re: [PHP] preg_replace \\1 yIKES!

2006-06-13 Thread Dave Goodchild
On 13/06/06, tedd [EMAIL PROTECTED] wrote: At 11:33 AM -0700 6/13/06, sam wrote: Wow this is hard I can't wait till I get the hang of it. Capitalize the first letter of a word. Why not use ucfirst(), that is what the function is for. --

Re: [PHP] Seeking recommendations for use of include()

2006-06-13 Thread Richard Lynch
The problem with making it dynamic, is that you've just made it AWFULLY easy for some Bad Guy to inject their own PHP file into your system... Think about that for awhile. On Tue, June 13, 2006 5:22 am, Dave M G wrote: PHP List, Up until now, in order to get all the functions and classes I

[PHP] Strange lockup - using curl

2006-06-13 Thread mbneto
Hi, I am facing a strange problem. I have a script that runs fine in one server but simply locks up in another. I´ve managed to find that when the curl_exec is called the problem appears, so I decided to use a sample script with the same example found at ww.php.net and got the same results.

[PHP] Re: Sending UTF-8 mail with mail()

2006-06-13 Thread Manuel Lemos
Hello, on 06/13/2006 06:09 AM Peter Lauri said the following: How can I send UTF-8 mails with the mail() function. Right now I am doing: mail('[EMAIL PROTECTED]', 'Subject', 'Message', From: The Sender [EMAIL PROTECTED] \n . Content-Type: text/plain; charset=utf-8 \n .

[PHP] RE: Sending UTF-8 mail with mail()

2006-06-13 Thread Peter Lauri
Yes, that class I am aware of. However, I only want to send text/plain messages, not MIME messages. -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 4:36 AM To: Peter Lauri Cc: php-general@lists.php.net Subject: Re: Sending UTF-8 mail with

Re: [PHP] Dettach problem

2006-06-13 Thread Richard Lynch
On Tue, June 13, 2006 4:22 am, grape wrote: I would like run a php-script via CLI which outputs some information to stdout, and then go into background. I use code similar to this to fork and to dettach the child I/O from the TTY (some error handling removed to improve readability) ? echo

Re: [PHP] Sending UTF-8 mail with mail()

2006-06-13 Thread Richard Lynch
On Tue, June 13, 2006 4:09 am, Peter Lauri wrote: How can I send UTF-8 mails with the mail() function. Right now I am doing: mail('[EMAIL PROTECTED]', 'Subject', 'Message', From: The Sender [EMAIL PROTECTED] \n . Content-Type: text/plain; charset=utf-8 \n . Content-Transfer-Encoding:

[PHP] Re: Sending UTF-8 mail with mail()

2006-06-13 Thread Manuel Lemos
Hello, on 06/13/2006 01:37 PM Peter Lauri said the following: Yes, that class I am aware of. However, I only want to send text/plain messages, not MIME messages. MIME includes plain text messages. MIME is what is called the set of standard rules defined in RFC documents for sending e-mail. 8

Re: [PHP] Setting headers for file download

2006-06-13 Thread Richard Lynch
On Tue, June 13, 2006 1:44 am, Peter Lauri wrote: This is how I try to push files to download using headers: Content-type: application/octet-stream Any browser failing to download THAT is seriously broken. The Content-Disposition: crap will only work on select browsers -- If you really want

Re: [PHP] date_sunrise accuracy

2006-06-13 Thread Richard Lynch
On Mon, June 12, 2006 6:11 pm, KI wrote: I posted this Thursday as a PHP bug: http://bugs.php.net/bug.php?id=37743 Basically this function is off by 2 minutes from the US UK governments calculations. While PHP is admitting there is a difference they are stating I should live with it and

Re: [PHP] GetText string not found

2006-06-13 Thread Richard Lynch
On Tue, June 13, 2006 6:30 am, Ruben Rubio Rey wrote: I am using gettext to get a web page in several languages. When gettext does not found an string, it shows the string. Is it possible to detect when a string is not found, in order to advis me ? My experience, if you call it that, with

Re: [PHP] GD

2006-06-13 Thread Richard Lynch
On windows, you just take out the ; in the line with php_gd2.dll in your php.ini file php.net has to be in the directory noted in ?php phpinfo();? And your extension_dir in php.ini has to be the directory where php_gd2.dll lives. On Mon, June 12, 2006 6:11 pm, Beauford wrote: Hi, I am trying

Re: [PHP] date_sunrise accuracy

2006-06-13 Thread KI
Jochem Maas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] KI wrote: I posted this Thursday as a PHP bug: http://bugs.php.net/bug.php?id=37743 Basically this function is off by 2 minutes from the US UK governments calculations. not today it isn't - U.S. Naval Observatory

Re: [PHP] trapping fatal errors...?

2006-06-13 Thread Richard Lynch
On Mon, June 12, 2006 5:00 pm, Christopher J. Bottaro wrote: Hello, How can I trap a fatal error (like calling a non existant method, requiring a non existant file, etc) and go to a user defined error handler? I tried set_error_handler(), but it seems to skip over the errors I care about.

Re: [PHP] php-html rendering

2006-06-13 Thread Richard Lynch
On Mon, June 12, 2006 4:49 pm, Jochem Maas wrote: Ryan A wrote: Thanks for the suggestion, I am not too familier with wget but (correct me if i am wrong) wont wget just get the output from the pages ignoreing the links? that's the default behaviour - but wget has about a zillion parameters

[PHP] PHP6 build help

2006-06-13 Thread Ligaya Turmelle
Ubuntu Breezy Badger, AMD 64 I am trying to build PHP6 from source. I must admit to being a novice at *nix systems, but I am learning - so please be gentle. :) I have already gotten a copy of the PHP6 source from CVS, downloaded the autoconf version 2.13 as well as the ICU and ran the

Re: [PHP] PHP6 build help

2006-06-13 Thread Richard Lynch
You realize that compiling PHP6 from CVS is, errr, not really for newbies... :-) You may want to start over with a stable download from: http://php.net/downloads.php You do not seem to have the 'lex' command, which means you probably didn't install 'lex' you can Google for the error message

Re: [PHP] php-html rendering

2006-06-13 Thread Ryan A
Hey Larry, Thanks again, now i have around 3 different ways of doing this... can assure the client that all will be well, all depends now if the project is confirmed and given to us. But the info you gave me will serve me even if this project does not go through or i dont use wget for this

[PHP] Re: preg_replace \\1 yIKES!

2006-06-13 Thread Rafael
Capitalize the first letter of a word: ucwords()[1] Now, if it's just for practice, then you need a little change in you code, since strtoupper('\\2') will give '\\2' (i.e. does nothing) and the letter will remain the same. One way to do it would be $text = 'hello world (any

[PHP] Re: Setting headers for file download

2006-06-13 Thread Rafael
I use something like this... $file_len = filesize($file_name); $file_ts = filemtime($file_name); header('Content-Type: application/x-octet-stream'); // none known header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Last-Modified: '. gmdate('D, d M Y

Re: [PHP] PHP6 build help

2006-06-13 Thread Ligaya Turmelle
Richard Lynch wrote: You realize that compiling PHP6 from CVS is, errr, not really for newbies... :-) Yeah - I know. but I am helping out the php qa team by writing some phpt tests... and they prefer (though don't require) the tests also include the unicode support. which means PHP6. As I

Re: [PHP] php-html rendering

2006-06-13 Thread Larry Garfield
On Tuesday 13 June 2006 17:57, Ryan A wrote: Hey Larry, Thanks again, now i have around 3 different ways of doing this... can assure the client that all will be well, all depends now if the project is confirmed and given to us. But the info you gave me will serve me even if this project

[PHP] errata

2006-06-13 Thread Rafael
Now, if it's just for practice, then you need a little change in you code, since strtoupper('\\2') will give '\\2' (i.e. does nothing) and the letter will remain the same. I meant, since *strtoupper('\\2')* is evaluated _before_ being included in the string (used as replacement),

Re: [PHP] Seeking recommendations for use of include()

2006-06-13 Thread Dave M G
Richard Lynch wrote: The problem with making it dynamic, is that you've just made it AWFULLY easy for some Bad Guy to inject their own PHP file into your system... Think about that for awhile. I have thought about it, and I can only see it as possible if the person already has the ability to

[PHP] transfer file

2006-06-13 Thread kristianto adi widiatmoko
i try to transfer file from one server to another server, lets call it server A to server B. My Idea is like this I place my script in server A ?php $local = fopen(file.txt,r); $remote = fopen(http://B/file.txt,w+); while(!feof($local)) { $buff = fread($local,1024); fwrite($remote,

Re: [PHP] Seeking recommendations for use of include()

2006-06-13 Thread Larry Garfield
On Tuesday 13 June 2006 21:17, Dave M G wrote: If there is some other way for them to exploit a dynamic include() function, then please let me know. $untrusted_var = '../../../../../../../etc/passwd'; include($untrusted_var); Or in later versions of PHP, I *think* the following may even work:

Re: [PHP] transfer file

2006-06-13 Thread Chris
kristianto adi widiatmoko wrote: i try to transfer file from one server to another server, lets call it server A to server B. My Idea is like this I place my script in server A ?php $local = fopen(file.txt,r); $remote = fopen(http://B/file.txt,w+); while(!feof($local)) { $buff =

Re: [PHP] Strange lockup - using curl

2006-06-13 Thread Chris
mbneto wrote: Hi, I am facing a strange problem. I have a script that runs fine in one server but simply locks up in another. I´ve managed to find that when the curl_exec is called the problem appears, so I decided to use a sample script with the same example found at ww.php.net and got the

RE: [PHP] Setting headers for file download

2006-06-13 Thread Peter Lauri
Hi, when I do that I do not get any download frame showing up. Can that be solved? -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 4:58 AM To: Peter Lauri Cc: php-general@lists.php.net Subject: Re: [PHP] Setting headers for file download

RE: [PHP] Re: Setting headers for file download

2006-06-13 Thread Peter Lauri
I will try that after golf... -Original Message- From: Rafael [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 6:28 AM To: php-general@lists.php.net Subject: [PHP] Re: Setting headers for file download I use something like this... $file_len = filesize($file_name);

Re: [PHP] PHP6 build help

2006-06-13 Thread Rabin Vincent
On 6/14/06, Ligaya Turmelle [EMAIL PROTECTED] wrote: Richard Lynch wrote: You realize that compiling PHP6 from CVS is, errr, not really for newbies... :-) Yeah - I know. but I am helping out the php qa team by writing some phpt tests... and they prefer (though don't require) the tests also