Re: [PHP] Content-Type header required for POST?

2004-10-25 Thread Olaf van der Spek
Chris Shiflett wrote: --- Olaf van der Spek <[EMAIL PROTECTED]> wrote: Since which version does PHP require the Content-Type header in POST requests? Content-Type is required for any request that has content. It's an HTTP The RFC says should, not is required to. Any HTTP/1.1 message containing an

Re: [PHP] Content-Type header required for POST?

2004-10-25 Thread Olaf van der Spek
Chris Shiflett wrote: --- Olaf van der Spek <[EMAIL PROTECTED]> wrote: Content-Type is required for any request that has content. It's an HTTP requirement and has very little to do with PHP. Can you explain what you're talking about? I was talking about the request, not about the response. As was

Re: [PHP] Specifying Variable Document Path in PHP

2004-10-25 Thread Jason Wong
On Tuesday 26 October 2004 04:46, Anthony Baker wrote: > The problem here is that the path will vary slightly depending on whether > it's the staging server or production server. I'd ideally like to set a > single global variable that can handle this so I don't have to hard-code > paths across the

RE: [PHP] chm file for tutorial

2004-10-25 Thread Denis Gerasimov
BTW does anybody know why CHM version hasn't been updated for a very long time? I prefer to read help manuals in CHM format (that is more convenient for me) so I am wondering... Best regards, Denis Gerasimov Outsourcing Services Manager, VEKOS, Ltd. www.vekos.ru > -Original Message- > F

Re: [PHP] File uploads and handling

2004-10-25 Thread Jason Wong
On Tuesday 26 October 2004 03:45, Philip Thompson wrote: > I have a form to upload a file from a user's computer to the server. I > want to then modify the file, and then let the user save it back. > However, I am having troubles opening the file. It says it doesn't > exist. Any suggestions? > > -

[PHP] not _that_ fixed....

2004-10-25 Thread Pierre Ancelot
in fact i got it in the ./configure --help : [EMAIL PROTECTED]:~/phpsource/php-4.3.9$ ./configure --help | grep -i spider --enable-spider Enable spider support [EMAIL PROTECTED]:~/phpsource/php-4.3.9$ which is okay. but if i run make, i got a few lines about it like : gcc -Iext/s

Re: [PHP] not _that_ fixed....

2004-10-25 Thread Pierre Ancelot
humm, thank you, finaly someone that did something of that kind :) well, i want it as a dynamic extension that i could redistribute and which wouldn't necessits recompilation, just adding it in php.in does what you told still would works in this case ? On Tuesday 26 October 2004 06:47, Rob

[PHP] Specifying Variable Document Path in PHP

2004-10-25 Thread Anthony Baker
Hey Folks, My first post to this list and forgive me if this is ground that's been trod before, but this has been bugging me for a bit. I'm developing a site that's going to be running on a staging environment and a production environment. Have a number of PHP includes in the production site tha

Re: [PHP] not _that_ fixed....

2004-10-25 Thread Robert Cummings
On Tue, 2004-10-26 at 00:37, Pierre Ancelot wrote: > > in fact i got it in the ./configure --help : > > [EMAIL PROTECTED]:~/phpsource/php-4.3.9$ ./configure --help | grep -i spider > --enable-spider Enable spider support > [EMAIL PROTECTED]:~/phpsource/php-4.3.9$ > > which is okay.

Re: [PHP] file upload

2004-10-25 Thread Chris
Ahh, if you *have* to push the data (which you obviously do) and the authentication site has no other authentication methods then you have to POST the file with PHP. It can be done, there are many classes for it, I can't recommend any specific class, but I'm sure someone else here could. I woul

[PHP] File uploads and handling

2004-10-25 Thread Philip Thompson
Hi all. I have a form to upload a file from a user's computer to the server. I want to then modify the file, and then let the user save it back. However, I am having troubles opening the file. It says it doesn't exist. Any suggestions? --- if (is_uploaded_file($_FILES['userfile']['name']))

Re: [PHP] Re: Good Class/API Design ?

2004-10-25 Thread Curt Zirzow
* Thus wrote Greg Beaver: > Adam Reiswig wrote: > >Hey all, I just got my hands on the excellent books PHP Anthology 1 & 2 > >and am wanting to start playing around with classes. My question to the > >list is, what, in your opinion, constitutes good class/api design? Is > >it better to design

