php-general Digest 30 Nov 2005 01:53:23 -0000 Issue 3823

2005-11-29 Thread php-general-digest-help
php-general Digest 30 Nov 2005 01:53:23 - Issue 3823 Topics (messages 226583 through 226611): preg_slipt 226583 by: Sichta Daniel 226584 by: David Grant 226585 by: David Precious 226586 by: David Grant 226587 by: David Precious exclude part of text

Re: [PHP] Re: PhpMailer vs Pear:Mail

2005-11-29 Thread Richard Heyes
Petr Smith wrote: Cabbar Duzayak wrote: Could you please tell which one you recommend in terms of stability/speed and share your experience in terms of these 2? Thanks... I tried all and ended with http://www.phpguru.org/static/htmlMimeMail5.html fast, stable, usable. A very good

Re: [PHP] help avoid multiple login

2005-11-29 Thread Jochem Maas
Matt Monaco wrote: If you store your login object in a session, when the browser window is closed the object will automatically be destroyed, thus calling the destructor. exactly what is it that triggers the object destruction??? since when is it normal practice for a browser to do a request

Re: [PHP] help avoid multiple login

2005-11-29 Thread Richard Heyes
Jochem Maas wrote: it might be possible to use some browser plugin to hit the server if it notices that it's window is being closed... although I have a sneaking suspicion that Flash, for instance, has the same problem as javascript with not being able to differentiate between the page

RE: [PHP] Database problem?

2005-11-29 Thread Ford, Mike
On 28 November 2005 19:28, Jim Moseby wrote: Damn! It Worked. Thanks :) Even so, John's excellent advice should still be taken. You should not generally code with a dependence on register_globals, for reasons you have just seen. Also, it seems likely that register_globals will go

[PHP] Re: Two version of PHP in single server

2005-11-29 Thread Petr Smith
Run two Apache servers, second (with old PHP version) on another port. Internally forward all requests to old PHP project to this second server. We tested most methods but this was the best. Petr J.F.Kishor wrote: Hi, Thanks...! Even the second is server-parsed not cgi Some

Re: [PHP] help avoid multiple login

2005-11-29 Thread Jochem Maas
Richard Heyes wrote: Jochem Maas wrote: it might be possible to use some browser plugin to hit the server if it notices that it's window is being closed... although I have a sneaking suspicion that Flash, for instance, has the same problem as javascript with not being able to differentiate

[PHP] preg_slipt

2005-11-29 Thread Sichta Daniel
Hi all !!! I have string like this 1234567890 I need to split this into array like this a[0] = 12 a[1] = 34 a[2] = 56 a[3] = 78 a[4] = 90 I know that for this is preg_split, but I don't know the string patern for split. Thank you in advance !! Dan

Re: [PHP] preg_slipt

2005-11-29 Thread David Grant
Hi Dan, Try: $a = split(\n, chunk_split('1234567890', 2), 5); php.net/chunk_split php.net/split Cheers, David Grant Sichta Daniel wrote: Hi all !!! I have string like this 1234567890 I need to split this into array like this a[0] = 12 a[1] = 34 a[2] = 56 a[3] = 78 a[4] = 90

Re: [PHP] preg_slipt

2005-11-29 Thread David Precious
On 29/11/05, Sichta Daniel [EMAIL PROTECTED] wrote: Hi all !!! I have string like this 1234567890 I need to split this into array like this a[0] = 12 a[1] = 34 a[2] = 56 a[3] = 78 a[4] = 90 I know that for this is preg_split, but I don't know the string patern for split. Thank you in

Re: [PHP] preg_slipt

2005-11-29 Thread David Grant
There is an error in this code. It should in fact read: $a = split(\r\n, chunk_split('1234567890', 2), 5); OR $a = split(\n, chunk_split('1234567890', 2, \n), 5); David Grant wrote: Hi Dan, Try: $a = split(\n, chunk_split('1234567890', 2), 5); php.net/chunk_split php.net/split

Re: [PHP] preg_slipt

2005-11-29 Thread David Precious
No, preg_split would be overkill here, you want to take a look at str_split: Sorry I forgott to tell that I'm not using PHP 5.x :-) Ahhh, right - my answer won't be of much use to you then :-) In that case, David Grant's suggestion of using chunk_split() in combination with split() is

[PHP] exclude part of text

