php-general Digest 8 Mar 2003 06:29:07 -0000 Issue 1925
Topics (messages 138671 through 138724):
Re: fopen/fgets
138671 by: Bryan Koschmann - GKT
Re: MySQL Alias and PHP
138672 by: Charles Kline
138676 by: Jim Lucas
138700 by: Charles Kline
138704 by: Barajas, Arturo
138705 by: Charles Kline
138707 by: Barajas, Arturo
Running PHP 4 & PHP 5 Simultaneously
138673 by: Jason Lange
138701 by: Dan Rossi
Displaying few words from record in mySQL
138674 by: Rahul.Brenda
138678 by: Kevin Stone
138690 by: Rahul.Brenda
Re: Checking for Null Variables
138675 by: Christopher J. Crane
Min and max of array
138677 by: Liam Gibbs
138679 by: Kevin Stone
138682 by: Liam Gibbs
138684 by: Jim Lucas
138687 by: Kevin Stone
Re: require_once adds a "1"
138680 by: Gary
138681 by: Ernest E Vogelsinger
138695 by: Gary
Access
138683 by: Kiswa
Re: test for rtf
138685 by: Brady Hegberg
Problem
138686 by: Kiswa
138711 by: Jason Sheets
Re: populating textarea with data
138688 by: Hugh Danaher
PERL/PHP, MSSQL, Unix AIX
138689 by: Poon, Kelvin (Infomart)
Global VARS.
138691 by: Vincent M.
Screen
138692 by: Kiswa
138693 by: Florin Dumitrescu
Problem with copy (maybe a bug ?)
138694 by: Arthur Chereau
138697 by: Marek Kilimajer
138699 by: Arthur Chereau
Re: Forcing page refresh with http headers?
138696 by: Daniel Joyce
138702 by: Brendon Gearin
PHP and DB2 on AS400
138698 by: Sridhar Moparthy
138716 by: Alejandro Trujillo J.
header function
138703 by: Barry Gould
138712 by: Jim Lucas
response.redirect
138706 by: Christopher Myatt
138708 by: Barajas, Arturo
138709 by: Setec Astronomy
Re: how to ssl on php
138710 by: Jason Sheets
Mining a file for data
138713 by: John Wulff
screenshot of an mpeg frame
138714 by: Dan Rossi
Your script possibly relies on a session side-effect which existed until PHP 4.2.3
138715 by: chris
Bizarre gethostbyname() problem
138717 by: Brad Hubbard
$PHPSESSID
138718 by: Liam Gibbs
Difference between & &&
138719 by: James Taylor
138723 by: Leo Spalteholz
138724 by: Greg Beaver
Executing PHP code in a database
138720 by: Leo Spalteholz
138721 by: Leo Spalteholz
Php +Xml?
138722 by: Dhaval Desai
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Thanks.. I feel stupid, I wasn't paying attention. *sigh* seems to work
now :)
Bryan
On Fri, 7 Mar 2003, Adrian Ciutureanu wrote:
|you close the input file in while loop ( fclose($fp); )
|
|"Bryan Koschmann - Gkt" <[EMAIL PROTECTED]> wrote in message
|news:[EMAIL PROTECTED]
|> Can someone give me a hand here? I am really lost as to what is
|going on.
|> I have a file that looks like this
|>
|> user1,Store 1 - ABC street
|> user2,Store 2 - Northside
|> user3,Store 3 - East
|>
|> I try to run my code, but I get a php log filled (~33 megs, the
|input file
|> is only 12 lines):
|>
|> [06-Mar-2003 15:22:53] PHP Warning: feof(): 1 is not a valid
|File-Handle
|> resource in /home/perf/create_prefs.php on line 7
|> [06-Mar-2003 15:22:53] PHP Warning: fgets(): 1 is not a valid
--- End Message ---
--- Begin Message ---
Thanks for the help. Almost there. Here is what I have:
SELECT x.id, x.headline, x.description, a.area area_a, b.area area_b
FROM tbl_funding x, tbl_dra a, tbl_dra b
GROUP BY x.id LIMIT 0 , 30
The problem is that $array[area_a] and $array[area_b] display the same
info.
On Friday, March 7, 2003, at 11:09 AM, Rich Gray wrote:
Hi all,
I have this query:
SELECT a.area_name, b.area_name FROM tbl_1 x, tbl_2 a, tbl_2 b
WHERE x.area_1 = a.id
AND x.area_2 = b.id
I am using PEAR DB to get my results as an ASSOC ARRAY. How do I echo
the values for a.id and b.id?
Thnks
Charles
I presume you mean area_name...
Try this -> SELECT a.area_name as area_a, b.area_name as area_b FROM
tbl_1
x, tbl_2 a, tbl_2 b
Then you can refer to the columns as $array['area_a'] and
$array['area_b']
HTH
Rich
--- End Message ---
--- Begin Message ---
Then the information in the DB is the same.
Jim
----- Original Message -----
From: "Charles Kline" <[EMAIL PROTECTED]>
To: "Rich Gray" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 10:03 AM
Subject: Re: [PHP] MySQL Alias and PHP
Thanks for the help. Almost there. Here is what I have:
SELECT x.id, x.headline, x.description, a.area area_a, b.area area_b
FROM tbl_funding x, tbl_dra a, tbl_dra b
GROUP BY x.id LIMIT 0 , 30
The problem is that $array[area_a] and $array[area_b] display the same
info.
On Friday, March 7, 2003, at 11:09 AM, Rich Gray wrote:
>> Hi all,
>>
>> I have this query:
>>
>> SELECT a.area_name, b.area_name FROM tbl_1 x, tbl_2 a, tbl_2 b
>> WHERE x.area_1 = a.id
>> AND x.area_2 = b.id
>>
>> I am using PEAR DB to get my results as an ASSOC ARRAY. How do I echo
>> the values for a.id and b.id?
>>
>> Thnks
>> Charles
>>
>
> I presume you mean area_name...
>
> Try this -> SELECT a.area_name as area_a, b.area_name as area_b FROM
> tbl_1
> x, tbl_2 a, tbl_2 b
> Then you can refer to the columns as $array['area_a'] and
> $array['area_b']
>
> HTH
> Rich
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Thanks for all the suggestions, I have tried all and more and still
can't get this quite right. If there is a better forum for these
question, please point me to it and I will take this somewhat off topic
thread elsewhere.
My table structure is like so:
tbl_1
id area_1 area_2
1 2 3
2 1 2
3 5 0
tbl_2
id area_name
1 funding
2 research
3 new
4 ongoing
5 other
So, I need to display all the records in tbl_1 and show the values for
the fields area_1 and area_2 as their area_name field from tbl_2. I
must display each record from tbl_1 only once. I know I am close, but I
just can't get this to work. The closest I have gotten is this:
SELECT DISTINCT a.area_name area_a, b.area_name area_b FROM tbl_1 x,
tbl_2 a, tbl_2 b
WHERE x.area_1 = a.id
OR x.area_2 = b.id GROUP BY x.id
But this ALWAYS returns the area_name (funding) in the value of area_b
(have no idea why)
Thanks for any help. It is appreciated.
- Charles
On Friday, March 7, 2003, at 01:42 PM, Jim Lucas wrote:
Then the information in the DB is the same.
Jim
----- Original Message -----
From: "Charles Kline" <[EMAIL PROTECTED]>
To: "Rich Gray" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 10:03 AM
Subject: Re: [PHP] MySQL Alias and PHP
Thanks for the help. Almost there. Here is what I have:
SELECT x.id, x.headline, x.description, a.area area_a, b.area area_b
FROM tbl_funding x, tbl_dra a, tbl_dra b
GROUP BY x.id LIMIT 0 , 30
The problem is that $array[area_a] and $array[area_b] display the same
info.
On Friday, March 7, 2003, at 11:09 AM, Rich Gray wrote:
Hi all,
I have this query:
SELECT a.area_name, b.area_name FROM tbl_1 x, tbl_2 a, tbl_2 b
WHERE x.area_1 = a.id
AND x.area_2 = b.id
I am using PEAR DB to get my results as an ASSOC ARRAY. How do I echo
the values for a.id and b.id?
Thnks
Charles
I presume you mean area_name...
Try this -> SELECT a.area_name as area_a, b.area_name as area_b FROM
tbl_1
x, tbl_2 a, tbl_2 b
Then you can refer to the columns as $array['area_a'] and
$array['area_b']
HTH
Rich
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Let's see:
SELECT
tbl_1.area_1,
areas1.area_name,
tbl_1.area_2,
areas2.area_name
FROM
tbl_1
INNER JOIN tbl_2 areas1 ON tbl_1.area_1 = areas1.id
INNER JOIN tbl_2 areas2 ON tbl_1.area_2 = areas2.id
Maybe if you tinker a little on the sentence. I don't have a place to test it right
now.
--
Un gran saludo/Big regards...
Arturo Barajas, IT/Systems PPG MX (SJDR)
(427) 271-9918, x448
> -----Original Message-----
> From: Charles Kline [mailto:[EMAIL PROTECTED]
> Sent: Viernes, 07 de Marzo de 2003 04:09 p.m.
> To: Jim Lucas
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] MySQL Alias and PHP
>
>
> Thanks for all the suggestions, I have tried all and more and still
> can't get this quite right. If there is a better forum for these
> question, please point me to it and I will take this somewhat
> off topic
> thread elsewhere.
>
> My table structure is like so:
>
> tbl_1
>
> id area_1 area_2
> 1 2 3
> 2 1 2
> 3 5 0
>
>
> tbl_2
>
> id area_name
> 1 funding
> 2 research
> 3 new
> 4 ongoing
> 5 other
>
>
> So, I need to display all the records in tbl_1 and show the
> values for
> the fields area_1 and area_2 as their area_name field from tbl_2. I
> must display each record from tbl_1 only once. I know I am
> close, but I
> just can't get this to work. The closest I have gotten is this:
>
> SELECT DISTINCT a.area_name area_a, b.area_name area_b FROM tbl_1 x,
> tbl_2 a, tbl_2 b
> WHERE x.area_1 = a.id
> OR x.area_2 = b.id GROUP BY x.id
>
> But this ALWAYS returns the area_name (funding) in the value
> of area_b
> (have no idea why)
>
> Thanks for any help. It is appreciated.
>
> - Charles
>
>
> On Friday, March 7, 2003, at 01:42 PM, Jim Lucas wrote:
>
> > Then the information in the DB is the same.
> >
> > Jim
> > ----- Original Message -----
> > From: "Charles Kline" <[EMAIL PROTECTED]>
> > To: "Rich Gray" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Friday, March 07, 2003 10:03 AM
> > Subject: Re: [PHP] MySQL Alias and PHP
> >
> >
> > Thanks for the help. Almost there. Here is what I have:
> >
> > SELECT x.id, x.headline, x.description, a.area area_a, b.area area_b
> > FROM tbl_funding x, tbl_dra a, tbl_dra b
> > GROUP BY x.id LIMIT 0 , 30
> >
> > The problem is that $array[area_a] and $array[area_b]
> display the same
> > info.
> >
> >
> >
> >
> >
> > On Friday, March 7, 2003, at 11:09 AM, Rich Gray wrote:
> >
> >>> Hi all,
> >>>
> >>> I have this query:
> >>>
> >>> SELECT a.area_name, b.area_name FROM tbl_1 x, tbl_2 a, tbl_2 b
> >>> WHERE x.area_1 = a.id
> >>> AND x.area_2 = b.id
> >>>
> >>> I am using PEAR DB to get my results as an ASSOC ARRAY.
> How do I echo
> >>> the values for a.id and b.id?
> >>>
> >>> Thnks
> >>> Charles
> >>>
> >>
> >> I presume you mean area_name...
> >>
> >> Try this -> SELECT a.area_name as area_a, b.area_name as
> area_b FROM
> >> tbl_1
> >> x, tbl_2 a, tbl_2 b
> >> Then you can refer to the columns as $array['area_a'] and
> >> $array['area_b']
> >>
> >> HTH
> >> Rich
> >>
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Wow. That is ALMOST it. The only thing is it does not return the record
with a 0 in tbl_1.area_2 - can you think of a workaround?
Thanks for the help,
Charles
On Friday, March 7, 2003, at 06:39 PM, Barajas, Arturo wrote:
Let's see:
SELECT
tbl_1.area_1,
areas1.area_name,
tbl_1.area_2,
areas2.area_name
FROM
tbl_1
INNER JOIN tbl_2 areas1 ON tbl_1.area_1 = areas1.id
INNER JOIN tbl_2 areas2 ON tbl_1.area_2 = areas2.id
Maybe if you tinker a little on the sentence. I don't have a place to
test it right now.
--
Un gran saludo/Big regards...
Arturo Barajas, IT/Systems PPG MX (SJDR)
(427) 271-9918, x448
-----Original Message-----
From: Charles Kline [mailto:[EMAIL PROTECTED]
Sent: Viernes, 07 de Marzo de 2003 04:09 p.m.
To: Jim Lucas
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL Alias and PHP
Thanks for all the suggestions, I have tried all and more and still
can't get this quite right. If there is a better forum for these
question, please point me to it and I will take this somewhat
off topic
thread elsewhere.
My table structure is like so:
tbl_1
id area_1 area_2
1 2 3
2 1 2
3 5 0
tbl_2
id area_name
1 funding
2 research
3 new
4 ongoing
5 other
So, I need to display all the records in tbl_1 and show the
values for
the fields area_1 and area_2 as their area_name field from tbl_2. I
must display each record from tbl_1 only once. I know I am
close, but I
just can't get this to work. The closest I have gotten is this:
SELECT DISTINCT a.area_name area_a, b.area_name area_b FROM tbl_1 x,
tbl_2 a, tbl_2 b
WHERE x.area_1 = a.id
OR x.area_2 = b.id GROUP BY x.id
But this ALWAYS returns the area_name (funding) in the value
of area_b
(have no idea why)
Thanks for any help. It is appreciated.
- Charles
On Friday, March 7, 2003, at 01:42 PM, Jim Lucas wrote:
Then the information in the DB is the same.
Jim
----- Original Message -----
From: "Charles Kline" <[EMAIL PROTECTED]>
To: "Rich Gray" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 10:03 AM
Subject: Re: [PHP] MySQL Alias and PHP
Thanks for the help. Almost there. Here is what I have:
SELECT x.id, x.headline, x.description, a.area area_a, b.area area_b
FROM tbl_funding x, tbl_dra a, tbl_dra b
GROUP BY x.id LIMIT 0 , 30
The problem is that $array[area_a] and $array[area_b]
display the same
info.
On Friday, March 7, 2003, at 11:09 AM, Rich Gray wrote:
Hi all,
I have this query:
SELECT a.area_name, b.area_name FROM tbl_1 x, tbl_2 a, tbl_2 b
WHERE x.area_1 = a.id
AND x.area_2 = b.id
I am using PEAR DB to get my results as an ASSOC ARRAY.
How do I echo
the values for a.id and b.id?
Thnks
Charles
I presume you mean area_name...
Try this -> SELECT a.area_name as area_a, b.area_name as
area_b FROM
tbl_1
x, tbl_2 a, tbl_2 b
Then you can refer to the columns as $array['area_a'] and
$array['area_b']
HTH
Rich
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
There are two ways,
Either have a "null" record on the area names, with a 0 as ID, or use a LEFT JOIN.
The LEFT JOIN clause permits you to have a linked table, and if it doesn't find a
match, it returns a NULL.
SELECT
tbl_1.area_1,
areas1.area_name,
tbl_1.area_2,
areas2.area_name
FROM
tbl_1
LEFT JOIN tbl_2 areas1 ON tbl_1.area_1 = areas1.id
LEFT JOIN tbl_2 areas2 ON tbl_1.area_2 = areas2.id
HTH
--
Un gran saludo/Big regards...
Arturo Barajas, IT/Systems PPG MX (SJDR)
(427) 271-9918, x448
> -----Original Message-----
> From: Charles Kline [mailto:[EMAIL PROTECTED]
> Sent: Viernes, 07 de Marzo de 2003 05:48 p.m.
> To: Barajas, Arturo
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] MySQL Alias and PHP
>
>
> Wow. That is ALMOST it. The only thing is it does not return
> the record
> with a 0 in tbl_1.area_2 - can you think of a workaround?
>
> Thanks for the help,
> Charles
>
> On Friday, March 7, 2003, at 06:39 PM, Barajas, Arturo wrote:
>
> > Let's see:
> >
> > SELECT
> > tbl_1.area_1,
> > areas1.area_name,
> > tbl_1.area_2,
> > areas2.area_name
> > FROM
> > tbl_1
> > INNER JOIN tbl_2 areas1 ON tbl_1.area_1 = areas1.id
> > INNER JOIN tbl_2 areas2 ON tbl_1.area_2 = areas2.id
> >
> > Maybe if you tinker a little on the sentence. I don't have
> a place to
> > test it right now.
> > --
> > Un gran saludo/Big regards...
> > Arturo Barajas, IT/Systems PPG MX (SJDR)
> > (427) 271-9918, x448
> >
> >> -----Original Message-----
> >> From: Charles Kline [mailto:[EMAIL PROTECTED]
> >> Sent: Viernes, 07 de Marzo de 2003 04:09 p.m.
> >> To: Jim Lucas
> >> Cc: [EMAIL PROTECTED]
> >> Subject: Re: [PHP] MySQL Alias and PHP
> >>
> >>
> >> Thanks for all the suggestions, I have tried all and more and still
> >> can't get this quite right. If there is a better forum for these
> >> question, please point me to it and I will take this somewhat
> >> off topic
> >> thread elsewhere.
> >>
> >> My table structure is like so:
> >>
> >> tbl_1
> >>
> >> id area_1 area_2
> >> 1 2 3
> >> 2 1 2
> >> 3 5 0
> >>
> >>
> >> tbl_2
> >>
> >> id area_name
> >> 1 funding
> >> 2 research
> >> 3 new
> >> 4 ongoing
> >> 5 other
> >>
> >>
> >> So, I need to display all the records in tbl_1 and show the
> >> values for
> >> the fields area_1 and area_2 as their area_name field from tbl_2. I
> >> must display each record from tbl_1 only once. I know I am
> >> close, but I
> >> just can't get this to work. The closest I have gotten is this:
> >>
> >> SELECT DISTINCT a.area_name area_a, b.area_name area_b
> FROM tbl_1 x,
> >> tbl_2 a, tbl_2 b
> >> WHERE x.area_1 = a.id
> >> OR x.area_2 = b.id GROUP BY x.id
> >>
> >> But this ALWAYS returns the area_name (funding) in the value
> >> of area_b
> >> (have no idea why)
> >>
> >> Thanks for any help. It is appreciated.
> >>
> >> - Charles
> >>
> >>
> >> On Friday, March 7, 2003, at 01:42 PM, Jim Lucas wrote:
> >>
> >>> Then the information in the DB is the same.
> >>>
> >>> Jim
> >>> ----- Original Message -----
> >>> From: "Charles Kline" <[EMAIL PROTECTED]>
> >>> To: "Rich Gray" <[EMAIL PROTECTED]>
> >>> Cc: <[EMAIL PROTECTED]>
> >>> Sent: Friday, March 07, 2003 10:03 AM
> >>> Subject: Re: [PHP] MySQL Alias and PHP
> >>>
> >>>
> >>> Thanks for the help. Almost there. Here is what I have:
> >>>
> >>> SELECT x.id, x.headline, x.description, a.area area_a,
> b.area area_b
> >>> FROM tbl_funding x, tbl_dra a, tbl_dra b
> >>> GROUP BY x.id LIMIT 0 , 30
> >>>
> >>> The problem is that $array[area_a] and $array[area_b]
> >> display the same
> >>> info.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Friday, March 7, 2003, at 11:09 AM, Rich Gray wrote:
> >>>
> >>>>> Hi all,
> >>>>>
> >>>>> I have this query:
> >>>>>
> >>>>> SELECT a.area_name, b.area_name FROM tbl_1 x, tbl_2 a, tbl_2 b
> >>>>> WHERE x.area_1 = a.id
> >>>>> AND x.area_2 = b.id
> >>>>>
> >>>>> I am using PEAR DB to get my results as an ASSOC ARRAY.
> >> How do I echo
> >>>>> the values for a.id and b.id?
> >>>>>
> >>>>> Thnks
> >>>>> Charles
> >>>>>
> >>>>
> >>>> I presume you mean area_name...
> >>>>
> >>>> Try this -> SELECT a.area_name as area_a, b.area_name as
> >> area_b FROM
> >>>> tbl_1
> >>>> x, tbl_2 a, tbl_2 b
> >>>> Then you can refer to the columns as $array['area_a'] and
> >>>> $array['area_b']
> >>>>
> >>>> HTH
> >>>> Rich
> >>>>
> >>>
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
--- End Message ---
--- Begin Message ---
Greetings!
I was wondering if it is possible to run both PHP 4 and PHP 5
simultaneously under Apache 2.0.43 on Windows XP Home. I currently have
PHP 4.3.0 (SAPI) running successfully under it, but would like to add
PHP 5-dev for experimenting. What I'd like to do is allow PHP 4 files to
have a *.php while PHP 5 files have a *.php5 extension.
The problems I'm running into are: First, both versions of PHP identify
themselves as 'php4_module'. Thus Apache gets confused and won't startup
when I try to add the second (PHP 5) module. Secondly, how do I work
having two 'php.ini' files running around. I can't very well put them
both in 'C:\WINDOWS' and there doesn't seem to be a way to place them
both in '*\php\sapi' like php4ts.dll.
Hopefully this all makes sense.
Jason
--- End Message ---
--- Begin Message ---
if u read my previous post i have another instance of apache running with 5
under that so apache first server is running on port 1023 and apache second
server is running on port 1024
-----Original Message-----
From: Jason Lange [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 5:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Running PHP 4 & PHP 5 Simultaneously
Greetings!
I was wondering if it is possible to run both PHP 4 and PHP 5
simultaneously under Apache 2.0.43 on Windows XP Home. I currently have
PHP 4.3.0 (SAPI) running successfully under it, but would like to add
PHP 5-dev for experimenting. What I'd like to do is allow PHP 4 files to
have a *.php while PHP 5 files have a *.php5 extension.
The problems I'm running into are: First, both versions of PHP identify
themselves as 'php4_module'. Thus Apache gets confused and won't startup
when I try to add the second (PHP 5) module. Secondly, how do I work
having two 'php.ini' files running around. I can't very well put them
both in 'C:\WINDOWS' and there doesn't seem to be a way to place them
both in '*\php\sapi' like php4ts.dll.
Hopefully this all makes sense.
Jason
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Glory & Supreme Power
What i'm looking to do is.. i want to display only the
first few words of the record in my mySQL database..
For example.. i have a table with a field "title"..
and let's say my last record has the value in title
field as
"This is going to be really cool"
What i want to display is
"this is going..."
Basically this is for News Headlines. I have a page
which displays news but on the first page of the site
i have to give the first few words of the last 4
articles in the news table..
How can i do this? I have seen this in a lot of places
but i dont know how to do this.
Thanks,
Rahul S. Johari
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Rahul.Brenda" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 11:22 AM
Subject: [PHP] Displaying few words from record in mySQL
> Glory & Supreme Power
>
> What i'm looking to do is.. i want to display only the
> first few words of the record in my mySQL database..
>
> For example.. i have a table with a field "title"..
> and let's say my last record has the value in title
> field as
>
> "This is going to be really cool"
>
> What i want to display is
>
> "this is going..."
>
> Basically this is for News Headlines. I have a page
> which displays news but on the first page of the site
> i have to give the first few words of the last 4
> articles in the news table..
>
> How can i do this? I have seen this in a lot of places
> but i dont know how to do this.
>
> Thanks,
> Rahul S. Johari
I don't know how to do it within the SQL query.. or even if it's possible.
But you can always gather the results as normal and build a function within
php that chops up each line into words and uses the first few words as an
abreviative text. If you want the strings to be of uniform length (or to
ensure a minimum length) then you could do something with the strlen() and
strpos() functions. This simple function that I wrote cares only about the
number of words in the abreviation. It's rather crude but you're welcome to
use it if it helps you..
function abreviate_text($str, $num_words)
{
// $str parameter must be an alpha numeric string
if (!is_string($str))
return false;
// $num_words parameter must be a non-zero integer value
if (!is_integer($num_words) || $num_words == 0)
return false;
// split the string on all single spaces
$words = explode(' ', $str);
// build abreviated text..
$abr = array();
for($i=0; $i<$num_words; $i++)
{
$abr[] = $words[$i];
}
$abr = implode(' ', $abr);
$abr .= "...";
return $abr;
}
- Kevin
--- End Message ---
--- Begin Message ---
Kevin,
Your program certainly makes very good sense to me.
However, 2 things i will need to ask you.. is that,
let's say i decide i want the first 4 words from the
record displayed.. for all the 4 rows i'm displaying..
where do i define that in your program?
And secondly, how do i make this program work on the
myrow[myfield] variable which will actually carry the
record from the database?
thanks,
Rahul
> I don't know how to do it within the SQL query.. or
> even if it's possible.
> But you can always gather the results as normal and
> build a function within
> php that chops up each line into words and uses the
> first few words as an
> abreviative text. If you want the strings to be of
> uniform length (or to
> ensure a minimum length) then you could do something
> with the strlen() and
> strpos() functions. This simple function that I
> wrote cares only about the
> number of words in the abreviation. It's rather
> crude but you're welcome to
> use it if it helps you..
>
> function abreviate_text($str, $num_words)
> {
> // $str parameter must be an alpha numeric
> string
> if (!is_string($str))
> return false;
>
> // $num_words parameter must be a non-zero
> integer value
> if (!is_integer($num_words) || $num_words == 0)
> return false;
>
> // split the string on all single spaces
> $words = explode(' ', $str);
>
> // build abreviated text..
> $abr = array();
> for($i=0; $i<$num_words; $i++)
> {
> $abr[] = $words[$i];
> }
> $abr = implode(' ', $abr);
> $abr .= "...";
>
> return $abr;
> }
>
> - Kevin
>
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
--- End Message ---
--- Begin Message ---
isset is the function I was looking for. I could not remember what it was.
Thank you.
"Bobby Patel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> you can look at isset() and empty(). If you retrieve the query result with
> Mysql association (ie. $field=mysql_fetch_array($resource, MYSQL_ASSOC),
> then even the field has a blank value, there will be a blank variable
> created ($field["Name"] is created but with no value)), however if you
grab
> the resource values as such $field=mysql_fetch_array($resource), then a
> blank field will not create a $field["Name"].
>
> So, if using :
> $field=mysql_fetch_array($resource, MYSQL_ASSOC)
> if(empty($field["Name"])) { do this }
> else { do this }
>
> OR
> $field=mysql_fetch_array($resource)
> if(!isset($field["Name"])) { do this }
> else { do this }
>
>
>
> "Christopher J. Crane" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > How do I check if a variable is blank or not. I am returning data from a
> > MySQL database and if a field is empty I would like to do something
> > different.
> >
> > I tried
> > if($field["Name"] == "") { do this }
> > else { do this }
> >
> > It does not work right. Actually, at one point, it was working in the
> exact
> > opposite manner.
> >
> >
>
>
--- End Message ---
--- Begin Message ---
Is there a way to find the minimum and maximum values of an array? min() and max()
don't take arrays.
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 12:07 PM
Subject: [PHP] Min and max of array
Is there a way to find the minimum and maximum values of an array? min() and
max() don't take arrays.
-----------------------------------
Umm.. yes they do take arrays. Arrays of numbers..
$numbers = array(10, 5, 2, 4, 33, 50, 91);
echo min($numbers); // prints 2
echo max($numbers); // prints 91
Is this not what do you want?
- Kevin
--- End Message ---
--- Begin Message ---
>you can sort it and get the values.
I would, but I need the array in the same order. I can't sort it.
--- End Message ---
--- Begin Message ---
make a copy of the original array and sort that, when you find it correct
key, use that to refer to the correct value in the original array.
Jim
----- Original Message -----
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 11:24 AM
Subject: Re: [PHP] Min and max of array
> >you can sort it and get the values.
>
> I would, but I need the array in the same order. I can't sort it.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 12:24 PM
Subject: Re: [PHP] Min and max of array
> >you can sort it and get the values.
>
> I would, but I need the array in the same order. I can't sort it.
>
>
> -- ------------------
So what you really need is the min/max value of alpha numeric values in an
array? Well then here you go. This is the second function that I've given
away today. I hope it does what you need..
function max_alpha($array)
{
if (!is_array($array))
return false;
foreach($array as $key => $val)
{
if(!isset($prev_val))
$max_val = '';
$result = strcmp($val, $max_val);
if ($result > 0) // < for min value
{
$max_val = $val;
}
}
return $max_val;
}
- Kevin
--- End Message ---
--- Begin Message ---
Thanks for your response James!
but still I must be doing something wrong the "1" is a persistent little
bugger. Have you any tips on how to rewrite:
<?php
echo @ require_once("topten.php");
?>
using the ob_methods?
Again thanx for your response
Gary
James Holden wrote:
> The '1' is received simply because your requirement clause echoed the
> result to the page.
>
> include, require and include_once all return boolean results of 1 or 0
> which indicates a successful loading of said include. If you want to
> suppress the output of an include use ob_ methods which prevent output
> the stdout.
>
> Simply putting 'include_once("anyfile.php")' will output whatever
> processes occur within that include.
> Putting the echo statement will additionally output the status of the
> include operation.
>
> Regards,
> Jim
> londontown.com
>
>
> Ernest E Vogelsinger wrote:
>
>> At 17:28 07.03.2003, Gary spoke out and said:
>> --------------------[snip]--------------------
>>
>>
>>> Hi
>>> I've included the following in a php document:
>>> <?php
>>> echo @ require_once("anyfile.php")
>>>
>>>
>>> and it works exactly as I expect except at the end of the included
>>> document theres a single "1" displayed. I've noticed also that if I
>>> include a document in the included document the end result will be
>>> the document I want exactly as I want it with the addition of two
>>> ones "11"s can anyone tell me how to get rid of the ones?
>>> (if I run anyfile.php by itself there are no "1"s)
>>>
>>>
>> --------------------[snip]--------------------
>>
>> This happens if the included file returns some value, in your case
>> it seems to return "true". Remove the return <something> statement
>> (you may simply "return;" if necessary) and the 1 will be history.
--- End Message ---
--- Begin Message ---
At 20:19 07.03.2003, Gary said:
--------------------[snip]--------------------
>Thanks for your response James!
>but still I must be doing something wrong the "1" is a persistent little
>bugger. Have you any tips on how to rewrite:
>
><?php
>echo @ require_once("topten.php");
> ?>
>using the ob_methods?
--------------------[snip]--------------------
Rewrite this to just
require_once('topten.php');
No need to echo here.
Using output buffering the 1 would still appear, some microseconds later...
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
Ernest E Vogelsinger wrote:
> At 20:19 07.03.2003, Gary said:
> Rewrite this to just
> require_once('topten.php');
Thanx Ernest!
that does the trick
Gary
--- End Message ---
--- Begin Message ---
Hi.
Is their anyway to connect to a Access Db using only the filesystem like
$connect = odbc_connect("\Db\Webdb.mdb", "nobody", "nobody");
thus pointing directly to the file not using drivers???
--- End Message ---
--- Begin Message ---
You could always open it and see if the first few characters are
"{\rtf1".
Brady
> Is there any way to test a file to confirm it is an RTF file?
>
> I'm thinking along the lines of how we can test for an image with
> getimagesize().
>
> kind regards,
>
> bill
>
--- End Message ---
--- Begin Message ---
Ok here is the problem.
At home i run an Apache server with php4
and the server its supposed to be run on is NT5 and iis with php4
The site is run on an access db through ODBC. It works fine at home where i
have a system link to the db.
On the iis server the admin created the same link but the damed thing
doesent work.
any suggestions would be great.
I dont know if there is any difference.
--- End Message ---
--- Begin Message ---
Make sure the link is created properly, if it works at home then you
know your code works in at least one place.
Find out what version of PHP they have running and any other differences
between the machine, make sure they created the link properly.
Really without more information there isn't much that can be done by
anyone else, people can only conjecture.
Jason
On Fri, 2003-03-07 at 12:45, Kiswa wrote:
> Ok here is the problem.
>
> At home i run an Apache server with php4
> and the server its supposed to be run on is NT5 and iis with php4
>
> The site is run on an access db through ODBC. It works fine at home where i
> have a system link to the db.
> On the iis server the admin created the same link but the damed thing
> doesent work.
>
> any suggestions would be great.
>
> I dont know if there is any difference.
--
Jason Sheets <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
get your field info from a mysql search then do:
print "<textarea name=field rows=3
cols=50>".stripslashes($array_result['field'])."</textarea>";
Hope this helps,
Hugh
----- Original Message -----
From: "Mirco Ellis" <[EMAIL PROTECTED]>
To: "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 6:27 AM
Subject: [PHP] populating textarea with data
> Hi, I have a simple RFQ ( request for quotes ) system that runs on mysql
and
> php. The clients inserts data into the database with a simple form, no
> problem! What I would like to do is when the user recalls data from the db
> that the data is displayed in a textarea rather than the old fashioned php
> table format. This way the user can edit the data conveniently and
> repopulate the db. I don't have the foggiest idea where to begin. Can
anyone
> help me please?
>
>
> Mirco Ellis
> I-Soft Solutions
> e-mail: [EMAIL PROTECTED]
> Tel: +27414847161
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi,
I got a little project and I need to come up with a solution on how to
finish it and was hoping if you guys can give me any ideas.
I have a PERL script on a Unix AIX machine that checks for incoming update
of data. Specificly what it does is, when it runs, it will look at the
corresponding directories in the AIX machine and record the time WHEN a data
has come in and check if the time is delayed or on time, kind of like how
the flight Arrival/departure information work in an airport. After it
collects this information, it will store these information in a text file.
I need to display this information in a form of a web page so that my
internal staff can see this information. I usually store this kind of
information in a MSSQL table and use PHP to general a page that collects its
information from the database/MSSQL table.
The way I want to do it, somehow store/update the data in the text file of
the AIX machine to the MSSQL table so that my php page would be able to get
the updated information for display.
My problem is I haven't come up with a solution as to how I can pull this
text file out fo the AIX machine and transfer the data to the MSSQL table.
Anyone have an ideas? IS there anything in PHP I can use to do this?
Any help is appreicated, thanks!
Kelvin
--- End Message ---
--- Begin Message ---
Hello,
To get ride of magic_quotes I do:
function no_magicquotes() {
global $HTTP_GET_VARS ;
global $HTTP_POST_VARS ;
global $HTTP_COOKIE_VARS ;
if (get_magic_quotes_gpc()) {
// Overrides GPC variables
for (reset($HTTP_GET_VARS); list($k, $v) = each($HTTP_GET_VARS); )
$$k = stripslashes($v);
for (reset($HTTP_POST_VARS); list($k, $v) = each($HTTP_POST_VARS); )
$$k = stripslashes($v);
for (reset($HTTP_COOKIE_VARS); list($k, $v) = each($HTTP_COOKIE_VARS);)
$$k = stripslashes($v);
}
}
And it seems to work, But i have have a file like that:
$VAR_mailadmin = "[EMAIL PROTECTED]" ;
$VAR_urlgallery = "http://www.siova.net/paris2" ;
$VAR_categories[0]["title"] = "Montréal by Night" ;
$VAR_categories[0]["name"] = "Mtl by night" ;
$VAR_categories[0]["file"] = "montreal_by_night" ;
...
And many others variables. And magic_quotes seems to work for global
vars too. Is there a way to modify no_magicquotes() to make this
function works with all global vars ? Another for...each...but how ?
Thanks,
Vincent.
--- End Message ---
--- Begin Message ---
Hod do i get the with and hight of the users screen and then put it into a
variable?
--- End Message ---
--- Begin Message ---
This is a client matter, so PHP can't help you.
Look into some JavaScript documentation for 'screen.width' &
'screen.height'.
HTH,
Florin.
On Fri, 7 Mar 2003 21:32:58 +0100
"Kiswa" <[EMAIL PROTECTED]> wrote:
> Hod do i get the with and hight of the users screen and then put it
> into a variable?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Florin Dumitrescu
Webmaster
Departamentul Internet
Astral Telecom SA, Sucursala Brasov
--- End Message ---
--- Begin Message ---
Hi,
I use PHP 4.3.1 with apache 2.0.44 and php.ini from php.ini-recommended.
It seems that copy() doesn't work. Permissions are correct, apache can
read the source file and write to the destination directory.
But I get the following error message when I use copy:
Warning: copy(<destination file>) [function.copy]: failed to create
stream: Success in <script>.php on line <l>
Is this a bug ? How can I investigate it ?
--- End Message ---
--- Begin Message ---
Is the safe mode on?
Arthur Chereau wrote:
Hi,
I use PHP 4.3.1 with apache 2.0.44 and php.ini from php.ini-recommended.
It seems that copy() doesn't work. Permissions are correct, apache can
read the source file and write to the destination directory.
But I get the following error message when I use copy:
Warning: copy(<destination file>) [function.copy]: failed to create
stream: Success in <script>.php on line <l>
Is this a bug ? How can I investigate it ?
--- End Message ---
--- Begin Message ---
On Fri, 2003-03-07 at 22:36, Marek Kilimajer wrote:
> Is the safe mode on?
No, it's off. I need it to be off to get the username/password from http
authentication.
> Arthur Chereau wrote:
>
> >Hi,
> >
> >I use PHP 4.3.1 with apache 2.0.44 and php.ini from php.ini-recommended.
> >
> >It seems that copy() doesn't work. Permissions are correct, apache can
> >read the source file and write to the destination directory.
> >
> >But I get the following error message when I use copy:
> >
> >Warning: copy(<destination file>) [function.copy]: failed to create
> >stream: Success in <script>.php on line <l>
> >
> >Is this a bug ? How can I investigate it ?
> >
> >
> >
> >
> >
>
--- End Message ---
--- Begin Message ---
Daniel Joyce wrote:
I've used the HTTP Location, Expire, and Refresh headers to no effect.
What's the magic order to....
1) Refer a browser to a new location
2) Ensure that the location is refreshed?
I want to avoid using <meta http-equiv> tags, as this complicates things
in the system I am designing....
-Daniel
A little more explanation. I'm wanting to seperate form from content and
processing...
So page a.php has a form, that invokes b.php in it's action.
b.php redirects the browser to a new page to show that processing is
occuring, then redirects back to a.php when done. ( a.php is a query and
display front end, so you enter a query, and it should reload displaying
the results ).
No matter what I use, whether http headers, or session vars to tell it
to reload, when a.php is reloaded by the browser, it's somehow pulling
it from cache, and not requesting the page again. If I tell the browser
to refresh, then it displays the data.
I've tried cache control headers, etc, to get the browser to reload the
page, and it doesn't work...
-Daniel
--- End Message ---
--- Begin Message ---
Can you use some kind of random url?
eg ?cachebuster=url encode the date and time here
its what i do to bust cache.
-----Original Message-----
From: Daniel Joyce [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 7:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Forcing page refresh with http headers?
Daniel Joyce wrote:
> I've used the HTTP Location, Expire, and Refresh headers to no effect.
> What's the magic order to....
>
> 1) Refer a browser to a new location
> 2) Ensure that the location is refreshed?
>
> I want to avoid using <meta http-equiv> tags, as this complicates things
> in the system I am designing....
>
> -Daniel
>
A little more explanation. I'm wanting to seperate form from content and
processing...
So page a.php has a form, that invokes b.php in it's action.
b.php redirects the browser to a new page to show that processing is
occuring, then redirects back to a.php when done. ( a.php is a query and
display front end, so you enter a query, and it should reload displaying
the results ).
No matter what I use, whether http headers, or session vars to tell it
to reload, when a.php is reloaded by the browser, it's somehow pulling
it from cache, and not requesting the page again. If I tell the browser
to refresh, then it displays the data.
I've tried cache control headers, etc, to get the browser to reload the
page, and it doesn't work...
-Daniel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
Is it possible to access(run SQL queries on) DB2 database in AS400 from PHP
on Windows/Unix?
If so, how?
Could you please advise some positive and negative ( if any) to work with
DB2 and PHP?
Thank You in Advance,
Sridhar Moparthy
--- End Message ---
--- Begin Message ---
I never do that, but, you can do it with the ODBC that is supported in
Windows PHP version, that is my idea for you.
--
Alejandro Trujillo J.
Cube Systems LTDA.
web : csltda.com
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--- End Message ---
--- Begin Message ---
I am having a hard time with the header("Location:") function inside an
include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27).
At the VERY TOP of my php page, I have:
<?php virtual("/include/logincheck.php") ?>
logincheck.php contains exactly:
<?php
// login check
if(!isset($_SESSION["agent_id"]))
{
header("Location:/");
header("Connection: close");
exit;
}
?>
However, if this "agent_id" is not set, I just get a blank page with html
open and close tags.
I'm SURE there are no spaces or blank lines before these lines.
It works fine if I put the code in the main page instead of using the
virtual include.
Output buffering is set to 4096 in php.ini.
Any suggestions would be appreciated.
Thanks,
Barry
--- End Message ---
--- Begin Message ---
if you put this at the very to of the page, I am guessing
then that you haven't ran session_start() ??
if you are trying to access a value stored in a session variable, you need
to initialize the session first, then access the variable.
Jim
----- Original Message -----
From: "Barry Gould" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 3:35 PM
Subject: [PHP] header function
> I am having a hard time with the header("Location:") function inside an
> include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27).
>
> At the VERY TOP of my php page, I have:
> <?php virtual("/include/logincheck.php") ?>
>
> logincheck.php contains exactly:
> <?php
> // login check
> if(!isset($_SESSION["agent_id"]))
> {
> header("Location:/");
> header("Connection: close");
> exit;
> }
> ?>
>
> However, if this "agent_id" is not set, I just get a blank page with html
> open and close tags.
>
> I'm SURE there are no spaces or blank lines before these lines.
>
> It works fine if I put the code in the main page instead of using the
> virtual include.
>
> Output buffering is set to 4096 in php.ini.
>
> Any suggestions would be appreciated.
>
> Thanks,
> Barry
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
is there any way to do a *response.redirect* call like in asp from a php
script?
--- End Message ---
--- Begin Message ---
With header():
header("Location: " . $redirect_to);
--
Un gran saludo/Big regards...
Arturo Barajas, IT/Systems PPG MX (SJDR)
(427) 271-9918, x448
> -----Original Message-----
> From: Christopher Myatt [mailto:[EMAIL PROTECTED]
> Sent: Viernes, 07 de Marzo de 2003 05:50 p.m.
> To: [EMAIL PROTECTED]
> Subject: [PHP] response.redirect
>
>
> is there any way to do a *response.redirect* call like in asp
> from a php
> script?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Christopher Myatt wrote:
> is there any way to do a *response.redirect* call like in asp from a
> php script?
PHP Manual => header function
http://www.php.net/manual/it/function.header.php
Es.
header("Location: http://www.yoursite.com/desturl.php");
--- End Message ---
--- Begin Message ---
If you have ssl enabled in apache you can access any of your scripts
over ssl, if you want to do ssl related stuff (like generate
certificates) take a look at http://www.php.net/ssl
Jason
On Thu, 2003-03-06 at 19:42, Luis A wrote:
> how i can make ssl on php4 ???
--
Jason Sheets <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
I'm just learning PHP so please excuse my ignorance. I'm trying to extract
the data from a simply formatted text file via a simple PHP script. The
goal of this project is to take Magic the Gathering spoiler lists and dump
them into a MySQL database. I've got plenty of experience with MySQL but
not file parsing. How do I about parsing this data? What sort of pattern
recognition do I use (if that's the right term).
Thanks for the help. The format of the file is below.
-John
Card Name: Akroma, Angel of Wrath
Card Color: W
Mana Cost: 5WWW
Type & Class: Creature - Angel Legend
Pow/Tou: 6/6
Card Text: Flying, first strike, trample, haste, protection from black,
protection from red. Attacking doesn't cause Akroma, Angel
of Wrath to tap.
Flavor Text: No rest. No mercy. No matter what.
Artist: Ron Spears
Rarity: R
Card #: 1/145
Card Name: Akroma's Devoted
Card Color: W
Mana Cost: 3W
Type & Class: Creature - Cleric
Pow/Tou: 2/4
Card Text: Attacking doesn't cause Clerics to tap.
Flavor Text: "Akroma asked for only one thing from her troops: unwavering,
unconditional loyalty."
Artist: Dave Dorman
Rarity: U
Card #: 2/145
etc.. etc...
--- End Message ---
--- Begin Message ---
hi there i was wondering if its ever possible to get a screenshot of an mpeg
frame giving it a position and maybe optmisize it with de-interlacing to a
jpeg using gd ?
--- End Message ---
--- Begin Message ---
We've been having a nightmare of a time with this IIS machine that was
recently upgraded to 4.3.1 from 4.2.3. Of course, using google to find out
what the error means only brings up other sites that have the message
displayed...
Warning: Unknown(): Your script possibly relies on a session side-effect
which existed until PHP 4.2.3. Please be advised that the session extension
does not consider global variables as a source of data, unless
register_globals is enabled. You can disable this functionality and this
warning by setting session.bug_compat_42 or session.bug_compat_warn to off,
respectively. in Unknown on line 0
register_globals = off
(error reporting set to highest possible at runtime)
I found a few other people that were having this problem, but many of them
were related to using session_register. I'm using $_SESSION['variable'] =
'whatever' to set all of my session variables and
unset($_SESSION['variable']) instead of session_unregister, so I'm
uncertain as to why this happens, and only on certain pages.
We've tried setting the php.ini settings described in the warning to every
possible combination, and the warning still appears. I'd rather know what
is causing the warning and fix it, rather than just masking it.
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--- End Message ---
--- Begin Message ---
If I run the following code from the command line ("php -q socktest.php") it
works fine. If I try to run it through a browser gethostbyname fails (prints
unchanged host name).
<?php print gethostbyname( 'www.msn.com' ); ?>
What gives?
Brad
--- End Message ---
--- Begin Message ---
First of all, thanks all who helped with the min and max functions (that works) and
the dollar sign bit (which also works). Kudos. Couldn't have done it without y'all!
Here's the newest brain teaser: I have cookies disabled (well, I have IE set to the
highest security mode, where it disables cookies). I understand that with cookies
enabled, $PHPSESSID will return nothing when it works. However, it will return a value
when cookies are disabled and the page is refreshed after a cookie is attempted. I'm
still getting nothing either way. Anybody know why?
--- End Message ---
--- Begin Message ---
Ok, this may have already been posted to the list already, but the
archives don't seem to like the & and && characters.
I'm running into some code that looks like this:
<snip>
Define('INPUT', 2);
<snip>
if($search->level & INPUT) $tmp.= $search->input();
Ok, what's the & mean?
As far as I could tell from the very little documentation I was able to
scrape up on google, & is a bit-by-bit operator. Thus, if either INPUT
or $search->level, we get TRUE... If that's the case, what's the point
of using it instead of || ?
Or, do I just totally not understand the point of this. Thanks
--- End Message ---
--- Begin Message ---
On March 7, 2003 08:54 pm, James Taylor wrote:
> Ok, this may have already been posted to the list already, but the
> archives don't seem to like the & and && characters.
>
> I'm running into some code that looks like this:
>
> <snip>
> Define('INPUT', 2);
> <snip>
> if($search->level & INPUT) $tmp.= $search->input();
>
>
> Ok, what's the & mean?
>
> As far as I could tell from the very little documentation I was
> able to scrape up on google, & is a bit-by-bit operator. Thus, if
> either INPUT or $search->level, we get TRUE... If that's the case,
> what's the point of using it instead of || ?
>
> Or, do I just totally not understand the point of this. Thanks
Ok shoot me if I'm wrong here I just vaguely recall this from some
Java course I took. I think && and & are identical except that if
you use &, PHP will not short circuit the expression.
like:
$x = 0;
if(false && $x++)
print "impossible";
print $x; // should print 0
$x = 0;
if(false & $x++)
print "impossible";
print $x; // should print 1
Warning: This may only work for Java or maybe I just can't remember it
properly..
leo
--- End Message ---
--- Begin Message ---
Hi James,
& is a bit-wise AND. && is a logical AND. The bitwise AND will return
a number, the logical AND will return true or false boolean values.
It's a subtle distinction, but important. 4 & 4 == 4 4 && 4 == true == 1
Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
James Taylor wrote:
Ok, this may have already been posted to the list already, but the
archives don't seem to like the & and && characters.
I'm running into some code that looks like this:
<snip>
Define('INPUT', 2);
<snip>
if($search->level & INPUT) $tmp.= $search->input();
Ok, what's the & mean?
As far as I could tell from the very little documentation I was able to
scrape up on google, & is a bit-by-bit operator. Thus, if either INPUT
or $search->level, we get TRUE... If that's the case, what's the point
of using it instead of || ?
Or, do I just totally not understand the point of this. Thanks
--- End Message ---
--- Begin Message ---
Hi,
I have a table that stores all the "boxes" that my website will
display on the sides. So far the content is simply stored in a text
field and then substituted for the box body. However this way I
can't have any php code in the boxes... What I thought I could do is
have another field that will contain any php code that I want for
that box and then execute that after I read it from the database.
So I have two questions basically.
1. How would I go about executing php code in a string?
Say I have $code = "md5('blah');" how would I execute the code in
the string?
2. If I instead include a file would it have access tio the local
variables?
Ie. In a class I have this:
$strContent = "blah, this is the content I got from the database";
include("includefilefromdatabase.php");
Is the $strContent variable then available from the include file?
Thanks,
Leo
--- End Message ---
--- Begin Message ---
On March 7, 2003 09:15 pm, Leo Spalteholz wrote:
> Hi,
> I have a table that stores all the "boxes" that my website will
> display on the sides. So far the content is simply stored in a
> text field and then substituted for the box body. However this way
> I can't have any php code in the boxes... What I thought I could
> do is have another field that will contain any php code that I want
> for that box and then execute that after I read it from the
> database.
>
> So I have two questions basically.
> 1. How would I go about executing php code in a string?
> Say I have $code = "md5('blah');" how would I execute the code in
> the string?
> 2. If I instead include a file would it have access tio the local
> variables?
>
> Ie. In a class I have this:
> $strContent = "blah, this is the content I got from the database";
> include("includefilefromdatabase.php");
>
> Is the $strContent variable then available from the include file?
>
> Thanks,
> Leo
Sorry about that. A simple search in the manual would have answered
the first question.... But I'm still not sure about the second...
Thx,
Leo
--- End Message ---
--- Begin Message ---
Hello people,
I want to start using Xml with php. How do I install xml on Apache with Php?
I am running redhat 7.2,Apache 1.3.12 and php latest version.
How do I install xml? I am totally new to Xml....and want to start
somewhere...
-Dhaval
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
--- End Message ---