Re: [PHP] php extension problem

2004-10-25 Thread Pierre Ancelot
fixed. i downloaded the source from php.net and it works now... the previous source i had came from apt system. maybe the source is patched ? if i'm not the only one to have had this problem, let me know, i'll mail the debian maintener thanks, On Monday 25 October 2004 19:19, Pierre Ancelot w

[PHP] Re: Good Class/API Design ?

2004-10-25 Thread Greg Beaver
Adam Reiswig wrote: Hey all, I just got my hands on the excellent books PHP Anthology 1 & 2 and am wanting to start playing around with classes. My question to the list is, what, in your opinion, constitutes good class/api design? Is it better to design several smaller classes that each focus

[PHP] Re: Pure PHP menu tree

2004-10-25 Thread Greg Beaver
Ryan A wrote: Hi, I have been searching on the net for the past 2 hours without success, so need a recommendation now :-) Basically i am looking for a PHP "menu tree", looking on google I have found many but most of them use Javascript with php, or are pure JS or DHTML, I want one that is pure php

[PHP] Re: PHP 5 abstract method and class type hints of extending classes

2004-10-25 Thread Greg Beaver
Jeremy Weir wrote: The quesion is: how would one make an abstract method that can be compatible with all extending classes that define the method using different class type hints? The php block below is how I thought it should work, but will give this error at parse time: Fatal error: Declarati

[PHP] Good Class/API Design ?

2004-10-25 Thread Adam Reiswig
Hey all, I just got my hands on the excellent books PHP Anthology 1 & 2 and am wanting to start playing around with classes. My question to the list is, what, in your opinion, constitutes good class/api design? Is it better to design several smaller classes that each focus on one task and do

Re: [PHP] file upload

2004-10-25 Thread Victor C.
See... basically, I have two sites. One site provides user authentication and another one requests the authentication. The requesting site need to send to the authentication site its request in an XML. The authentication site is suppose to get the XML file using $HTTP_POST_FILES. I'm using PHP to

RE: [PHP] Pure PHP menu tree

2004-10-25 Thread Vail, Warren
Do you really want to have every single click go back to the server and then have the browser need to reload your entire page just to expand a limb (not sure limb is the right term) of the tree? That is what you would have to do to be pure PHP solution since the only place PHP can execute is on th

Re: [PHP] file upload

2004-10-25 Thread Chris
Server to Server transfers are a bit different. There are MANY ways to do it. You can put the file in the document root of one server, and download it with the other server. Or you could FTP the file from one server to the other. Just 2 examples. And, you could even POST the file from one to t

[PHP] Re: Pure PHP menu tree

2004-10-25 Thread Jason Motes
Basically i am looking for a PHP "menu tree", looking on google I have found many but most of them use Javascript with php, or are pure JS or DHTML, I want one that is pure php so it will work accross all browsers. http://phplayersmenu.sourceforge.net/ -- PHP General Mailing List (http://www.php.

Re: [PHP] Php files with .html extension?

2004-10-25 Thread Greg Donald
On Mon, 25 Oct 2004 18:44:41 +, Curt Zirzow <[EMAIL PROTECTED]> wrote: > Nice work! I wonder what the stats would be like with apache2 :) Suse 9.1 box: > cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 4 model name : AMD Athlon(

Re: [PHP] @session_start generates a new session_id

2004-10-25 Thread Greg Donald
On Mon, 25 Oct 2004 15:59:18 -0400, Lizet Peña de Sola <[EMAIL PROTECTED]> wrote: > How can I set session_auto_start On, I have a similar problem and I think > it's because my web hosting has that feature off. .htaccess php_flag session.auto_start on -- Greg Donald Zend Certified Engineer http

Re: [PHP] file upload

2004-10-25 Thread Victor C.
Thanks for answering Chris.. What if I want to send a file from my web server to another site for them to parse? I already know what file I want to send and I do not want to have to select the file by doing "browsing". "Chris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You can'

Re: [PHP] Is flock() necessary on a simple file append?

2004-10-25 Thread Paul Fierro
On 10/24/2004 5:11 PM, Kevin Grigorenko <[EMAIL PROTECTED]> wrote: > I am appending to a file one line of text on every page hit, so there could > be many occurrences of this append simultaneously. I am not opening for > write ("w") but for append ("a"). Do I need to use flock() to be sure there

Re: [PHP] Register Globals

2004-10-25 Thread Greg Donald
On Mon, 25 Oct 2004 11:50:39 -0700 (PDT), Matthew Sims <[EMAIL PROTECTED]> wrote: > I see that register_globals is turned on. Now I always use the $_GET and > $_POST vars but will this still affect me? .htaccess php_flag register_globals off -- Greg Donald Zend Certified Engineer http://gdcons

[PHP] Pure PHP menu tree

2004-10-25 Thread Ryan A
Hi, I have been searching on the net for the past 2 hours without success, so need a recommendation now :-) Basically i am looking for a PHP "menu tree", looking on google I have found many but most of them use Javascript with php, or are pure JS or DHTML, I want one that is pure php so it will wo