2005-11-29 Thread 021
Hi, need some help with this one i made a page which is reading the last line from a log file. the log is formatted like this: text1 MAIN TEXT *text2 i need to get only the MAIN TEXT part, i don't need the text1 and *text2 i'm using this code ?php $lines = file('sometext.txt'); for ($i =

Re: [PHP] exclude part of text

2005-11-29 Thread David Grant
Hi, 021 wrote: ?php $lines = file('sometext.txt'); for ($i = 0, $j = count($lines); $i =1; $i++) { print $lines[$j - $i]; } ? For a start, try this instead: $lines = file('sometext.ext'); $last = end($lines); Secondly, do you have an example of the real log file? Cheers, David Grant

Re: [PHP] exclude part of text

2005-11-29 Thread 021
the log file is from a radio playlist: TIME ARTIST - TITLE *SONG_CATEGORY for example 17:12:26 THE CURE - ALT.END *NEW the values before and after * are changing, hope there's a simple solution for this thanx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] exclude part of text

2005-11-29 Thread David Grant
Please try: preg_match('/^[^\]*\(.*)\*.*$/', $line, $matches); 021 wrote: the log file is from a radio playlist: TIME ARTIST - TITLE *SONG_CATEGORY for example 17:12:26 THE CURE - ALT.END *NEW the values before and after * are changing, hope there's a simple solution for this

[PHP] when to enter submitted in mysql?

2005-11-29 Thread [EMAIL PROTECTED]
Hi to all! I have form made on 4 pages (by groups of questions). Right now my code works this way: once somebody submit the first page of the form his/her submitted info is entered in database with status=temp. I store the ID (insert_id()) in session and then every time visitor submit the next

[PHP] Re: Two version of PHP in single server

2005-11-29 Thread Ben Litton
You can do this if you register a different add-type. Say php5 for the php 5.1 pages and just php for the regular ones. You may (I can't recall) have to install one as mod_php and the other as a cgi. There are surely guides on the internet to help you get both running simultaneously. On

RE: [PHP] when to enter submitted in mysql?

2005-11-29 Thread Jim Moseby
Hi to all! I have form made on 4 pages (by groups of questions). Right now my code works this way: once somebody submit the first page of the form his/her submitted info is entered in database with status=temp. I store the ID (insert_id()) in session and then every time visitor

Re: [PHP] when to enter submitted in mysql?

2005-11-29 Thread David Grant
Personally, I'd keep it all in the session and write at the end, but this approach has at least two drawbacks: 1. The user cannot complete the process at a later point. 2. You cannot conduct analysis of part-completed data. Cheers, David Grant [EMAIL PROTECTED] wrote: Hi to all! I have form

Re: [PHP] Problem with Frames and Sessions

2005-11-29 Thread Brent Baisley
Frames are just nested windows, the server can't tell the difference between a page requested from a frame or a separate window and you should treat them as such. So if your frame was created before a session was created, it's not part of the session. On Nov 28, 2005, at 6:52 PM, Shaun

[PHP] Re: when to enter submitted in mysql?

2005-11-29 Thread Todd Cary
I track my sessions in the MySQL database in the session table. There is a field, ExpireTime, so the table is self purging. For the pages, I place them into a table, tmp_data, that has a sessionID field and ExpireTime. When all pages are completed, the data is inserted into the data table.

Re: [PHP] Re: when to enter submitted in mysql?

2005-11-29 Thread [EMAIL PROTECTED]
Ok. I got a picture. :) Thanks to everybody! -afan Todd Cary wrote: I track my sessions in the MySQL database in the session table. There is a field, ExpireTime, so the table is self purging. For the pages, I place them into a table, tmp_data, that has a sessionID field and ExpireTime.

[PHP] Howto search in SQL for a specific character?

2005-11-29 Thread Gustav Wiberg
Hi there! in PHP i Write.. $v1 = chr(39); //39 is apostrofe $sql = SELECT nameOfPedigree FROM tbpedigrees WHERE SUBSTR(nameOfPedigree,0,1) = $v1; Why doesn't this work? I want the sql to select all nameOfPedigree - fields where the first character is apostrofe (') /G

RE: [PHP] Howto search in SQL for a specific character?

2005-11-29 Thread Jay Blanchard
[snip] $v1 = chr(39); //39 is apostrofe $sql = SELECT nameOfPedigree FROM tbpedigrees WHERE SUBSTR(nameOfPedigree,0,1) = $v1; Why doesn't this work? [/snip] Probably because the character set is misinterpreted. What happens when you echo $v1? Try $sql = SELECT nameOfPedigree FROM tbpedigrees

Re: [PHP] Howto search in SQL for a specific character?

2005-11-29 Thread Gustav Wiberg
Hi I'm sorry but this didn't work either? If I replaced the ' with for example an a it worked /G - Original Message - From: Stephen Johnson [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED]; PHP General php-general@lists.php.net Sent: Tuesday, November 29, 2005 10:00 PM

Re: [PHP] Howto search in SQL for a specific character?

2005-11-29 Thread Gustav Wiberg
Hi there! This didn't work. Ok, mysql 4.x don't have support for the command. Exuse my.. didn't realize that before... I have to do this another way around... :-) /G - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: 'Gustav Wiberg' [EMAIL PROTECTED]; PHP General

RE: [PHP] Howto search in SQL for a specific character?

2005-11-29 Thread Jay Blanchard
[snip] This didn't work. Ok, mysql 4.x don't have support for the command. Exuse my.. didn't realize that before... I have to do this another way around... [/snip] Doesn;t have support for what command? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Howto search in SQL for a specific character?

2005-11-29 Thread tg-php
Probably because the apostrophe aka single quote is used the same way it and the double quotes () are used in PHP, as a string delimiter. What you're ending up with is: SELECT nameOfPedigree FROM tbpedigrees WHERE SUBSTR(nameOfPedigree,0,1) = ' What you'd want is something more like: SELECT

Re: [PHP] Howto search in SQL for a specific character?

2005-11-29 Thread Stephen Johnson
Try this : $sql = SELECT nameOfPedigree FROM tbpedigrees WHERE nameOfPedigree like '%; The % is a wildcard and will give you the results you want. ?php /* Stephen Johnson c | eh The Lone Coder http://www.ouradoptionblog.com Join our journey of adoption http://www.thelonecoder.com [EMAIL

FW: [PHP] Howto search in SQL for a specific character? SOLVED

2005-11-29 Thread Jay Blanchard
FW to the listeven if it is top posting -Original Message- From: Gustav Wiberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 3:49 PM To: Jay Blanchard Subject: Re: [PHP] Howto search in SQL for a specific character? aha... ok.. that was the fault! Thanx! :-) /G -

