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
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
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
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
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
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
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
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
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
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
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
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
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 =
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
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:
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
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
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
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
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
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
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.
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.
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
[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
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
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
[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:
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
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 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
-
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
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
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
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
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,
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
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
-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
-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
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
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?
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
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
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?
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
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
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
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.
49 matches
Mail list logo