[PHP] PHP 5 abstract method and class type hints of extending classes

2004-10-25 Thread Jeremy Weir
The quesion is: how would one make an abstract method that can be compatible with all extending classes that define the method using different class type hints? The php block below is how I thought it should work, but will give this error at parse time: Fatal error: Declaration of DisplayObject

Re: [PHP] Register Globals

2004-10-25 Thread John Holmes
Simas Toleikis wrote: And this [register globals] won't pose as a security risk to me? It will. No, it won't. register_globals is not a security risk. Poorly written code that does not adequately initialize variables or account for variables from outside sources can present security risks. You c

Re: [PHP] Content-Type header required for POST?

2004-10-25 Thread Chris Shiflett
--- Olaf van der Spek <[EMAIL PROTECTED]> wrote: > > Content-Type is required for any request that has content. > > It's an HTTP requirement and has very little to do with PHP. > > > > Can you explain what you're talking about? > > I was talking about the request, not about the response. As was

Re: [PHP] file upload

2004-10-25 Thread Chris
You can't, at least you SHOULDN'T. Just think about what you're asking for, you want to download a file from a users computer, without them knowing about it. Major security/privacy issues there that browsers try to prevent. Chris Victor C. wrote: Hi, I'm trying to submit a file from "index.php"

Re: [PHP] Php files with .html extension?

2004-10-25 Thread zooming
I don't use cgi scripts. - Original Message - From: "The Snake from Hell!" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 25, 2004 4:25 PM Subject: Re: [PHP] Php files with .html extension? > > You would probably brake a heck of a lot of things. CGI > scripts, etc. >

[PHP] file upload

2004-10-25 Thread Victor C.
Hi, I'm trying to submit a file from "index.php" to "index2.php". I know how to do file upload in PHP. On "index.php" I have: The next page would only need to use $HTTP_POST_FILES['myfile'] to access the submitted file. My question is: if I already know which file I want to submit, say "fil

Re: [PHP] Content-Type header required for POST?

2004-10-25 Thread Olaf van der Spek
Chris Shiflett wrote: --- Olaf van der Spek <[EMAIL PROTECTED]> wrote: Since which version does PHP require the Content-Type header in POST requests? Content-Type is required for any request that has content. It's an HTTP requirement and has very little to do with PHP. Can you explain what you're

Re: [PHP] Php files with .html extension?

2004-10-25 Thread The Snake from Hell!
You would probably brake a heck of a lot of things. CGI scripts, etc. >On a related note I was wondering what people thought of php files with noextensions? So >if I changed index.php to just index then I can create urllike >www.mydomain.com/index/articleid/29 so it's search engine friendly. > >

RE: [PHP] @session_start generates a new session_id

2004-10-25 Thread Lizet Peña de Sola
How can I set session_auto_start On, I have a similar problem and I think it's because my web hosting has that feature off. -Original Message- From: Sadeq Naqashzade [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 19, 2004 11:47 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: R

[PHP] What is better R&Os or pdflib and why?

2004-10-25 Thread Eugene Voznesensky
What is better R&Os or pdflib and why? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Register Globals

2004-10-25 Thread Simas Toleikis
And this won't pose as a security risk to me? It will. You could emulate namespaces in php. Do something like this: function init_namespace() { // all your script code goes here } init_namespace(); // notice the call This way any globally registered post/get/cookie etc variables wont be access