[PHP] migrating from http to https...

2005-11-29 Thread ganu
Hi all , I have a problem , when I am migrating my data from http://www.abc.com http://www.abc.com/ to https://www.abc.com https://www.abc.com/ for secure login purpose. I will loose all my data which I store in my session. if suppose I am able to do it from http to https then from https to

[PHP] Schroedinger's Bug - may require exorcism...

2005-11-29 Thread Adam Atlas
So... I have this script (being called in a perfectly typical way by PHP 4.4.1 through mod_php in Apache 2.0.55) which sometimes runs perfectly, and sometimes chooses, totally haphazardly, to seemingly run itself twice, which of course causes it to die with a fatal error after it tries to

Re: [PHP] Schroedinger's Bug - may require exorcism...

2005-11-29 Thread Robert Cummings
On Tue, 2005-11-29 at 19:22, Adam Atlas wrote: So... I have this script (being called in a perfectly typical way by PHP 4.4.1 through mod_php in Apache 2.0.55) which sometimes runs perfectly, and sometimes chooses, totally haphazardly, to seemingly run itself twice, which of course

Re: [PHP] Re: PhpMailer vs Pear:Mail

2005-11-29 Thread Max Schwanekamp
Richard Heyes wrote: Petr Smith wrote: I tried all and ended with http://www.phpguru.org/static/htmlMimeMail5.html fast, stable, usable. A very good choice. ;-) But but but, what *is* the advantage of one over the other? I've been a PhpMailer devotee for some time. PEAR::Mail is too

Re: [PHP] Schroedinger's Bug - may require exorcism...

2005-11-29 Thread Robert Cummings
On Tue, 2005-11-29 at 19:42, Robert Cummings wrote: On Tue, 2005-11-29 at 19:22, Adam Atlas wrote: So... I have this script (being called in a perfectly typical way by PHP 4.4.1 through mod_php in Apache 2.0.55) which sometimes runs perfectly, and sometimes chooses, totally haphazardly,

[PHP] checkboxes

2005-11-29 Thread blackwater dev
I have a form where I am dynamically building a bunch of checkbox inputs. Then when submitted, I need to update the db. Problem is, of course, if the checkbox is unchecked then the $_POST doesn't have the value in the array. How can I get the value from $_POST even though it's unchecked? For

