|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 26 Jul 2005 19:42:27 -0000 Issue 3589
php-general-digest-help
lists.php.net
Date: Tue Jul 26 2005 - 14:42:27 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 26 Jul 2005 19:42:27 -0000 Issue 3589
Topics (messages 219324 through 219377):
Urgent:Php5 fully oops supported? Difference between java oops & php5 oops
219324 by: Tamilarasi Palanisamy \(tpalanis\)
219325 by: Alan Milnes
219329 by: Jochem Maas
219331 by: rush
219332 by: rush
Re: Problem with Form not putting Data in Post Request
219326 by: Jochem Maas
219362 by: Rasmus Lerdorf
Re: Searching and Count within array
219327 by: Jochem Maas
Re: Class for creating RSS 2 feed?
219328 by: Skippy
MySQL + PHP question
219330 by: André Medeiros
219333 by: Shaw, Chris - Accenture
219334 by: André Medeiros
219335 by: Mark Rees
219337 by: Shaw, Chris - Accenture
219338 by: André Medeiros
219340 by: André Medeiros
219348 by: Mark Rees
219351 by: André Medeiros
219352 by: Shaw, Chris - Accenture
Re: gloabl & reference behavior question?
219336 by: Ford, Mike
Re: Help with a home-grown function
219339 by: Ford, Mike
219342 by: Matthew Weier O'Phinney
Help needed in changing row color
219341 by: suma parakala
219345 by: Dotan Cohen
219346 by: Burhan Khalid
Re: <<< performance.
219343 by: Matthew Weier O'Phinney
219371 by: Rodolfo Gonzalez Gonzalez
Re: quick question about using capital letters coding w/ PHP
219344 by: Dotan Cohen
219358 by: Jochem Maas
corrected
219347 by: cox.idecnet.com
Playing Audio
219349 by: Tom Chubb
219350 by: André Medeiros
stipping raw text from rss story
219353 by: Krypto 76
219355 by: André Medeiros
cURL - is it best for me?
219354 by: George Pitcher
219356 by: Jochem Maas
219357 by: Jochem Maas
219366 by: Ford, Mike
Setting clock backwards hangs webserver (PHP+THTTPD)
219359 by: Vinoo S Warrier
Re: On register_shutdown_function: What might be the problem?
219360 by: Liang ZHONG
Apache 2.0.52 + PHP 4.3.9 configuration problem, for Linux Fedora 3.
219361 by: nferrac.uns.edu.ar
safe mode
219363 by: Ryan A
Using PHP to get user input via checkbox through a database
219364 by: Wil Hitchman
Error "default 16" with PHP 5.1b3
219365 by: Jeff Norton
Very Basic question: What IDE/tools I need to begin using PHP?
219367 by: Taksam
219368 by: André Medeiros
219369 by: Jeffrey D. Means
219370 by: John Nichel
Re: is_array() doesn't work on DOM properties?
219372 by: John Smith
219374 by: Jochem Maas
Object Inheritance, get_class() and a static function call
219373 by: axel
219376 by: Richard Davey
219377 by: Jochem Maas
ibase_connect...how to specify a port?
219375 by: James
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
I want to know whether Php5 fully oops ? Difference between java
oops & php5 oops.
I need immediately.
Thanks,
tamilarasi
attached mail follows:
Tamilarasi Palanisamy (tpalanis) wrote:
>Hi,
>
>
Hi
> I want to know whether Php5 fully oops ?
>
That depends - what do you want to do?
>Difference between java
>oops & php5 oops.
>
>
I don't know - I'm a PHP programmer and I've never written a single line
of Java code in my life.
>I need immediately.
>
>
>
Perhaps this will help you get better answers:-
http://www.catb.org/~esr/faqs/smart-questions.html
Regards
Alan
attached mail follows:
Alan Milnes wrote:
> Tamilarasi Palanisamy (tpalanis) wrote:
<warning to="Tamilarasi" voice-style="Alec Guiness">
these are not the answers you're looking for. move along.
</warning>
>
>> Hi,
>>
>>
> Hi
>
>> I want to know whether Php5 fully oops ?
sometimes (actually quite often :-) I write some code and it does
something I don't want to happen - then I say 'oops'. in that sense php5 is fully
'oops' compatible.
>
> That depends - what do you want to do?
>
>> Difference between java
>> oops & php5 oops.
I believe in Java you have to write everything 3 times. ;-)
also you have a server/application scope which does not exist
in php's share-nothing architecture (well there are ways round that too).
>>
>>
> I don't know - I'm a PHP programmer and I've never written a single line
> of Java code in my life.
>
>> I need immediately.
immiediately is not a thing you can need ... not according to my limited
understanding of the english language.
<OT>
actually I read a book last night called 'Anastasia', which tells of the
the latent human ability to instantaneously garner any information you want by
way of dreaming (given certain prerequisites).
the book also says all our technology is primitive, destroying
the planet and making us miserable ... you be the judge!
Shakespeare wrote 'there are more things in heaven and earth than are dreamt
of in your philosophy, Horatio' - something that has always stuck in my head
for some reason... oh well back to php :-)
</OT>
>>
>>
>>
> Perhaps this will help you get better answers:-
>
> http://www.catb.org/~esr/faqs/smart-questions.html
>
> Regards
>
> Alan
>
attached mail follows:
I want to know whether Php5 fully oops ? Difference between java
oops & php5 oops.
I need immediately.
I guess you would get as many different answers as there are compute
language theoreticians, but I would say that php5 is one fine oop language,
in my taste even more fun than java since it is dynamically typed like
Smalltalk, while java is statically typed.
rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/
attached mail follows:
""Tamilarasi Palanisamy (tpalanis)"" <tpalanis
cisco.com> wrote in message
news:B72876F1CE3CDC43A1DAC1D0E46B97ED25B9CD
xmb-blr-415.apac.cisco.com...
I want to know whether Php5 fully oops ? Difference between java
oops & php5 oops.
I need immediately.
I guess you will het as many answers as there are computer language
theoreticians ;) . But form me php 5 is one fine oop language, and personaly
more fun than java since it is dynamically typed like some root oop
languagas like Smalltalk, while java is of statically typed kind of bore.
rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/
attached mail follows:
Rasmus Lerdorf wrote:
> maddog1169 wrote:
>
>>The one that does not get accepted is
>>
>><Group>
>>
>>including the "<>"
>
>
> You have something like this?
>
> <input type=text name="<Group>" />
>
> It should work. Make sure you have quotes around it, of course, or
> weird stuff will happen.
IIRC technically the < and > should be HTML entity encoded.
depending on browser/server/doctype combination that also may
be giving the OP a problem?
e.g.
<input type="text" name="<Group>" />
...
looking into this a little further I discover the following information
at w3c:
(here: http://www.w3.org/TR/html4/types.html#type-name)
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".").
which suggests that even though a < and/or > in a name attribute value
can/does work it might not be a good idea to use it.
>
> Try something like this:
>
> <form action="f.php" method="POST">
> <input type=text name="<Group>" />
> </form>
> <?php phpinfo() ?>
>
> Type something in the form field and hit return and then scroll down and
> look at the $_REQUEST and $_POST variables.
>
> -Rasmus
>
attached mail follows:
Jochem Maas wrote:
> Rasmus Lerdorf wrote:
>
>> maddog1169 wrote:
>>
>>> The one that does not get accepted is
>>>
>>> <Group>
>>>
>>> including the "<>"
>>
>>
>>
>> You have something like this?
>>
>> <input type=text name="<Group>" />
>>
>> It should work. Make sure you have quotes around it, of course, or
>> weird stuff will happen.
>
>
> IIRC technically the < and > should be HTML entity encoded.
> depending on browser/server/doctype combination that also may
> be giving the OP a problem?
>
> e.g.
>
> <input type="text" name="<Group>" />
>
> ...
>
> looking into this a little further I discover the following information
> at w3c:
> (here: http://www.w3.org/TR/html4/types.html#type-name)
>
> ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
> followed by any number of letters, digits ([0-9]), hyphens ("-"),
> underscores ("_"), colons (":"), and periods (".").
>
> which suggests that even though a < and/or > in a name attribute value
> can/does work it might not be a good idea to use it.
That's very true. And I suspect some browsers may not like sending
these characters directly without encoding them first. My point was
simply that PHP doesn't really care and that if the browser manages to
send the POST data with those chars, there is nothing in PHP stopping
them from showing up in the $_POST array. A space or a period get
converted to underscores, but we don't touch < and >
-Rasmus
attached mail follows:
Rasmus Lerdorf wrote:
> array_count_values()
>
> Bagus Nugroho wrote:
>
>>Hi Master,
not sure what Bagus was intending with 'Master',
regardless, the reply made me smile...
:-)
>>
>>I have an array as :
>>$myArray = array('four','four','four','four','one,,'three','three','three','two','two');
<bla />
attached mail follows:
Quoting "Murray
PlanetThoughtful" <lists
planetthoughtful.org>:
> Just curious if anyone knows of an existing class that will take MySQL
> records containing HTML and create a valid RSS 2.0 newsfeed from them?
http://software.zuavra.net/rowd_feed/
--
Romanian Web Developers - http://ROWD.ORG
attached mail follows:
Hi guys.
I'm having some trouble here regarding a project. I have a table with
projects, wich can be recursive (ie. sub-projects) and it is related to
itself.
By making the following query
---------------------8<--------------------------
SELECT * FROM projects LEFT JOIN projects proj_parent ON
projects.project_parent = proj_parent.parent_id WHERE project_id = 1234
---------------------8<--------------------------
i need to be able to access to the parent project's fields, but I have a
slight problem here.
First off, I have to make the LEFT JOIN. I don't know if the project can
be parent (therefore not finding a project_id = 0 wouldn't show the row)
and I need to add some kind of prefix to the proj_parent's fields so
that I can access them (or that they can't overwrite the project i'm
getting info on.
Well... there is an obvious sollution here: use an associative array
instead of an object, and access the properties by doing $array[0],
$array[1], etc. By my experience, this is a nightmare, maintenence-wise,
so I'd only use it as a _LAST_ resource.
Does anyone have any experience with this? The answer should be pretty
obvious, but I can't seem to figure it out :(
Thanks in advance.
André
attached mail follows:
Hello,
Consider this:
tbl_project(id, name, parent)
1 6
/ \ / \
2 3 7 8
/\
4 5
if tbl_project.parent = 0 then the project is the "top" parent.
Therefore, 1 and 6 have the field parent = 0.
So, say if you have project 5, do you want to find out its parent (2), or do
you want to find out all its parents including grandparents (2) and (1)?
What do you need to know?
C.
-----Original Message-----
From: André Medeiros [mailto:andre.caum
gmail.com]
Sent: 26 July 2005 12:18
To: php-general
lists.php.net
Subject: [PHP] MySQL + PHP question
*************************************
This e-mail has been received by the Revenue Internet e-mail service.
*************************************
Hi guys.
I'm having some trouble here regarding a project. I have a table with
projects, wich can be recursive (ie. sub-projects) and it is related to
itself.
By making the following query
---------------------8<--------------------------
SELECT * FROM projects LEFT JOIN projects proj_parent ON
projects.project_parent = proj_parent.parent_id WHERE project_id = 1234
---------------------8<--------------------------
i need to be able to access to the parent project's fields, but I have a
slight problem here.
First off, I have to make the LEFT JOIN. I don't know if the project can
be parent (therefore not finding a project_id = 0 wouldn't show the row)
and I need to add some kind of prefix to the proj_parent's fields so
that I can access them (or that they can't overwrite the project i'm
getting info on.
Well... there is an obvious sollution here: use an associative array
instead of an object, and access the properties by doing $array[0],
$array[1], etc. By my experience, this is a nightmare, maintenence-wise,
so I'd only use it as a _LAST_ resource.
Does anyone have any experience with this? The answer should be pretty
obvious, but I can't seem to figure it out :(
Thanks in advance.
André
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
************************
This message has been delivered to the Internet by the Revenue Internet e-mail service
*************************
attached mail follows:
On Tue, 2005-07-26 at 11:45 +0100, Shaw, Chris - Accenture wrote:
> Hello,
>
> Consider this:
> tbl_project(id, name, parent)
>
> 1 6
> / \ / \
> 2 3 7 8
> /\
> 4 5
>
> if tbl_project.parent = 0 then the project is the "top" parent.
> Therefore, 1 and 6 have the field parent = 0.
>
> So, say if you have project 5, do you want to find out its parent (2), or do
> you want to find out all its parents including grandparents (2) and (1)?
>
I just need to find it's parent. This is part of a permission system i'm
building, and I need to somewhat register the objects in the permission
system so I can manage things easilly from there.
So to sum it up, this is my attempt to save queries :)
> What do you need to know?
Projects can only be parent or children. No more recursiveness than that
(it's possible, but we've implemented business rules that prevent it.)
What I'm trying to do is to add some sort of prefix to the fields
returned by the proj_parent table (wich is the projects table the same,
but with "different" info, and will overwrite the object's properties).
If not... heck, I'll have to make another query or use the associative
array sollution (wich neither will make me very happy, but that's life).
Thanks for your prompt reply :)
>
> C.
> -----Original Message-----
> From: André Medeiros [mailto:andre.caum
gmail.com]
> Sent: 26 July 2005 12:18
> To: php-general
lists.php.net
> Subject: [PHP] MySQL + PHP question
>
>
> *************************************
>
> This e-mail has been received by the Revenue Internet e-mail service.
>
> *************************************
>
> Hi guys.
>
> I'm having some trouble here regarding a project. I have a table with
> projects, wich can be recursive (ie. sub-projects) and it is related to
> itself.
>
> By making the following query
>
> ---------------------8<--------------------------
> SELECT * FROM projects LEFT JOIN projects proj_parent ON
> projects.project_parent = proj_parent.parent_id WHERE project_id = 1234
> ---------------------8<--------------------------
>
> i need to be able to access to the parent project's fields, but I have a
> slight problem here.
>
> First off, I have to make the LEFT JOIN. I don't know if the project can
> be parent (therefore not finding a project_id = 0 wouldn't show the row)
> and I need to add some kind of prefix to the proj_parent's fields so
> that I can access them (or that they can't overwrite the project i'm
> getting info on.
>
> Well... there is an obvious sollution here: use an associative array
> instead of an object, and access the properties by doing $array[0],
> $array[1], etc. By my experience, this is a nightmare, maintenence-wise,
> so I'd only use it as a _LAST_ resource.
>
> Does anyone have any experience with this? The answer should be pretty
> obvious, but I can't seem to figure it out :(
>
> Thanks in advance.
>
> André
>
> --
>
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
> ************************
>
> This message has been delivered to the Internet by the Revenue Internet e-mail service
>
> *************************
attached mail follows:
Are you familiar with Joe Celko's tree theory? It might help you understand
more about the problem.
http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=235427
--
Hello,
Consider this:
tbl_project(id, name, parent)
1 6
/ \ / \
2 3 7 8
/\
4 5
if tbl_project.parent = 0 then the project is the "top" parent.
Therefore, 1 and 6 have the field parent = 0.
So, say if you have project 5, do you want to find out its parent (2), or do
you want to find out all its parents including grandparents (2) and (1)?
What do you need to know?
C.
-----Original Message-----
From: André Medeiros [mailto:andre.caum
gmail.com]
Sent: 26 July 2005 12:18
To: php-general
lists.php.net
Subject: [PHP] MySQL + PHP question
Hi guys.
I'm having some trouble here regarding a project. I have a table with
projects, wich can be recursive (ie. sub-projects) and it is related to
itself.
By making the following query
---------------------8<--------------------------
SELECT * FROM projects LEFT JOIN projects proj_parent ON
projects.project_parent = proj_parent.parent_id WHERE project_id = 1234
---------------------8<--------------------------
i need to be able to access to the parent project's fields, but I have a
slight problem here.
First off, I have to make the LEFT JOIN. I don't know if the project can
be parent (therefore not finding a project_id = 0 wouldn't show the row)
and I need to add some kind of prefix to the proj_parent's fields so
that I can access them (or that they can't overwrite the project i'm
getting info on.
Well... there is an obvious sollution here: use an associative array
instead of an object, and access the properties by doing $array[0],
$array[1], etc. By my experience, this is a nightmare, maintenence-wise,
so I'd only use it as a _LAST_ resource.
Does anyone have any experience with this? The answer should be pretty
obvious, but I can't seem to figure it out :(
Thanks in advance.
André
attached mail follows:
Hello,
Well its simply this:
select b.id
from tbl_project a, tbl_project b
where b.id = a.parent
and a.id = 5
This will return the id of project 5 parent, in this case it is 2.
If the query doesn't return any rows then you know the project doesn't have a
parent.
I cannot test it on MySQL, but this query should work on MSSQL and Oracle.
HTH.
C.
-----Original Message-----
From: André Medeiros [mailto:andre.caum
gmail.com]
Sent: 26 July 2005 12:53
To: Shaw, Chris - Accenture
Cc: php-general
lists.php.net
Subject: RE: [PHP] MySQL + PHP question
*************************************
This e-mail has been received by the Revenue Internet e-mail service.
*************************************
On Tue, 2005-07-26 at 11:45 +0100, Shaw, Chris - Accenture wrote:
> Hello,
>
> Consider this:
> tbl_project(id, name, parent)
>
> 1 6
> / \ / \
> 2 3 7 8
> /\
> 4 5
>
> if tbl_project.parent = 0 then the project is the "top" parent.
> Therefore, 1 and 6 have the field parent = 0.
>
> So, say if you have project 5, do you want to find out its parent (2), or
do
> you want to find out all its parents including grandparents (2) and (1)?
>
I just need to find it's parent. This is part of a permission system i'm
building, and I need to somewhat register the objects in the permission
system so I can manage things easilly from there.
So to sum it up, this is my attempt to save queries :)
> What do you need to know?
Projects can only be parent or children. No more recursiveness than that
(it's possible, but we've implemented business rules that prevent it.)
What I'm trying to do is to add some sort of prefix to the fields
returned by the proj_parent table (wich is the projects table the same,
but with "different" info, and will overwrite the object's properties).
If not... heck, I'll have to make another query or use the associative
array sollution (wich neither will make me very happy, but that's life).
Thanks for your prompt reply :)
>
> C.
> -----Original Message-----
> From: André Medeiros [mailto:andre.caum
gmail.com]
> Sent: 26 July 2005 12:18
> To: php-general
lists.php.net
> Subject: [PHP] MySQL + PHP question
>
>
> *************************************
>
> This e-mail has been received by the Revenue Internet e-mail service.
>
> *************************************
>
> Hi guys.
>
> I'm having some trouble here regarding a project. I have a table with
> projects, wich can be recursive (ie. sub-projects) and it is related to
> itself.
>
> By making the following query
>
> ---------------------8<--------------------------
> SELECT * FROM projects LEFT JOIN projects proj_parent ON
> projects.project_parent = proj_parent.parent_id WHERE project_id = 1234
> ---------------------8<--------------------------
>
> i need to be able to access to the parent project's fields, but I have a
> slight problem here.
>
> First off, I have to make the LEFT JOIN. I don't know if the project can
> be parent (therefore not finding a project_id = 0 wouldn't show the row)
> and I need to add some kind of prefix to the proj_parent's fields so
> that I can access them (or that they can't overwrite the project i'm
> getting info on.
>
> Well... there is an obvious sollution here: use an associative array
> instead of an object, and access the properties by doing $array[0],
> $array[1], etc. By my experience, this is a nightmare, maintenence-wise,
> so I'd only use it as a _LAST_ resource.
>
> Does anyone have any experience with this? The answer should be pretty
> obvious, but I can't seem to figure it out :(
>
> Thanks in advance.
>
> André
>
> --
>
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
> ************************
>
> This message has been delivered to the Internet by the Revenue Internet
e-mail service
>
> *************************
************************
This message has been delivered to the Internet by the Revenue Internet e-mail service
*************************
attached mail follows:
One thing I didn't quite explain myself well... I'm building this to
register objects on a permission system.
The SQL weight is heavy as it is, and I want to save queries as much as
possible. Making two queries to extract information about a project and
it's parent is not something I'd want to do. I know recursiveness, but
thanks for the pointers and for the reply :)
Best regards
attached mail follows:
You're missing the point here. I know how to get the parent project's
info. I know recursiveness. I _JUST_ don't know how to get the current
and parent project's info in just ONE QUERY (since I'm trying to save
them because the sql weight is getting pretty heavy).
attached mail follows:
"André Medeiros" <andre.caum
gmail.com> wrote in message
news:1122379553.3499.14.camel
vaio...
> One thing I didn't quite explain myself well... I'm building this to
> register objects on a permission system.
>
> The SQL weight is heavy as it is, and I want to save queries as much as
> possible. Making two queries to extract information about a project and
> it's parent is not something I'd want to do. I know recursiveness, but
> thanks for the pointers and for the reply :)
>
> Best regards
I must admit I still don't really get what you are looking for. Does this
query help?
select c.field1 AS childfield1,
c.field2 AS childfield2,
(etc)
p.field1 AS parentfield1,
p.field2 AS parentfield2,
(etc)
FROM
child AS c
LEFT JOIN
parent AS p
ON c.parent=p.id
?
attached mail follows:
On Tue, 2005-07-26 at 13:39 +0100, Mark Rees wrote:
> "André Medeiros" <andre.caum
gmail.com> wrote in message
> news:1122379553.3499.14.camel
vaio...
> > One thing I didn't quite explain myself well... I'm building this to
> > register objects on a permission system.
> >
> > The SQL weight is heavy as it is, and I want to save queries as much as
> > possible. Making two queries to extract information about a project and
> > it's parent is not something I'd want to do. I know recursiveness, but
> > thanks for the pointers and for the reply :)
> >
> > Best regards
>
> I must admit I still don't really get what you are looking for. Does this
> query help?
>
> select c.field1 AS childfield1,
> c.field2 AS childfield2,
> (etc)
> p.field1 AS parentfield1,
> p.field2 AS parentfield2,
> (etc)
> FROM
> child AS c
> LEFT JOIN
> parent AS p
> ON c.parent=p.id
>
> ?
>
Yeah, that might do, thanks!
attached mail follows:
Yeah I understand what he wants, but the problem boils down to the project
with no parent.
The only thing I can suggest is if you have a dummy row in, so the "top"
parent row, (1) or (6) in my example with have the dummy as its parent.
Then using:
select b.id parentID, b.name parentName, a.id childID, b.name childName
from tbl_project a, tbl_project b
where b.id = a.parent
and a.id = 1
Should give a row of:
ParentID: 0
ParentName: Dummy
ChildID: 1
ChildName: Project One
So, if a Project has a parent that the name is called Dummy, then you know it
doesn't have a parent.
HTH.
C.
-----Original Message-----
From: Mark Rees [mailto:mrees
itsagoodprice.com]
Sent: 26 July 2005 13:39
To: php-general
lists.php.net
Subject: Re: [PHP] MySQL + PHP question
*************************************
This e-mail has been received by the Revenue Internet e-mail service.
*************************************
"André Medeiros" <andre.caum
gmail.com> wrote in message
news:1122379553.3499.14.camel
vaio...
> One thing I didn't quite explain myself well... I'm building this to
> register objects on a permission system.
>
> The SQL weight is heavy as it is, and I want to save queries as much as
> possible. Making two queries to extract information about a project and
> it's parent is not something I'd want to do. I know recursiveness, but
> thanks for the pointers and for the reply :)
>
> Best regards
I must admit I still don't really get what you are looking for. Does this
query help?
select c.field1 AS childfield1,
c.field2 AS childfield2,
(etc)
p.field1 AS parentfield1,
p.field2 AS parentfield2,
(etc)
FROM
child AS c
LEFT JOIN
parent AS p
ON c.parent=p.id
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
************************
This message has been delivered to the Internet by the Revenue Internet e-mail service
*************************
attached mail follows:
On 22 July 2005 19:47, Surendra Singhi wrote:
> I don't think it will make the code confusing, but the person looking
> at the code should understand how reference and global variables
> work. Using reference variables avoids unnecessary extra copying of
> objects, and while
> using large arrays it can make a big difference in speed.
You shouldn't need to worry about this -- PHP tries to take care of it for
you. When you copy an array value, PHP only does a "shallow" copy (of the
array's address); if you later modify the array, this triggers a full "deep"
copy of all the array's element values before the modification is done.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
attached mail follows:
On 21 July 2005 22:19, Chris W. Parker wrote:
> 2. It will be a good idea to get out of the habit of breaking
> in and out
> of PHP like that. Instead just do: echo 'hi1';
Why? Some of us just strongly prefer the breaking in and out style -- I use
it almost exclusively. In my 10,000s of lines of code, you can probably
count the number of echos on your fingers!
> You'll have problems down the road with modifying the headers
> (cookies, redirects, content-type, etc.) if you break in and out.
Absolute rubbish -- whatever gives you this idea? The sequence
?>x<?php
Is functionally identical to
echo 'x';
so anything that works with the latter will work identically with the
former.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
attached mail follows:
* "Ford, Mike" <M.Ford
leedsmet.ac.uk> :
> On 21 July 2005 22:19, Chris W. Parker wrote:
>
> > 2. It will be a good idea to get out of the habit of breaking in and
> > out of PHP like that. Instead just do: echo 'hi1';
>
> Why? Some of us just strongly prefer the breaking in and out style -- I use
> it almost exclusively. In my 10,000s of lines of code, you can probably
> count the number of echos on your fingers!
>
> > You'll have problems down the road with modifying the headers
> > (cookies, redirects, content-type, etc.) if you break in and out.
>
> Absolute rubbish -- whatever gives you this idea? The sequence
>
> ?> x<?php
>
> Is functionally identical to
>
> echo 'x';
>
> so anything that works with the latter will work identically with the
> former.
I disagree with both statements. Echoing and breaking out of PHP are
typically both undesirable in large applications where you may wish to
change headers. Capture your output into a variable and send it to
output once all processing is done. This may be done using output
buffering or other techniques.
--
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/
attached mail follows:
Hi
I am retrieving data from postgresql and displaying it in form of table in
different rows.
my problem is when check box is clicked i need to change the color of the
row .agai when the check box is unclicked it should hold the old color.
Can any one please help me
Thanks & regards
Suma
_________________________________________________________________
Formula One fan? http://server1.msn.co.in/sp05/tataracing/ Get news,
wallpapers and photos of Narain Karthikeyan.
attached mail follows:
On 7/26/05, suma parakala <sumaparkala
hotmail.com> wrote:
> Hi
> I am retrieving data from postgresql and displaying it in form of table in
> different rows.
> my problem is when check box is clicked i need to change the color of the
> row .agai when the check box is unclicked it should hold the old color.
> Can any one please help me
> Thanks & regards
> Suma
>
That is a javascript challenge, not php.
http://www.google.fi/search?hl=fi&q=javascript&btnG=Google-haku&meta=
Dotan
http://lyricslist.com/lyrics/artist_albums/260/houston_whitney.php
Houston, Whitney Song Lyrics
attached mail follows:
suma parakala wrote:
> Hi
> I am retrieving data from postgresql and displaying it in form of table
> in different rows.
> my problem is when check box is clicked i need to change the color of
> the row .agai when the check box is unclicked it should hold the old color.
> Can any one please help me
This is a javascript question, not a PHP one. You will need to google
for a javascript snippet that changes the background of table cells.
Google 'javascript table dom'
attached mail follows:
* Rodolfo Gonzalez Gonzalez <rodolfo
equinoxe.g-networks.net>:
> this could be a silly question. Is there some performance penalty when
> using the <<< operator like this:
>
> $var =<<<EOP
> add a bunch of text here
> and here
> EOP;
>
> Just curious.
Try doing some benchmarks using microtime(). My gut reaction is that
there shouldn't be any difference; heredoc syntax is simply another form
of quoting strings.
The other factor to consider is if a few microseconds more of processing
time is worth the extra programming time it takes to get quotes right
(assuming heredoc syntax *does* take longer). I personally prefer
heredocs when using long, multiline strings to using double quotes --
they're easier to maintain.
--
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/
attached mail follows:
On Tue, 26 Jul 2005, Matthew Weier O'Phinney wrote:
>> this could be a silly question. Is there some performance penalty when
>> using the <<< operator [in heredoc]
>
> Try doing some benchmarks using microtime(). My gut reaction is that
> there shouldn't be any difference; heredoc syntax is simply another form
> of quoting strings.
I had forgotten the "heredoc" name for that sintax style. I'll do some
benchmarking. My reaction is the same, and even as there just one
asignment, I guess the operation is faster....
Thanks,
Rodolfo.
attached mail follows:
On 7/25/05, Jochem Maas <jochem
iamjochem.com> wrote:
> ...somebody beat me with a virtual stick if I am wrong!
Why? I'd rather just throw the php.net/manual at you!
Dotan
http://lyricslist.com/lyrics/artist_albums/23/aguilera_christina.php
Aguilera, Christina Song Lyrics
attached mail follows:
Dotan Cohen wrote:
> On 7/25/05, Jochem Maas <jochem
iamjochem.com> wrote:
>
>>...somebody beat me with a virtual stick if I am wrong!
>
>
> Why? I'd rather just throw the php.net/manual at you!
harddrive or memory stick?
but seriously did I err?
>
> Dotan
> http://lyricslist.com/lyrics/artist_albums/23/aguilera_christina.php
> Aguilera, Christina Song Lyrics
>
attached mail follows:
Please confirm the document.
+++ Attachment: No Virus found
+++ Panda AntiVirus - www.pandasoftware.com
attached mail follows:
This seems really silly, but I can't find a way of doing it!
How can I play/stream an audio file, that may be upto an hour long and
keep it playing while visitors view other pages?
Is it possible to use sessions so that the file will continue playing
when they hit the next page.
(It wouldn't really matter if there was a small pause while they changed)
(I don't really want to play it from a popup window.)
Any help would be greatly appreciated.
Tom
attached mail follows:
On Tue, 2005-07-26 at 13:47 +0100, Tom Chubb wrote:
> This seems really silly, but I can't find a way of doing it!
> How can I play/stream an audio file, that may be upto an hour long and
> keep it playing while visitors view other pages?
> Is it possible to use sessions so that the file will continue playing
> when they hit the next page.
> (It wouldn't really matter if there was a small pause while they changed)
> (I don't really want to play it from a popup window.)
> Any help would be greatly appreciated.
> Tom
>
Using frames?
attached mail follows:
I want to write a j2me midlet that displays a story headline and
description. This is working great.
However I want to write a php script that I can hit the url/page of
the full story with then pull all of the stories text and remove all
html/script/menu/imagee etc. So the phone can display it.
How can I effectively get (mostly) just the text?
Jay
attached mail follows:
On Tue, 2005-07-26 at 09:28 -0400, Krypto 76 wrote:
> I want to write a j2me midlet that displays a story headline and
> description. This is working great.
> However I want to write a php script that I can hit the url/page of
> the full story with then pull all of the stories text and remove all
> html/script/menu/imagee etc. So the phone can display it.
>
> How can I effectively get (mostly) just the text?
>
> Jay
>
http://pt.php.net/manual/en/function.strip-tags.php
attached mail follows:
Hi,
My main site allows authenticated users to insert bibliographic data into
our database. We ask them to start by putting in an ISBN or ISSN. Some
documentes don't have them, or the use is too lazy to look for them. Rather
than them entering jibberish, we first check that if they have entered
something - that its mathematically correct (there's a algorithm to check
these).
Where they don't know the ISBN/ISSN, I would like them to enter their
document title and then get my system to check the UK's main library biblio
service (COPAC) and see if the title exists on their db. I've set up a
simple cURL test which queries the COPAC site and displays the page as if it
was from my site (not quite what I wanted - I'd rather have a list of
ISBN/ISSNs and their associated titles without all the baggage).
So my questions are:
Is there a way for me to (using cURL) ask COPAC how many records match the
search and if >0, return the data in a way that I can use it as I wish?
If not, is there another tool that I should be using?
MTIA
George in Oxford (using a mix of NT4/XP by command of the company)
attached mail follows:
George Pitcher wrote:
> Hi,
the likelyhood that someone will answer you question with anything
relevant rapidly drops when you can't be bothered to start a new thread.
this is because threaded news/list readers are, well, threaded and your post
just got tagged onto the bottom of some, possibly totally uninteresting
thread, that person X is ignoring.
if you promise not to do it again I give you an answer that might help,
a little. promise? ok then... :-)
>
> My main site allows authenticated users to insert bibliographic data into
> our database. We ask them to start by putting in an ISBN or ISSN. Some
> documentes don't have them, or the use is too lazy to look for them. Rather
> than them entering jibberish, we first check that if they have entered
> something - that its mathematically correct (there's a algorithm to check
> these).
>
> Where they don't know the ISBN/ISSN, I would like them to enter their
> document title and then get my system to check the UK's main library biblio
> service (COPAC) and see if the title exists on their db. I've set up a
> simple cURL test which queries the COPAC site and displays the page as if it
> was from my site (not quite what I wanted - I'd rather have a list of
> ISBN/ISSNs and their associated titles without all the baggage).
>
> So my questions are:
>
> Is there a way for me to (using cURL) ask COPAC how many records match the
> search and if >0, return the data in a way that I can use it as I wish?
cURL is a tool for retrieving a resource from a URL....
so the question does COPAC offer a 'webservice' that returns 'raw' data?
this has nothing to do with cURL at all, you can view cURL (although it a
simplistic view as a webbrowser that you scripts can use)
COPAC may or may noy offer a handy webservice, and it may be subscription
based.
>
> If not, is there another tool that I should be using?
probably the most powerful one you have, its between your ears and pisses
over every other tool at your disposal :-)
- chances are you are going to have to use cURL to return the relevant
page to you script and then _parse_ the returned (x)HTML in order to determine
what (if any relevant data was returned in the page) - such 'parsing' is often
called screen-scraping .... probably you want to make use of either the
preg_*() functions, the DOM extension (DOMXML extension if using php4)
or SimpleXML extension in order to fish out the relevant data.
If you do end up having to scrape out the data yourself you might consider
sharing your code on hotscripts.com, phpclasses.org or whatever to save someone
else the time to reinvent the wheel .. actually why not search some of the php
related sites for code that does what you want - chances are someone has had to do
this before.
>
> MTIA
>
> George in Oxford (using a mix of NT4/XP by command of the company)
NT4? YPB (the middle word is 'Poor' ;-)
>
attached mail follows:
George Pitcher wrote:
> Jochem,
>
> Sorry about the thread issue - nothing intentional - just easier than trying
> to find my php-general address.
the list doesn't give a **** who sends the mail AFAICT, also if the mail you send
doesn't get read and /or replied to then whats the point?
oh and the way you describe it it _was_ intentional - you couldn't be bothered to
'find' your php-general address so you replied to an existing thread and changed the
subject.
not exactly a big deal though :-)
attached mail follows:
On 26 July 2005 14:38, George Pitcher wrote:
> So my questions are:
>
> Is there a way for me to (using cURL) ask COPAC how many
> records match the
> search and if >0, return the data in a way that I can use it
> as I wish?
>
> If not, is there another tool that I should be using?
Maybe you should be looking at the YAZ (Z39.50) extension? See
http://pecl.php.net/package/yaz and http://indexdata.dk/phpyaz/. I don't
know off the top of my head whether COPAC supports Z39.50, but it seems
likely. Failing that, I'm absolutely sure the British Library has a Z39.50
server.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
attached mail follows:
Hi all,
Iam running PHP on THTTPD 2.21b
I have a simple php script that sets the system clock (using exec("date -s MMDDhhmmYYYY.ss") and returns a page showing the system time
when i use it to set the time forwards, it works fine
but if i use it and set the time backwards (even a few seconds), the webserver hangs. also it hangs only for exactly the amount of time needed for the backwards-set time to catch up with the original time. when the clock catches up with the original time, the page is returned. till then it hangs
it's almost as if the webserver is waiting for the time to come back to the request-received time before sending the page.
i dont know if this is a php problem or a thttpd problem. any pointers, please ?
Regards,
Vinoo
________________________________________________________________
Sent via the WebMail system at kalkitech.com
attached mail follows:
Hi Rasmus,
This may be a little bit long, sorry for taking your time.
It still does not work as expected. I tried some experiment, and found that
if I called some function or write some code line other then calling
header(), the register_shutdown_function and other part of codes work as
expected . For example:
<?php
set_time_limit(5);
function f(){
set_time_limit(10);
//doing something time consuming
}
some_function();
?>
The time limit of 5 will be the limit of the some_function() and the 10 will
be the limit of function f() respectively.
Code example:
-----------------------------------------------------------------------------------------------------------------------
<?php
set_time_limit(1);
ignore_user_abort(true);
function say_goodbye() {
$st = connection_status();
print "Status 1: ".$st."\n";
set_time_limit(10);
$st = connection_status();
print "Status 2: ".$st."\n";
$count=20000000;
for($i=0; $i<$count; $i++){ }
print "End!\n";
exec("touch /home/.nappy/liang/liang.ns2user.info/php/bbb");
}
register_shutdown_function("say_goodbye");
print "Sleeping...\n";
$count=10000000;
for($i=0; $i<$count; $i++){ }
print "Done!\n";
?>
------------------------------------------------------------------------------------------------------------------------
-bash-2.05b$ curl -N liang.ns2user.info/php/v.php
Sleeping...
<br />
<b>Fatal error</b>: Maximum execution time of 1 second exceeded in
<b>/home/.nappy/liang/liang.ns2user.info/php/v.php</b> on line <b>30</b><br
/>
Status 1: 2
Status 2: 2
End!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if I change the time limit from 10 to 5 in function f()
-bash-2.05b$ curl -N liang.ns2user.info/php/v.php
Sleeping...
<br />
<b>Fatal error</b>: Maximum execution time of 1 second exceeded in
<b>/home/.nappy/liang/liang.ns2user.info/php/v.php</b> on line <b>30</b><br
/>
Status 1: 2
Status 2: 2
<br />
<b>Fatal error</b>: Maximum execution time of 5 seconds exceeded in
<b>/home/.nappy/liang/liang.ns2user.info/php/v.php</b> on line <b>14</b><br
/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change both the time limit to 10 will result:
-bash-2.05b$ curl -N liang.ns2user.info/php/v.php
Sleeping...
Done!
Status 1: 0
Status 2: 0
End!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
But if the some_function is header() then the rule above does not work. It
seems the function f()'s time limit also rule the header(). Only after the
registered shutdown function finishes runing normally or by hit the expire
time limit, will the header() return page to browser/http user agent.
Example code with suggestion from Rasmus as:
------------------------------------------------------------------------------------------------------------------
<?php
set_time_limit(5);
function f(){
set_time_limit(100);
$count=500000000;
for($i=0; $i<$count; $i++){
//sit here and loop for a bit so we can have time to hit Stop...
echo "a \n"; flush();
}
echo "end";
exec("touch /tmp/aaa");
}
register_shutdown_function('f');
ignore_user_abort(true);
header("Content-type: text/plain");
header("Location: y.html");
echo "foo\n"; flush();
for($i=0;$i<10;$i++) { echo $i; sleep(1); }
$fp = fopen("/tmp/foo.txt","a");
fputs($fp,$i);
fclose($fp);
?>
------------------------------------------------------------------------------------------------------------------
After the file /tmp/foo.txt has been created, before the file /tmp/aaa being
created, the y.html will not get to the browser or perl program using
LWP::UserAgent. I think it is no way to close the connection actively by the
php program to deliver the page sooner to end the http request, even I add
lines and make code like this does not work:
----------------------------------------------------------------
header("Content-type: text/plain");
header("Cache-Control: no-store, no-cache");
header("Location: y.html");
header("Connection: close");
----------------------------------------------------------------
My project act as a broker for user agent to a library database server
called z39.50. Upon the request from user agent, my program need to connect
a z39.50 server, getting data back 1 by 1, transforming to sepcial xml
format and sending back to the request party. When the data repository is
huge (sometimes up to million records), I have to get partial data transform
and send back to user agent (normally a piece of perl code, called
harvester) with a resumption token. The harvester will in a while loop send
out another http request with the last resumption token and fetch data of
next part, until finish all data fetching. The time to connect the database
and do the query is a constant overhead. So it is not a good design that
program need to connect the database and query upon each request with or
with out resumption token. So my design is to connect to database and query
only when the first initial request comes, and reponse back with partical
data using header() and continue getting back data from z39 server. Upon
next request, the program will only need to make sure the data needed has
already stored in the harddrive and transform them and send them back.
Since the user harvester agent normally has a 180 second timeout, it is
necessary to respond within that period of time.
I really need your suggestion. Thank you very much again.
Liang
>Try somthing lik
e this:
>
><?php
>ignore_user_abort(true);
>header("Location: redirect2.html");
>echo "foo\n"; flush();
>for($i=0;$i<10;$i++) { echo $i; sleep(1); }
>$fp = fopen("/tmp/foo.txt","a");
>fputs($fp,$i);
>fclose($fp);
>?>
>
>
>Liang ZHONG wrote:
> > Sorry, does not seem to work here. The code below takes minutes to show
> > up in browser.
> >
> > Any more suggestion?
> >
>---------------------------------------------------------------------------------------
> >
> > <?php
> >
> > set_time_limit(5);
> >
> > function f(){
> > set_time_limit(100);
> > $count=500000000;
> > for($i=0; $i<$count; $i++){ }
> > echo "end";
> > exec("touch /home/.nappy/liang/liang.ns2user.info/php/aaa");
> > }
> >
> > register_shutdown_function('f');
> >
> > ignore_user_abort(true);
> > header("Content-type: text/plain");
> > header("Location: y.html");
> >
> > $count=50000;
> > for($i=0; $i<$count; $i++){ echo " \n"; }
> > flush();
> > ?>
> >
>---------------------------------------------------------------------------------------
> >
> >
> > Liang
> >
> >>
> >> If you don't flush some output after setting the header() then the
> >> headers won't go out until the end of the request. So do something
>like:
> >>
> >> ignore_user_abort(true);
> >> header("Location: http://whatever");
> >> echo "foo\n"; flush();
> >>
> >> Then whatever comes after this should run and the browser is long gone.
> >>
> >> -Rasmus
> >>
> >>
> >> Liang ZHONG wrote:
> >> > I think I did not express myself clearly.
> >> >
> >> > What I want is to be able to redirect user an existing page (let them
> >> > get it immediately), and to close the connection actively, NOT
> >> passively
> >> > by user abort, at last, to run the function in background.
> >> >
> >> > But the redirecting using function header() with location has a
>problem
> >> > that header() always does return the page to user after the entire
> >> > program, including registered showdown function finish running,
> >> which is
> >> > against the will. I put a time consuming task into a function that
> >> > registered to be a shutdown function and hoping it runs after the
>user
> >> > has got the redirected page and the connection has been closed. But
> >> > experiements (using browsers, curl command line tool as well as
> >> > perl::LWP code) show that the user got the redirected page only after
> >> > the shutdown function finished, which is against the description of
> >> > register_shutdown_function at php website.
> >> >
> >> > It seems only header() function use to redirect page has this problem
> >> > (not executed until register_shutdown_function finished) while other
> >> > functions like print()/echo(), exec() have not.
> >> >
> >> > The code looks like:
> >> >
> >>
>---------------------------------------------------------------------------------------------
> >>
> >> >
> >> > <?php
> >> > set_time_limit(1);
> >> >
> >> > function f(){
> >> > set_time_limit(20);
> >> > $count=50000000;
> >> > for($i=0; $i<$count; $i++){ }
> >> > echo "end";
> >> > exec("touch /home/.nappy/liang/liang.ns2user.info/php/aaa");
> >> > }
> >> >
> >> > register_shutdown_function('f');
> >> >
> >> > header("Content-type: text/plain");
> >> > header("Location: y.html");
> >> > ?>
> >> >
> >>
>---------------------------------------------------------------------------------------------
> >>
> >> >
> >> >
> >> > http client who sends the request to the php program will only get
>the
> >> > page back as response after function f finsihes (file aaa created).
> >> > Changing the $count will make a lot difference.
> >> >
> >> > My BIGGEST question is:
> >> > How to make user get the redirect page immediately after the
> >> header() is
> >> > called, and not until function f() ends, while making sure that the
> >> > function f() will finally fully (and might slowly) execute?
> >> >
> >> > Thank you very much for kindly replying.
> >> >
> >> > With high respect,
> >> >
> >> > Liang
> >> >
> >> >
> >> >>
> >> >> Liang ZHONG wrote:
> >> >> > My Question is:
> >> >> > What is the correct way to keep the function running after I
> >> >> redirect an
> >> >> > existing page to http client (which I want the client get
> >> immediately)
> >> >> > and then immediately close the connection?
> >> >>
> >> >> ignore_user_abort(true);
> >> >>
> >> >> -Rasmus
> >> >>
> >> >> --
> >> >> 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
> >>
> >
>
attached mail follows:
Hi,
I have Apache 2.0.52 with PHP 4.3.9, running on a Linux Fedora 3, and cannot
write through PHP on any folder, except for /tmp.
No matter which permissions, owner or group are set for the folders or files,
they never become writable.
When I execute the following script, I have always obtain as a result, that "The
file is not writable", although it should be, because test.txt has Apache as its
owner and group, and permissions for reading, writing and executing for the
owner, group and others.
In Apache, the user and group are set to Apache, and in PHP the safe mode is off.
-----------------------------------------------------------------------------
<?php
$filename1 = '/opt/ilias/www/htdocs/ilias3/setup/test.txt';
$filename2 = '/opt/ilias/www/htdocs/ilias3/setup';
$filename3 = '/tmp';
clearstatcache();
if (is_writable($filename1)) {
echo 'The file is writable';
} else {
echo 'The file is not writable';
}
clearstatcache();
if (is_readable($filename1)) {
echo 'The file is readable';
} else {
echo 'The file is not readable';
}
clearstatcache();
if (file_exists($filename1)) {
echo "The file exists";
} else {
echo "The file does not exist";
}
?>
------------------------------------------------------------------------------
Have you ever experienced a problem like this?
Thanks a lot,
Nancy.
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
attached mail follows:
Hey!
I presently require hosting with a company that has their servers in Sweden,
and I need a shared hosting account,
any recommendations are welcome, the server is for a client.
I have found quire a few via google but I noticed most of them are with
Safemode ON and Register_globals ON
which I find to be quite strange because I have always hosted on a "regular"
server with safe mode off, register_
globals does not really metter, as if it was off I didnt do anything but if
it was on I used a htaccess file to put the
b**ch off :-)
I have done a little reading on Safe Mode, but I'm looking for _your_
experiences with safe mode and the problems
you have faced or/and any warnings for me. Will continue to read and search
via google while i wait for your answer/s.
OT->Another difference I have noticed with Swedish hosts and American hosts
is...more than 50% of the hosts here
are offering _no_ limit to traffic!! (As long as you are not offering music,
movies,porn or torrent trackers on the site)
Thanks,
Ryan
attached mail follows:
Hello everyone,
What I want to do is have a form (which is already created) where the user selects (via checkbox) on an item or group of items (almost like a shopping cart). These items are stored in a MySql database and the program was written in PHP. So far I have created an insert form that inserts the products into a database. The database is displayed in a form where the user now needs to click on the select box so that he/she can choose their items. Once they have chosen the items a confirmation page is supposed to come out with the user's choices and the user will confirm that this is correct or not and either click submit or go back to choose again. If they click submit than I am supposed to receive an email with all of the user's choices. The part I am still stuck in is when the user attempts to choose, nothing really happens. Following is the code that displays the database and allows the user to choose via the check box....Any help would be appreciated.
<?php require_once('Connections/connBlog.php'); ?>
<?php
mysql_select_db($database_connBlog, $connBlog);
$query_Recordset1 = "SELECT * FROM ebay_products";
$Recordset1 = mysql_query($query_Recordset1, $connBlog) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php require_once('Connections/connBlog.php'); ?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div align="center">
<p> </p>
<form action="" method="post" name="form1">
<table width="75%" height="10%" border="10" align="center" cellpadding="0" cellspacing="0" bordercolor="#99FFCC">
<tr>
<td><div align="center">Description of Product</div></td>
<td><div align="center">Coupon Amount</div></td>
<td><div align="center">Expiration Date</div></td>
<td><div align="center">Your Selection</div></td>
</tr>
<?php do { ?>
<tr>
<td width="65%">
<div align="center"><?php echo $row_Recordset1['product']; ?></div></td>
<td width="8%">
<div align="center">$<?php echo $row_Recordset1['discount']; ?></div></td>
<td width="15%">
<div align="center"><?php echo $row_Recordset1['expire']; ?></div></td>
<td width="2%">
<div align="center">
<input name="select" type="checkbox" id="select" value="checkbox">
</div></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<table width="25%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="center">
<input type="submit" name="Submit" value="Submit">
</div></td>
<td>
<div align="center">
<input name="back" type="button" id="back" value="Go Back">
</div></td>
</tr>
</table>
<p> </p>
</form>
<p> </p>
</div>
<p align="center"> <a href="ebayinsert.php">Insert Data</a></p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
attached mail follows:
I upgraded from PHP 5.0.4 to 5.1b3 yesterday and all my scripts die the only
trace being a lone line:
default 16
written to the command window. There are a few Notice's that preceed that
look like:
Notice: Only variable references should be returned by reference in
c:\Programs\php\php-5.1b3\extras
\log4php\LoggerManager.php on line 92
Call Stack:
0.0043 1. {main}()
c:\cvs\ag1\eng\src\php\activegrid\data\test\mysqldataservicetest.php:0
0.0374 2.
require_once('C:\cvs\ag1\eng\src\php\activegrid\agunittest.php')
c:\cvs\ag1\eng\src\
php\activegrid\data\test\mysqldataservicetest.php:6
11.3656 3.
require_once('C:\cvs\ag1\eng\src\php\activegrid\util\xmlutils.php')
C:\cvs\ag1\eng\s
rc\php\activegrid\agunittest.php:13
11.3915 4.
require_once('C:\cvs\ag1\eng\src\php\activegrid\util\xmlmarshaller.php')
C:\cvs\ag1\
eng\src\php\activegrid\util\xmlutils.php:8
11.4067 5. LoggerManager::getLogger()
C:\cvs\ag1\eng\src\php\activegrid\util\xmlmarshaller.php:
15
PHP 5.1 doesn't seem to like Log4PHPs use of the reference operator. I'm
not sure if they're related
though. I took all the offending reference operators out of Log4PHP which
got rid of the notices. Now
it just with that one enigmatic error "default 16".
attached mail follows:
Hi everybody, I am learning PHP, and have this very basic question:
What software/tools I need to begin?
What is the best IDE I can use? (in windows) Please tell me about FULL-IDEs, not just "super text editors that can syntax-highlight PHP code". I want to debug, deploy... ALL!
I have just downloaded Zend Studio Client AND Zend Studio Server. Is that all I need to begin?...
Tak
---------------------------------
Start your day with Yahoo! - make it your home page
attached mail follows:
You would actually only need Zend Studio Client.
It's the best PHP IDE i've ever tried (and believe me, i've been around ;)
On 7/26/05, Taksam <taksam_tong
yahoo.com> wrote:
> Hi everybody, I am learning PHP, and have this very basic question:
>
> What software/tools I need to begin?
> What is the best IDE I can use? (in windows) Please tell me about FULL-IDEs, not just "super text editors that can syntax-highlight PHP code". I want to debug, deploy... ALL!
> I have just downloaded Zend Studio Client AND Zend Studio Server. Is that all I need to begin?...
>
> Tak
>
>
> ---------------------------------
> Start your day with Yahoo! - make it your home page
>
attached mail follows:
To expand a little: Zend Client is super for debugging on a localhost
but if you want a team of developers to have debug / profile tools then
Zend Studio Server is the tool. I would suggest that you apply for the
Zend Small Business program if these tools meet your needs for one low
yearly price you get both plus the encoder and the server module to
handle deployments, or testing... I hope this is helpful.
--Jeff
On Tue, 2005-07-26 at 18:32 +0100, André Medeiros wrote:
> You would actually only need Zend Studio Client.
>
> It's the best PHP IDE i've ever tried (and believe me, i've been around ;)
>
> On 7/26/05, Taksam <taksam_tong
yahoo.com> wrote:
> > Hi everybody, I am learning PHP, and have this very basic question:
> >
> > What software/tools I need to begin?
> > What is the best IDE I can use? (in windows) Please tell me about FULL-IDEs, not just "super text editors that can syntax-highlight PHP code". I want to debug, deploy... ALL!
> > I have just downloaded Zend Studio Client AND Zend Studio Server. Is that all I need to begin?...
> >
> > Tak
> >
> >
> > ---------------------------------
> > Start your day with Yahoo! - make it your home page
> >
>
--
Jeffrey D. Means <meaje
meanspc.com>
MeansPC
attached mail follows:
Taksam wrote:
> Hi everybody, I am learning PHP, and have this very basic question:
>
> What software/tools I need to begin?
> What is the best IDE I can use? (in windows) Please tell me about FULL-IDEs, not just "super text editors that can syntax-highlight PHP code". I want to debug, deploy... ALL!
> I have just downloaded Zend Studio Client AND Zend Studio Server. Is that all I need to begin?...
http://www.thelinuxconsultancy.co.uk/phpeditors.php
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
This is with simplexml_load_file(). Using an empty()
check instead of is_array() does the trick (though -
note to php hackers - I think is_array() SHOULD work).
John
--- Jochem Maas <jochem
iamjochem.com> wrote:
> John Smith wrote:
> > I'm trying to avoid error messages while iterating
> > over DOM properties. e.g.
>
>
> >
> > if(is_array($dom->stuff->props)) {
>
> maybe you can get roudn the problem by saying?:
>
> if($dom->stuff->props) {
>
> or?:
>
> if(!empty($dom->stuff->props)) {
>
> > foreach($dom->stuff->props as $prop) {
> > ...
> > }
> > }
> >
> > It works without the is_array() check, but not
> with
>
> my guess is you'll find that $dom->stuff->props is
> an object
> which overloads the array accessor stuff...
> basically it's implementing Iterator (or some other
> SPL Interface)
>
> hard to tell though because you don't mention which
> DOM
> related extension you are using.
>
> > it. I've done var_dumps and $dom->stuff->props is
> > indeed an array. I've also tried using an
> intermediate
> > variable ($stuff=$dom->stuff) then checking that,
> but
> > that doesn't work either).
> >
> > John
> >
> >
> >
> >
> ____________________________________________________
> > Start your day with Yahoo! - make it your home
> page
> > http://www.yahoo.com/r/hs
> >
> >
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
attached mail follows:
John Smith wrote:
> This is with simplexml_load_file(). Using an empty()
> check instead of is_array() does the trick (though -
> note to php hackers - I think is_array() SHOULD work).
ah simplexml, in that case is_array() shouldn't and won't
work because it's 'all' objects (although I can understand why it seems
like it should work!) - but the objects allow array(-like) iteration
of contained elements.
read this again very carefully:
http://be2.php.net/simplexml
note also that even values are actually objects that implement
the __toString() interface (although I'm not sure that is the
correct way to explain/name it) where by the object is automatically
cast to a string in a sensible way when used with echo/print ...
as the exmaples on the simplexml page show you have to cast manually
if you want to do other things with the string representation (like
using the actually value of the object as the test value of a switch
block.
here is some more reading material:
http://www.onlamp.com/pub/a/php/2004/01/15/simplexml.html
good luck
>
> John
>
>
> --- Jochem Maas <jochem
iamjochem.com> wrote:
>
>
>>John Smith wrote:
>>
>>>I'm trying to avoid error messages while iterating
>>>over DOM properties. e.g.
>>
>>
>>>if(is_array($dom->stuff->props)) {
>>
>>maybe you can get roudn the problem by saying?:
>>
>>if($dom->stuff->props) {
>>
>>or?:
>>
>>if(!empty($dom->stuff->props)) {
>>
>>
>>> foreach($dom->stuff->props as $prop) {
>>> ...
>>> }
>>>}
>>>
>>>It works without the is_array() check, but not
>>
>>with
>>
>>my guess is you'll find that $dom->stuff->props is
>>an object
>>which overloads the array accessor stuff...
>>basically it's implementing Iterator (or some other
>>SPL Interface)
>>
>>hard to tell though because you don't mention which
>>DOM
>>related extension you are using.
>>
>>
>>>it. I've done var_dumps and $dom->stuff->props is
>>>indeed an array. I've also tried using an
>>
>>intermediate
>>
>>>variable ($stuff=$dom->stuff) then checking that,
>>
>>but
>>
>>>that doesn't work either).
>>>
>>>John
>>>
>>>
>>>
>>>
>>
>>____________________________________________________
>>
>>>Start your day with Yahoo! - make it your home
>>
>>page
>>
>>>http://www.yahoo.com/r/hs
>>>
>>>
>>
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
attached mail follows:
Hello,
following code won't work in the expected way:
class ClassA {
function getClassName() {
return get_class($this); # [1]
}
}
class ClassB extends ClassA { }
echo ClassB::getClassName();
this script echoes "Object" instead of "ClassB". but i would like to
return the classname of the derived class without writing the method again.
this will work:
B = new ClassB();
echo ClassB->getClassName();
i tried to use line [2] instead of [1]
return get_class(self); # [2]
but this only returns an empty string.
is there any solution for my problem?
i'm using PHP Version 5.0.3 (with Apache 1, Windows XP)
greetings
axel
attached mail follows:
Hello axel,
Tuesday, July 26, 2005, 8:02:05 PM, you wrote:
a> class ClassA {
a> function getClassName() {
a> return get_class($this); # [1]
a> }
a> }
a> class ClassB extends ClassA { }
a> echo ClassB::getClassName();
a> this script echoes "Object" instead of "ClassB". but i would like to
a> return the classname of the derived class without writing the method again.
"The double colon, is a token that allows access to static, constant,
and overridden members or methods of a class."
Of which none of yours are (at least not in the code posted)
Wouldn't get_parent_class() work in this situation?
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
Zend Certified Engineer
"I do not fear computers. I fear the lack of them." - Isaac Asimov
attached mail follows:
axel wrote:
> Hello,
>
> following code won't work in the expected way:
>
> class ClassA {
> function getClassName() {
> return get_class($this); # [1]
> }
> }
> class ClassB extends ClassA { }
> echo ClassB::getClassName();
>
> this script echoes "Object" instead of "ClassB". but i would like to
either you tested some different code to what you posted above OR
(your build of?) 5.0.3 is borked.
I tested this on 5.0.2 and 5.0.4 and both did exactly what I expected, namely
output nothing - $this is not defined when you call ClassB::getClassName()
(because you make a static call) so nothing is the only logical output.
> return the classname of the derived class without writing the method again.
>
> this will work:
??? it's not even valid php.
>
> B = new ClassB();
> echo ClassB->getClassName();
maybe you mean:
class ClassA {function getClassName() { return get_class($this); }}
class ClassB extends ClassA {}
$B = new ClassB();
echo $B->getClassName();
which _does_ work but is fairly pointless because you
already know the classname in order to be able to create the object
in the first place.
>
>
> i tried to use line [2] instead of [1]
> return get_class(self); # [2]
> but this only returns an empty string.
again this is what I expect to happen.
>
> is there any solution for my problem?
I don't really see what the problem is, can you give some
more real world detail on what you are trying/want to do?
otherwise (re-)read this chapter:
http://php.belnet.be/manual/en/language.oop5.php
... if you're _really_ into generic code then the reflection API
is maybe you should look into. I have used reflection no and again,
very useful stuff although to be honest I don't really grasp the
concept/reasoning behind reflection properly (which means I have probably
been 'misusing' it :-)
rgds
>
> i'm using PHP Version 5.0.3 (with Apache 1, Windows XP)
>
> greetings
> axel
>
attached mail follows:
How do you specify a port to connect to? I tried using
localhost:3050 (3050 is the default port that Firebird) and that
didn't work.
$host = 'localhost:/path/to/your.gdb' ;
$username = 'SYSDBA';
$password = 'masterkey';
$dbh = ibase_connect ( $host , $username , $password );
--
-James
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]