[PHP] Re: http request using fsockopen

2004-10-25 Thread Manuel Lemos
Hello, On 10/25/2004 09:46 AM, Rob wrote: I have a form on page A which is submitted trough a POST method to page B. On the start of page B I check var $foo. If true I want to "forward" the request to page C. Sending the POST data also though the POST method. I manually create a HTTP request to p

Re: [PHP] Register Globals

2004-10-25 Thread John Holmes
Jay Blanchard wrote: [snip] I just signed up with a new hosting site. So first thing I did was check what phpinfo() had to say. I see that register_globals is turned on. Now I always use the $_GET and $_POST vars but will this still affect me? [/snip] Nope, you can keep using, and should keep using

Re: [PHP] Php files with .html extension?

2004-10-25 Thread zooming
On a related note I was wondering what people thought of php files with no extensions? So if I changed index.php to just index then I can create url like www.mydomain.com/index/articleid/29 so it's search engine friendly. # .htaccess file DefaultType application/x-httpd-php -- PHP General Maili

Re: [PHP] Register Globals

2004-10-25 Thread Andre Dubuc
On Monday 25 October 2004 02:50 pm, Matthew Sims wrote: [snip] > > I see that register_globals is turned on. Now I always use the $_GET and > $_POST vars but will this still affect me? > [snip] Matthew, Although it shouldn't affect you, I had a terrible time trying to get anything to pass via se

RE: [PHP] Register Globals

2004-10-25 Thread Matthew Sims
> [snip] > I just signed up with a new hosting site. So first thing I did was check > what phpinfo() had to say. > > I see that register_globals is turned on. Now I always use the $_GET and > $_POST vars but will this still affect me? > [/snip] > > Nope, you can keep using, and should keep using, t

Re: [PHP] @session_start generates a new session_id

2004-10-25 Thread Mark-Walter
Hi Sadeq, > Check your PHP config file. You may enable auto session start. I think > this is the reasone of problem. sorry for the delay and indeed your suggestion solves now my problem. Thank's a lot :-) -- Best Regards, Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe

[PHP] Compiling PHP with extension; CLI works, Apache doesn't

2004-10-25 Thread Aaron Gould
I just compiled PHP with an extension for testing purposes (mnoGoSearch). After all was said and done, the CLI version sees the mnogosearch extension just fine ("php -m"), but the Apache module doesn't see it at all (nothing "mnogosearch" related at all in "PHPINFO()"). I've added "extension=m

RE: [PHP] Register Globals

2004-10-25 Thread Jay Blanchard
[snip] I just signed up with a new hosting site. So first thing I did was check what phpinfo() had to say. I see that register_globals is turned on. Now I always use the $_GET and $_POST vars but will this still affect me? [/snip] Nope, you can keep using, and should keep using, the $_GET and $_P

[PHP] Register Globals