[PHP] url vs dirname(__FILE__)

2005-11-29 Thread Chris
I trying to create an absolute path to include scripts and images in another directory. For includes, I have found $path = dirname(__FILE__) ./mydir/myscript.php; However, I am unable to reference an image using this path, like echo img src= . dirname(__FILE__) . /mydir/myimage.gif; To

[PHP] help avoid multiple login

2005-11-29 Thread mail.pmpa
-Mensagem original- De: Jochem Maas (...) the normal way of doing session 'closing' is by way of 'garbage collection' - every now and then a script/process/function is run that 'closes' any sessions which are (according to your criteria) inactive. php has stuff built it that will do this

[PHP] help avoid multiple login

2005-11-29 Thread mail.pmpa
-Mensagem original- De: Jochem Maas (...) the normal way of doing session 'closing' is by way of 'garbage collection' - every now and then a script/process/function is run that 'closes' any sessions which are (according to your criteria) inactive. php has stuff built it that will do this

Re: [PHP] url vs dirname(__FILE__)

2005-11-29 Thread Chris Shiflett
Chris wrote: I trying to create an absolute path to include scripts and images in another directory. These are two different things, but there is a relationship in the sense that URLs are translated to filesystem paths using document root: http://host/path/to/script.php = [document

Re: [PHP] Re: PhpMailer vs Pear:Mail

2005-11-29 Thread Manuel Lemos
Hello, on 11/29/2005 10:59 PM Max Schwanekamp said the following: Richard Heyes wrote: Petr Smith wrote: I tried all and ended with http://www.phpguru.org/static/htmlMimeMail5.html fast, stable, usable. A very good choice. ;-) But but but, what *is* the advantage of one over the other?

[PHP] Re: checkboxes

2005-11-29 Thread Matt Monaco
Well if your keys are a straight sequence of numbers instead of a foreach you can do a for loop and for those whose value is not one, set to zero. Matt blackwater dev [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a form where I am dynamically building a bunch of checkbox

[PHP] How do i display a neat table of returned mysql data?

2005-11-29 Thread Dave Carrera
Hi List, I have some mysql table data that i would like to display back to the web user in a neat and tidy way using php. Data: col1 col2 col3 test 1.99 F test 1.99 F test 1.99 F test 0.99 F test 1.99 F bang 2.99 F bang 3.99 F bang 4.49 F bang 2.99 F bang 2.99

Re: [PHP] Re: PhpMailer vs Pear:Mail

2005-11-29 Thread Curt Zirzow
On Tue, Nov 29, 2005 at 04:59:55PM -0800, Max Schwanekamp wrote: Richard Heyes wrote: Petr Smith wrote: I tried all and ended with http://www.phpguru.org/static/htmlMimeMail5.html fast, stable, usable. A very good choice. ;-) But but but, what *is* the advantage of one over the other?

Re: [PHP] Re: Two version of PHP in single server

2005-11-29 Thread Curt Zirzow
On Tue, Nov 29, 2005 at 09:31:25AM +0100, Petr Smith wrote: Run two Apache servers, second (with old PHP version) on another port. Internally forward all requests to old PHP project to this second server. you know I almost suggested this method, the only problem i had with this is that well if

Re: [PHP] when to enter submitted in mysql?

2005-11-29 Thread Curt Zirzow
On Tue, Nov 29, 2005 at 11:57:49AM -0500, Jim Moseby wrote: Hi to all! I have form made on 4 pages (by groups of questions). Right now my code works this way: once somebody submit the first page of the form his/her submitted info is entered in database with status=temp. I store

Re: [PHP] migrating from http to https...

2005-11-29 Thread Curt Zirzow
On Wed, Nov 30, 2005 at 06:06:18AM +0530, ganu wrote: Hi all , I have a problem , when I am migrating my data from http://www.abc.com http://www.abc.com/ to https://www.abc.com https://www.abc.com/ for secure login purpose. I will loose all my data which I store in my session. How do you

Re: [PHP] checkboxes

2005-11-29 Thread Curt Zirzow
On Tue, Nov 29, 2005 at 10:15:36PM -0500, blackwater dev wrote: I have a form where I am dynamically building a bunch of checkbox inputs. Then when submitted, I need to update the db. Problem is, of course, if the checkbox is unchecked then the $_POST doesn't have the value in the array.