2004-10-25 Thread Matthew Sims
I just signed up with a new hosting site. So first thing I did was check what phpinfo() had to say. I see that register_globals is turned on. Now I always use the $_GET and $_POST vars but will this still affect me? -- --Matthew Sims -- -- PHP General Mailing List (ht

Re: [PHP] Php files with .html extension?

2004-10-25 Thread Curt Zirzow
* Thus wrote Greg Donald: > > The summary results: > > For 10K local requests: > 27.1 seconds with .html not parsed as PHP > vs. > 30.2 seconds with .html parsed as PHP. > > I only ran these tests locally, and only on the one server.. so it's > definatly not very scientific. I think we all sort

Re: [PHP] Content-Type header required for POST?

2004-10-25 Thread Chris Shiflett
--- Olaf van der Spek <[EMAIL PROTECTED]> wrote: > Since which version does PHP require the Content-Type header in > POST requests? Content-Type is required for any request that has content. It's an HTTP requirement and has very little to do with PHP. Can you explain what you're talking about? C

Re: [PHP] Php files with .html extension?

2004-10-25 Thread Greg Donald
On Mon, 25 Oct 2004 16:30:14 +0100, Graham Cossey <[EMAIL PROTECTED]> wrote: > Do not forget that if you do this ALL files with the .html extension will be > parsed by PHP whether they are PHP scripts or not which could be something > you need to consider from a performance perspective. I setup a

Re[4]: [PHP] Php files with .html extension?

2004-10-25 Thread Richard Davey
Hello Trevor, Monday, October 25, 2004, 6:31:07 PM, you wrote: GT> I could see someone wanting to use .html to obscure the fact that GT> they were using PHP scripts (for various reason), but if that's GT> intended as a security measure, then it's classic security through GT> obscurity, which will

[PHP] Re: PHP Crypt on MacOSX

2004-10-25 Thread Daniel Schierbeck
Kris wrote: I recently moved a site to a MacOSX based Apache/PHP server. Apparently crypt only uses DES. I read somewhere that "there is no way to get it use use MD5", which sounds hard to beleive considering the OS is BSD based. So.. here is my dilema.. My db contains usernames and passwords.

Re: [PHP] Re: overiding functions (constructors mostly)

2004-10-25 Thread Daniel Schierbeck
M Saleh Eg wrote: Exactly Daniel ! I should've mentioned that too. Thanx for making it clear. No problem 8) -- Daniel Schierbeck Help spread Firefox (www.getfirefox.com): http://www.spreadfirefox.com/?q=user/register&r=6584 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: Re[2]: [PHP] Php files with .html extension?

2004-10-25 Thread Gryffyn, Trevor
> True, it doesn't do anything other than output the HTML. But it's that > "load - scan - determine - output" that takes up CPU time and memory. > > Sure, on most sites it doesn't matter one bit. But on popular sites.. > well, you can do the math I'm sure. > > I guess at the end of the day it com

[PHP] Content-Type header required for POST?

2004-10-25 Thread Olaf van der Spek
Hi, Since which version does PHP require the Content-Type header in POST requests? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re[2]: [PHP] Php files with .html extension?

2004-10-25 Thread Richard Davey
Hello Trevor, Monday, October 25, 2004, 4:47:53 PM, you wrote: GT> processed by PHP? I mean, if the PHP parser goes through and never sees GT> a that's something, but is it anything really significant. True, it doesn't do anything other than output the HTML. But it's that "load - scan - determ

[PHP] php extension problem

2004-10-25 Thread Pierre Ancelot
Hi ! I am having some trouble creating a php extension. as show in the documentation i did a ./ext_skel --extname=mymodule which created the directory mymodule i edited the config.m4 file to tune it to something very basic : PHP_ARG_WITH(mymodule, for mymodule support, [ --with-mymodule

Re: [PHP] Re: overiding functions (constructors mostly)

2004-10-25 Thread M Saleh EG
Exactly Daniel ! I should've mentioned that too. Thanx for making it clear. On Mon, 25 Oct 2004 15:45:36 +0200, Daniel Schierbeck <[EMAIL PROTECTED]> wrote: > M Saleh Eg wrote: > > OR you could control ur method and have optional arguments in ur > > argument list and decide what to do according t

[PHP] PHP Crypt on MacOSX

2004-10-25 Thread Kris
I recently moved a site to a MacOSX based Apache/PHP server. Apparently crypt only uses DES. I read somewhere that "there is no way to get it use use MD5", which sounds hard to beleive considering the OS is BSD based. So.. here is my dilema.. My db contains usernames and passwords. The passw

Re: [PHP] cant override session variables

2004-10-25 Thread Richard Davey
Hello, Monday, October 25, 2004, 3:13:02 PM, you wrote: LPdS> I know globals are on...what's a happening? why the LPdS> variables are cleaned fine why there's no override? Are you trying to do all of that in the same script? Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP De

RE: [PHP] Php files with .html extension?

2004-10-25 Thread Gryffyn, Trevor
That's definitely a good point. I'm curious though, would it really be a significant performance issue? Even if a lot of HTML files are being processed by PHP? I mean, if the PHP parser goes through and never sees a -Original Message- > From: Graham Cossey [mailto:[EMAIL PROTECTED] > S

RE: [PHP] Php files with .html extension?

2004-10-25 Thread Graham Cossey
Do not forget that if you do this ALL files with the .html extension will be parsed by PHP whether they are PHP scripts or not which could be something you need to consider from a performance perspective. > -Original Message- > From: Jay Blanchard [mailto:[EMAIL PROTECTED] > Sent: 25 Octob

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Francisco M. Marzoa Alonso
Curt Zirzow wrote: * Thus wrote Francisco M. Marzoa Alonso: FYI, the reason I need this is because I'm creating my own object's serialization routines. Why would you want to do this? I was walking through the forest when, suddenly, a white light comes from the west through the trees ca

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Curt Zirzow
* Thus wrote Francisco M. Marzoa Alonso: > > FYI, the reason I need this is because I'm creating my own object's > serialization routines. Why would you want to do this? Curt -- Quoth the Raven, "Nevermore." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://ww

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Francisco M. Marzoa Alonso
Marek Kilimajer wrote: Francisco M. Marzoa Alonso wrote: [EMAIL PROTECTED] wrote: No. You need to remember that in most cases where you cast a variable from one type to another, you will experience data (precision) loss. This is also the case in converting an object to an array. Only the properti

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Marek Kilimajer
Francisco M. Marzoa Alonso wrote: [EMAIL PROTECTED] wrote: No. You need to remember that in most cases where you cast a variable from one type to another, you will experience data (precision) loss. This is also the case in converting an object to an array. Only the properties are copied over (sin

[PHP] cant override session variables

2004-10-25 Thread Lizet Peña de Sola
Hi all, This is drving me insane... I have a logout script, logout.php: that effectively cleans the session variables. However, when i try to set them again, they won't take the new values: will print: username_session blank... I know globals are on...what's a happening? why the vari

Re: [PHP] Php files with .html extension?

2004-10-25 Thread Matt M.
> How can i do a php script with a html extensionsuch as > http://www.blinds-wise.com/shop/p/blind/bid/1/venetian_blinds.html > apache could do this a couple ways http://httpd.apache.org/docs/mod/mod_mime.html#addhandler http://httpd.apache.org/docs-2.0/mod/core.html#setinputfilter http://h

RE: [PHP] Php files with .html extension?

2004-10-25 Thread Jay Blanchard
[snip] How can i do a php script with a html extensionsuch as http://www.blinds-wise.com/shop/p/blind/bid/1/venetian_blinds.html [/snip] You set it up in your httpd.conf You should have AddType application/x-httpd-php .php change it to AddType application/x-httpd-php .php .html -- PHP Gen

Re: [PHP] Php files with .html extension?

2004-10-25 Thread Brian V Bonini
On Mon, 2004-10-25 at 09:37, Phpu wrote: > Hi, > > How can i do a php script with a html extensionsuch as > http://www.blinds-wise.com/shop/p/blind/bid/1/venetian_blinds.html > AddType application/x-httpd-php .php .php3 .html -- s/:-[(/]/:-)/g BrianGnuPG -> KeyID: 0x04A4F0DC |

Re: [PHP] Php files with .html extension?

2004-10-25 Thread Greg Donald
On Mon, 25 Oct 2004 16:37:52 +0300, Phpu <[EMAIL PROTECTED]> wrote: > How can i do a php script with a html extensionsuch as > http://www.blinds-wise.com/shop/p/blind/bid/1/venetian_blinds.html If you use Apache you can edit you httpd.conf and add: AddType application/x-httpd-php .html --

Re: [PHP] Re: Convert an array in an object instance

2004-10-25 Thread Francisco M. Marzoa Alonso
[EMAIL PROTECTED] wrote: No. You need to remember that in most cases where you cast a variable from one type to another, you will experience data (precision) loss. This is also the case in converting an object to an array. Only the properties are copied over (since functions can not be part of an a

Re: [PHP] Re: overiding functions (constructors mostly)

2004-10-25 Thread Daniel Schierbeck
M Saleh Eg wrote: OR you could control ur method and have optional arguments in ur argument list and decide what to do according to that. e.g. public function _construct($param1=0, $param2="", $param3=null) { if($param1) if($param2) if($param3) } $obj=new className(

[PHP] Re: Php files with .html extension?

2004-10-25 Thread M. Sokolewicz
Phpu wrote: Hi, How can i do a php script with a html extensionsuch as http://www.blinds-wise.com/shop/p/blind/bid/1/venetian_blinds.html Thanks when using eg. apache, you can add a .htaccess file with the following line: AddType application/x-httpd-php .html That will overwrite the "normal" w

Re: [PHP] Substr

2004-10-25 Thread M. Sokolewicz
split() uses the POSIX regular expressions engine, and thus also uses regular expressions. The loading of this engine is a massive overhead when dealing with simple splitting of a string. To do basic things like this it's a lot faster to use explode(). - Tul Francisco M. Marzoa Alonso wrote: Yo

[PHP] Php files with .html extension?

2004-10-25 Thread Phpu
Hi, How can i do a php script with a html extensionsuch as http://www.blinds-wise.com/shop/p/blind/bid/1/venetian_blinds.html Thanks

Re: [PHP] Passing regexp substrings to a function

2004-10-25 Thread Octavian Rasnita
Hi, In perl, you can do something like: $string =~ s/---piece of text that contains a certain (VALUE) in it---/&function($1)/gse; This expression replaces its first part with the result of the function "function" called with the parameter "VALUE". Is this what you want? Maybe you can do somethi

Re: [PHP] Need function to process tab delimited file using associative array

2004-10-25 Thread Eric Wood
- Original Message - From: "Justin French"> > The disadvantage is that you have to loop through the data twice (once > as a tab-delimited file, once as an assoc. array), which would have > obvious problems when there's a large set of data that needs to be > looped through often. > Justin

RE: [PHP] Substr

2004-10-25 Thread Graham Cossey
What about using explode()? $array = explode('_', 'pid_1_date_2004_10_25'); $pid = $array[1]; $yr = $array[3]; $mn = $array[4]; $dy = $array[5]; Graham > -Original Message- > From: Shaun [mailto:[EMAIL PROTECTED] > Sent: 25 October 2004 14:00 > To: [EMAIL PROTECTED] > Subject: [PHP] Subs

Re: [PHP] Substr

2004-10-25 Thread Francisco M. Marzoa Alonso
You can also use split function if you do not know about regular expressions and do not want to learn: $string = "pid_1_date_2004_10_25"; $regs = split ("_", $string ); print_r ($regs); ?> I think its autoexplicative. Shaun wrote: Hi, I have a string as follows: pid_1_date_2004_10_25 pid tells m

Re: [PHP] A problem about urlencode

2004-10-25 Thread raditha dissanayake
Teng Wang wrote: I have a url containing some multi-byte characters. So I need urlencode() to change these characters into the %xx form. However, when I encode the whole url string, "/" is also be encoded as "%2F". How to solve this problem? I don't want to analyze the url string before/after urlen

Re: [PHP] Substr

2004-10-25 Thread Francisco M. Marzoa Alonso
Use regular expresions: $string = "pid_1_date_2004_10_25"; preg_match ( '/^pid_(.*?)_date_(.*?)$/', $string, $regs ); print_r ($regs); ?> Shaun wrote: Hi, I have a string as follows: pid_1_date_2004_10_25 pid tells me the Project_ID and date tells me the date(!). I need to extract this informatio

Re: [PHP] Substr

2004-10-25 Thread raditha dissanayake
Shaun wrote: However, to get the Project ID I need to extract everything after 'pid_' and everything before 'date_'. Can someone help me with this please as PHP doesn't seem to provide a function for extracting information from a string that occurs before the 'needle'? yes it doe. look under re

[PHP] Substr

2004-10-25 Thread Shaun
Hi, I have a string as follows: pid_1_date_2004_10_25 pid tells me the Project_ID and date tells me the date(!). I need to extract this information from the string so to get the date I need everything after 'date_' as follows: substr(strstr($key, 'date_'), 4) However, to get the Project ID I

[PHP] Re: Convert an array in an object instance

2004-10-25 Thread M. Sokolewicz
Francisco M. Marzoa Alonso wrote: Hi, Is it possible to convert an array in an object instance? I can convert an object in an array as follows: $Test = new MyClass (); $TestArray = (array) $Test; Then I've an array with all members of the object $Test, but it seems that I cannot simply do: $TestObj

[PHP] Passing regexp substrings to a function

2004-10-25 Thread Ville Mattila
Hi there, I have a few e-mail templates in a file that should be parsed. A template can include also some "module codes" that should be replaced by a return value of a certain function. For example, if the template include a text "{ProductInfo:1032}", the value 1032 would be passed as an argume

[PHP] Convert an array in an object instance

2004-10-25 Thread Francisco M. Marzoa Alonso
Hi, Is it possible to convert an array in an object instance? I can convert an object in an array as follows: $Test = new MyClass (); $TestArray = (array) $Test; Then I've an array with all members of the object $Test, but it seems that I cannot simply do: $TestObject = (MyClass) $TestArray; To rec

Re: [PHP] Most efficient way of fetching 1,000 records from MySQL ?

2004-10-25 Thread Steve McGill
> > I think you'll find that your first approach is not only more correct, > > it's the only manageable one. > > No, it will be very slow. The biggest overhead is in transfering data to > and from sql server. It's always better to get the results in one sql query. > > Use this aproach: > > $users =

RE: [PHP] Most efficient way of fetching 1,000 records from MySQL ?

2004-10-25 Thread Graham Cossey
I would certainly agree with Marek. I recently changed a query from using 20 or so 'OR' conditions to use the 'IN' statement and it drastically improved the performance of the query. Graham > -Original Message- > From: Marek Kilimajer [mailto:[EMAIL PROTECTED] > Sent: 25 October 2004 11:

RE: [PHP] chm file for tutorial

2004-10-25 Thread murugesan
Thanks Marek... > Mail > You just did. and got the answer from the tutorial... Regards, Dinesh_P_V -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Monday, October 25, 2004 4:58 PM To: [EMAIL PRO

Re: [PHP] chm file for tutorial

2004-10-25 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote: Hello all, I am new to PHP programming.. It will be nice to have a chm file on php tutorial. Can anyone point me to that location ? http://www.php.net/download-docs.php Also I would like to know how how to code the following line ? Mail

[PHP] chm file for tutorial

2004-10-25 Thread murugesan
Hello all, I am new to PHP programming.. It will be nice to have a chm file on php tutorial. Can anyone point me to that location ? Also I would like to know how how to code the following line ? Mail Regards, Dinesh_P_V

[PHP] Sessions problem bug

2004-10-25 Thread Reinhart Viane
Some days ago I asked some questions concerning php and sessions Apparently it seems to be a bug: 'When you use a session name that has only numbers, each call to session_start seems to regenerate a new session id, so the session does not persist.' http://bugs.php.net/search.php?search_for=sessio

Re: [PHP] Most efficient way of fetching 1,000 records from MySQL ?

2004-10-25 Thread Marek Kilimajer
Ian Firla wrote: I think you'll find that your first approach is not only more correct, it's the only manageable one. No, it will be very slow. The biggest overhead is in transfering data to and from sql server. It's always better to get the results in one sql query. Use this aproach: $users = sq

Re: [PHP] transfer file

2004-10-25 Thread raditha dissanayake
Akshay wrote: How to transfer text file from one machine to another using php Please give the code if possible It depends on what protocol you want to use. Please pick from FTP, HTTP, NFS etc and let us know. akshay -- Raditha Dissanayake.

Re: [PHP] Most efficient way of fetching 1,000 records from MySQL ?

2004-10-25 Thread Ian Firla
I think you'll find that your first approach is not only more correct, it's the only manageable one. Ian On Mon, 2004-10-25 at 10:15 +0200, Steve McGill wrote: > Hello, > > In my script I have generated an array of 1,000 userIDs for example. Now for > I need to fetch each user's record and I am

[PHP] Most efficient way of fetching 1,000 records from MySQL ?

2004-10-25 Thread Steve McGill
Hello, In my script I have generated an array of 1,000 userIDs for example. Now for I need to fetch each user's record and I am wondering what is the best way to go about it: 1) 1000 sql queries // code is sort of pseudo for clarity foreach($users as $userID) { $user = sql("select * from user

[PHP] transfer file

2004-10-25 Thread Akshay
How to transfer text file from one machine to another using php Please give the code if possible akshay -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] transfer file

2004-10-25 Thread Akshay
How to transfer text file from one machine to another using php Please give the code if possible akshay -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Need function to process tab delimited file using associative array

2004-10-25 Thread Justin French
On 25/10/2004, at 12:22 PM, Eric Wood wrote: Does anyone have a function stored away that can selectively let me trim out only the columns *by name* I need from a delimited text file? For Example: FNameLNamePhone JohnSmith345335 JamesSmith2345223533 JudySmith5474574544 I think (at least for c

  1   2   >