OSEC

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 7 Jun 2004 06:06:48 -0000 Issue 2807

php-general-digest-helplists.php.net
Date: Mon Jun 07 2004 - 01:06:48 CDT


php-general Digest 7 Jun 2004 06:06:48 -0000 Issue 2807

Topics (messages 187738 through 187769):

Re: asp.net vs. php
        187738 by: Richard Davey

mkdir after mkdir
        187739 by: Gerben
        187740 by: Daniel Clark
        187741 by: Marek Kilimajer
        187742 by: Gerben
        187743 by: Gerben
        187745 by: Kevin Murphy
        187748 by: Marek Kilimajer

Intalling PHP 4.3.7 with PGSQL support and Heimdal
        187744 by: Robert Fitzpatrick
        187749 by: Marek Kilimajer
        187759 by: Robert Fitzpatrick
        187762 by: Marek Kilimajer

2 Websites on 1 url
        187746 by: jos.de.nijs.f1help.org
        187747 by: Torsten Roehr

Get Column Names for mySQL...
        187750 by: Russell P Jones
        187751 by: Marek Kilimajer
        187752 by: John W. Holmes

Re: Newbie question about good coding practice [isset]
        187753 by: Justin Patrin

Re: generating graphs
        187754 by: Justin Patrin

Re: Multiple URL Redirection
        187755 by: Justin Patrin

Re: Refresh Page
        187756 by: Chris Shiflett

Doubling up...
        187757 by: Russell P Jones
        187758 by: John W. Holmes

ini_get
        187760 by: Dennis Gearon

Re: help needed with tiger tree hashes
        187761 by: Carl S. in 't Veld

Array keys referencing value from another array key???
        187763 by: Gerard Samuel
        187764 by: Marek Kilimajer

A follow up on my question about good coding practice [isset]
        187765 by: Al
        187769 by: Ligaya Turmelle

Help installing imagick
        187766 by: Robert Duran
        187768 by: Galen

Dynamic Function Call
        187767 by: [-^-!-%-

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Hello Chris,

Sunday, June 6, 2004, 5:27:31 PM, you wrote:

c> and you'll find that there is not a comprehensive comparison. Don't be so
c> quick to assume that someone hasn't done their homework. I've the spent the
c> past 6 months learning .NET and searching for comprehensive discussions of
c> how it compares to other web development approaches. I can assure you that
c> there are very few comprehensive ROI or technical comparisons being made.

c> There are, however, plenty of .02 about m$ and open source.

It's a bit of a non-starter from the outset though. The .NET framework
is vast and extends well beyond the confines that PHP operates within.
To compare them on a single web level would be relatively pointless,
not to say misleading for both parties concerned. I don't believe
there is anything that compares to the .NET framework as a whole, other
than maybe Java. So if you want accurate comparisons that would be
the place to look. Anyone who thinks ASP.NET is even remotely similar
to ASP just doesn't understand what .NET is about. Yet comparing PHP
with ASP is a perfectly valid exercise in terms of cost benefits, ROI,
development times, etc.

These are, however, just my .02 worth - though I have used the .NET
framework (specifically C#) commercially for nearly 4 years (and PHP
for considerably longer than that).

Best regards,

Richard Davey
--
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

attached mail follows:


Hello,

I have a problem with the mkdir function.
I'm trying to make a seperate folder every photoalbum. inside I want to
create another folder ('.../thumbnails/') for, you can guess, the
thumbnails.

At first it didn't work at all:

>Warning: mkdir() failed (Permission denied) in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42

When I changed the rights of the folder I wanted to create the new folder in
to chmod 0777, the first MKDIR did work, but the second did not.

>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
allowed to access
/home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0 owned
by uid 48 in /home/virtual/site43/fst/var/www/html/beheer/albums/index.php
on line 43

this is very strange because the folders are both made in the same script.
Another strange thing is that I user mkdir($dir, 0777), but when I look at
the created folder it is 0755 and I can not change it.

That's pritty much my problem. Your help would be very much appreciated.

attached mail follows:


I think PHP and mkdir() is using the web servers rights. So the web server would need rights to create directories.

>>Hello,
>>
>>I have a problem with the mkdir function.
>>I'm trying to make a seperate folder every photoalbum. inside I want to
>>create another folder ('.../thumbnails/') for, you can guess, the
>>thumbnails.
>>
>>At first it didn't work at all:
>>
>>>Warning: mkdir() failed (Permission denied) in
>>/home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
>>
>>When I changed the rights of the folder I wanted to create the new folder in
>>to chmod 0777, the first MKDIR did work, but the second did not.
>>
>>>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
>>allowed to access
>>/home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0 owned
>>by uid 48 in /home/virtual/site43/fst/var/www/html/beheer/albums/index.php
>>on line 43
>>
>>this is very strange because the folders are both made in the same script.
>>Another strange thing is that I user mkdir($dir, 0777), but when I look at
>>the created folder it is 0755 and I can not change it.
>>
>>That's pritty much my problem. Your help would be very much appreciated.

attached mail follows:


Gerben wrote:
> Hello,
>
> I have a problem with the mkdir function.
> I'm trying to make a seperate folder every photoalbum. inside I want to
> create another folder ('.../thumbnails/') for, you can guess, the
> thumbnails.
>
> At first it didn't work at all:
>
>
>>Warning: mkdir() failed (Permission denied) in
>
> /home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
>
> When I changed the rights of the folder I wanted to create the new folder in
> to chmod 0777, the first MKDIR did work, but the second did not.
>
>
>>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
>
> allowed to access
> /home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0 owned
> by uid 48 in /home/virtual/site43/fst/var/www/html/beheer/albums/index.php
> on line 43
>
> this is very strange because the folders are both made in the same script.
> Another strange thing is that I user mkdir($dir, 0777), but when I look at
> the created folder it is 0755 and I can not change it.
>
> That's pritty much my problem. Your help would be very much appreciated.
>

The first directory your script creates is owned by the uid apache runs
under (48 in your case). Safe mode allows access only to files and
directories owned by the uid of the executing script (1042 in your case).

The workaround is to use ftp functions to create the directories. Simply
  use your ftp username and password to login to localhost and create
the directories.

HTH

attached mail follows:


I have those rights since the first dir is created. the problem is that the
2nd is not created

"Daniel Clark" <dclarknwlink.com> wrote in message
news:20040606172911.A6E876ADECsmtp4.pacifier.net...
> I think PHP and mkdir() is using the web servers rights. So the web
server would need rights to create directories.
>
> >>Hello,
> >>
> >>I have a problem with the mkdir function.
> >>I'm trying to make a seperate folder every photoalbum. inside I want to
> >>create another folder ('.../thumbnails/') for, you can guess, the
> >>thumbnails.
> >>
> >>At first it didn't work at all:
> >>
> >>>Warning: mkdir() failed (Permission denied) in
> >>/home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
> >>
> >>When I changed the rights of the folder I wanted to create the new
folder in
> >>to chmod 0777, the first MKDIR did work, but the second did not.
> >>
> >>>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
> >>allowed to access
> >>/home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0
owned
> >>by uid 48 in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php
> >>on line 43
> >>
> >>this is very strange because the folders are both made in the same
script.
> >>Another strange thing is that I user mkdir($dir, 0777), but when I look
at
> >>the created folder it is 0755 and I can not change it.
> >>
> >>That's pritty much my problem. Your help would be very much appreciated.

attached mail follows:


Unfortunately my server has no ftp (but SSH).
It makes much sence what you said, but how can PHP (with uid=48) make a
directory with uid=1042.
both folder are (to be) made the same script, but only one is (with
uid=1042).

This is what makes it very peculiar.
I think I have skip the idea of creating 2 nested folders.

Thanks anyway

"Marek Kilimajer" <listskilimajer.net> wrote in message
news:40C355D8.4090803kilimajer.net...
> Gerben wrote:
> > Hello,
> >
> > I have a problem with the mkdir function.
> > I'm trying to make a seperate folder every photoalbum. inside I want to
> > create another folder ('.../thumbnails/') for, you can guess, the
> > thumbnails.
> >
> > At first it didn't work at all:
> >
> >
> >>Warning: mkdir() failed (Permission denied) in
> >
> > /home/virtual/site43/fst/var/www/html/beheer/albums/index.php on line 42
> >
> > When I changed the rights of the folder I wanted to create the new
folder in
> > to chmod 0777, the first MKDIR did work, but the second did not.
> >
> >
> >>SAFE MODE Restriction in effect. The script whose uid is 1042 is not
> >
> > allowed to access
> > /home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0
owned
> > by uid 48 in
/home/virtual/site43/fst/var/www/html/beheer/albums/index.php
> > on line 43
> >
> > this is very strange because the folders are both made in the same
script.
> > Another strange thing is that I user mkdir($dir, 0777), but when I look
at
> > the created folder it is 0755 and I can not change it.
> >
> > That's pritty much my problem. Your help would be very much appreciated.
> >
>
> The first directory your script creates is owned by the uid apache runs
> under (48 in your case). Safe mode allows access only to files and
> directories owned by the uid of the executing script (1042 in your case).
>
> The workaround is to use ftp functions to create the directories. Simply
> use your ftp username and password to login to localhost and create
> the directories.
>
> HTH

attached mail follows:


I'm still kind of a newbie at this, but couldn't you accomplish this by
doing each MKDIR separately with a series of ELSE/IF statements. The
basic logic would be:

Check if parent DIR exists.
        If not, create one and then go on....
        If yes:

        Check if Child DIR Exists
                If Not, Create one,
                if yes, go on....

Etc.

--
Kevin Murphy
Web Designer - Stubborn Donkey Productions
www.stubborndonkey.com

On Jun 6, 2004, at 11:08 AM, Gerben wrote:

> Unfortunately my server has no ftp (but SSH).
> It makes much sence what you said, but how can PHP (with uid=48) make a
> directory with uid=1042.
> both folder are (to be) made the same script, but only one is (with
> uid=1042).
>
> This is what makes it very peculiar.
> I think I have skip the idea of creating 2 nested folders.
>
> Thanks anyway
>
> "Marek Kilimajer" <listskilimajer.net> wrote in message
> news:40C355D8.4090803kilimajer.net...
>> Gerben wrote:
>>> Hello,
>>>
>>> I have a problem with the mkdir function.
>>> I'm trying to make a seperate folder every photoalbum. inside I want
>>> to
>>> create another folder ('.../thumbnails/') for, you can guess, the
>>> thumbnails.
>>>
>>> At first it didn't work at all:
>>>
>>>
>>>> Warning: mkdir() failed (Permission denied) in
>>>
>>> /home/virtual/site43/fst/var/www/html/beheer/albums/index.php on
>>> line 42
>>>
>>> When I changed the rights of the folder I wanted to create the new
> folder in
>>> to chmod 0777, the first MKDIR did work, but the second did not.
>>>
>>>
>>>> SAFE MODE Restriction in effect. The script whose uid is 1042 is not
>>>
>>> allowed to access
>>> /home/virtual/site43/fst/var/www/html/uploaded/images/albums/album_0
> owned
>>> by uid 48 in
> /home/virtual/site43/fst/var/www/html/beheer/albums/index.php
>>> on line 43
>>>
>>> this is very strange because the folders are both made in the same
> script.
>>> Another strange thing is that I user mkdir($dir, 0777), but when I
>>> look
> at
>>> the created folder it is 0755 and I can not change it.
>>>
>>> That's pritty much my problem. Your help would be very much
>>> appreciated.
>>>
>>
>> The first directory your script creates is owned by the uid apache
>> runs
>> under (48 in your case). Safe mode allows access only to files and
>> directories owned by the uid of the executing script (1042 in your
>> case).
>>
>> The workaround is to use ftp functions to create the directories.
>> Simply
>> use your ftp username and password to login to localhost and create
>> the directories.
>>
>> HTH
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Gerben wrote:
> Unfortunately my server has no ftp (but SSH).
> It makes much sence what you said, but how can PHP (with uid=48) make a
> directory with uid=1042.
> both folder are (to be) made the same script, but only one is (with
> uid=1042).
>
> This is what makes it very peculiar.
> I think I have skip the idea of creating 2 nested folders.
>

Ask your hosting company to install ftp server (and ftp support in php)
that is at least accessible from localhost. Otherwise you will have to
give up the idea of creating folders whatsoever as you will not be able
to copy images to those folders. Or change your host.

attached mail follows:


Trying to portupgrade my PHP 4.3.6 package with PostgreSQL 7.4.2 support and getting this error below. Trying to setup postgresql with Heimdal Kerberos 5 support, believe I have, but not tried anything with it, yet.

/usr/local/lib/libpq.so: undefined reference to `krb5_cc_get_principal'
/usr/local/lib/libpq.so: undefined reference to `krb5_sname_to_principal'
/usr/local/lib/libpq.so: undefined reference to `krb5_cc_default'
/usr/local/lib/libpq.so: undefined reference to `krb5_cc_close'
/usr/local/lib/libpq.so: undefined reference to `error_message'
/usr/local/lib/libpq.so: undefined reference to `krb5_free_error'
/usr/local/lib/libpq.so: undefined reference to `krb5_sendauth'
/usr/local/lib/libpq.so: undefined reference to `krb5_free_principal'
/usr/local/lib/libpq.so: undefined reference to `krb5_unparse_name'
/usr/local/lib/libpq.so: undefined reference to `krb5_free_context'
/usr/local/lib/libpq.so: undefined reference to `krb5_init_context'
*** Error code 1

Stop in /usr/ports/lang/php4/work/php-4.3.7.

I've posted this around a few weeks ago on some lists and still no success. I had a suggestion to add lines to the spec file, but not sure which file that is. Seems PHP is having a problem with the PGSQL support and its libraries for krb5. Nonetheless, from the looks of the Makefile for postgresql, everything should be there for it to build with krb5 support. I receive no errors when building or installing posgresql with heimdal support and have tried 'make deinstall' and 'make reinstall'. I have the WITH_HEIMDAL_KRB5, HEIMDAL_HOME is set to /usr/local where it resides with libs and includes. Someone also suggested adding a -lkrb5, but again, I have not been able to figure out where to place this setting in the file. Should I add it to the line that produces the error building PHP above (I think the libtool command) or in the postgresql Makefile.

esmtp# ldd /usr/local/bin/psql
/usr/local/bin/psql:
        libpq.so.3 => /usr/local/lib/libpq.so.3 (0x28096000)
        libkrb5.so.20 => /usr/local/lib/libkrb5.so.20 (0x280b2000)
...

Anyone know where I can make these changes needed or what to try next?

--
Robert

attached mail follows:


Robert Fitzpatrick wrote:
> Trying to portupgrade my PHP 4.3.6 package with PostgreSQL 7.4.2 support and getting this error below. Trying to setup postgresql with Heimdal Kerberos 5 support, believe I have, but not tried anything with it, yet.
>
> /usr/local/lib/libpq.so: undefined reference to `krb5_cc_get_principal'
> /usr/local/lib/libpq.so: undefined reference to `krb5_sname_to_principal'
> /usr/local/lib/libpq.so: undefined reference to `krb5_cc_default'
> /usr/local/lib/libpq.so: undefined reference to `krb5_cc_close'
> /usr/local/lib/libpq.so: undefined reference to `error_message'
> /usr/local/lib/libpq.so: undefined reference to `krb5_free_error'
> /usr/local/lib/libpq.so: undefined reference to `krb5_sendauth'
> /usr/local/lib/libpq.so: undefined reference to `krb5_free_principal'
> /usr/local/lib/libpq.so: undefined reference to `krb5_unparse_name'
> /usr/local/lib/libpq.so: undefined reference to `krb5_free_context'
> /usr/local/lib/libpq.so: undefined reference to `krb5_init_context'
> *** Error code 1
>
> Stop in /usr/ports/lang/php4/work/php-4.3.7.
>
> I've posted this around a few weeks ago on some lists and still no success. I had a suggestion to add lines to the spec file, but not sure which file that is. Seems PHP is having a problem with the PGSQL support and its libraries for krb5. Nonetheless, from the looks of the Makefile for postgresql, everything should be there for it to build with krb5 support. I receive no errors when building or installing posgresql with heimdal support and have tried 'make deinstall' and 'make reinstall'. I have the WITH_HEIMDAL_KRB5, HEIMDAL_HOME is set to /usr/local where it resides with libs and includes. Someone also suggested adding a -lkrb5, but again, I have not been able to figure out where to place this setting in the file. Should I add it to the line that produces the error building PHP above (I think the libtool command) or in the postgresql Makefile.
>

Add -lkrb5 to LDFLAGS variable in the Makefile.

And please don't crosspost

attached mail follows:


On Sun, 2004-06-06 at 16:49, Marek Kilimajer wrote:
> Robert Fitzpatrick wrote:
> > Trying to portupgrade my PHP 4.3.6 package with PostgreSQL 7.4.2 support and getting this error below. Trying to setup postgresql with Heimdal Kerberos 5 support, believe I have, but not tried anything with it, yet.
> >
> > /usr/local/lib/libpq.so: undefined reference to `krb5_cc_get_principal'
> > /usr/local/lib/libpq.so: undefined reference to `krb5_sname_to_principal'
> > /usr/local/lib/libpq.so: undefined reference to `krb5_cc_default'
> > /usr/local/lib/libpq.so: undefined reference to `krb5_cc_close'
> > /usr/local/lib/libpq.so: undefined reference to `error_message'
> > /usr/local/lib/libpq.so: undefined reference to `krb5_free_error'
> > /usr/local/lib/libpq.so: undefined reference to `krb5_sendauth'
> > /usr/local/lib/libpq.so: undefined reference to `krb5_free_principal'
> > /usr/local/lib/libpq.so: undefined reference to `krb5_unparse_name'
> > /usr/local/lib/libpq.so: undefined reference to `krb5_free_context'
> > /usr/local/lib/libpq.so: undefined reference to `krb5_init_context'
> > *** Error code 1
> >
> > Stop in /usr/ports/lang/php4/work/php-4.3.7.
> >
> > I've posted this around a few weeks ago on some lists and still no success. I had a suggestion to add lines to the spec file, but not sure which file that is. Seems PHP is having a problem with the PGSQL support and its libraries for krb5. Nonetheless, from the looks of the Makefile for postgresql, everything should be there for it to build with krb5 support. I receive no errors when building or installing posgresql with heimdal support and have tried 'make deinstall' and 'make reinstall'. I have the WITH_HEIMDAL_KRB5, HEIMDAL_HOME is set to /usr/local where it resides with libs and includes. Someone also suggested adding a -lkrb5, but again, I have not been able to figure out where to place this setting in the file. Should I add it to the line that produces the error building PHP above (I think the libtool command) or in the postgresql Makefile.
> >
>
> Add -lkrb5 to LDFLAGS variable in the Makefile.

Thanks, I tried and it doesn't seem to help. This is in the Makefile
now. I am trying this when building PostgreSQL, do the links shown in my
last post to psql show the libs are setup correctly after installation
of PostgreSQL? I have WITH_HEIMDAL_KRB5 set to 'yes' and
/usr/bin/krb5-config is a symlink to /usr/local/bin/krb5-config which
has the correct locations for libs and includes.

.if defined(WITH_HEIMDAL_KRB5)
KRB5CONF= /usr/bin/krb5-config
WITH_KRB5= yes
.endif

.include <bsd.port.pre.mk>
.if defined(WITH_KRB5)
CONFIGURE_ARGS+= --with-krb5="`${KRB5CONF} --prefix krb5`"
LDFLAGS+= `${KRB5CONF} --libs krb5`
CONFIGURE_ENV= LDFLAGS="${LDFLAGS}"
.endif

That should set things up, but if I add LDFLAGS+=`-lkrb5`, I get an
error.

>
> And please don't crosspost

Sorry, won't do.

--
Robert

attached mail follows:


Robert Fitzpatrick wrote:
> On Sun, 2004-06-06 at 16:49, Marek Kilimajer wrote:
>
>>Robert Fitzpatrick wrote:
>>
>>>Trying to portupgrade my PHP 4.3.6 package with PostgreSQL 7.4.2 support and getting this error below. Trying to setup postgresql with Heimdal Kerberos 5 support, believe I have, but not tried anything with it, yet.
>>>
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_cc_get_principal'
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_sname_to_principal'
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_cc_default'
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_cc_close'
>>>/usr/local/lib/libpq.so: undefined reference to `error_message'
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_free_error'
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_sendauth'
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_free_principal'
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_unparse_name'
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_free_context'
>>>/usr/local/lib/libpq.so: undefined reference to `krb5_init_context'
>>>*** Error code 1
>>>
>>>Stop in /usr/ports/lang/php4/work/php-4.3.7.
>>>
>>>I've posted this around a few weeks ago on some lists and still no success. I had a suggestion to add lines to the spec file, but not sure which file that is. Seems PHP is having a problem with the PGSQL support and its libraries for krb5. Nonetheless, from the looks of the Makefile for postgresql, everything should be there for it to build with krb5 support. I receive no errors when building or installing posgresql with heimdal support and have tried 'make deinstall' and 'make reinstall'. I have the WITH_HEIMDAL_KRB5, HEIMDAL_HOME is set to /usr/local where it resides with libs and includes. Someone also suggested adding a -lkrb5, but again, I have not been able to figure out where to place this setting in the file. Should I add it to the line that produces the error building PHP above (I think the libtool command) or in the postgresql Makefile.
>>>
>>
>>Add -lkrb5 to LDFLAGS variable in the Makefile.
>
>
> Thanks, I tried and it doesn't seem to help. This is in the Makefile
> now. I am trying this when building PostgreSQL, do the links shown in my
> last post to psql show the libs are setup correctly after installation
> of PostgreSQL? I have WITH_HEIMDAL_KRB5 set to 'yes' and
> /usr/bin/krb5-config is a symlink to /usr/local/bin/krb5-config which
> has the correct locations for libs and includes.
>
> .if defined(WITH_HEIMDAL_KRB5)
> KRB5CONF= /usr/bin/krb5-config
> WITH_KRB5= yes
> .endif
>
> .include <bsd.port.pre.mk>
> .if defined(WITH_KRB5)
> CONFIGURE_ARGS+= --with-krb5="`${KRB5CONF} --prefix krb5`"
> LDFLAGS+= `${KRB5CONF} --libs krb5`
> CONFIGURE_ENV= LDFLAGS="${LDFLAGS}"
> .endif
>
> That should set things up, but if I add LDFLAGS+=`-lkrb5`, I get an
> error.
>

Is /usr/local/lib in /etc/ld.so.conf file?

attached mail follows:


Hello there,

I'm looking for some code to split a website that is hosted on one server.

For example: I have the domain www.firstone.com and www.secondone.nl
They're both hosted at one provider. So far no problems. The ISP makes the
changes in the dns and when you type in the urls you'll arrive at the same
website's index.html

But, I want to create a separate entrance for the english part of the
website and a separate entrance for the dutch website.

I know there is some javascript to do this, but hey ! Who wants to use that
.... ?

Can anyone help me out with this one ?

Jos de Nijs

attached mail follows:


"Jos De Nijs" <jos.de.nijsf1help.org> wrote in message
news:20040606181903.74293.qmailpb1.pair.com...
> Hello there,
>
> I'm looking for some code to split a website that is hosted on one server.
>
> For example: I have the domain www.firstone.com and www.secondone.nl
> They're both hosted at one provider. So far no problems. The ISP makes the
> changes in the dns and when you type in the urls you'll arrive at the same
> website's index.html
>
> But, I want to create a separate entrance for the english part of the
> website and a separate entrance for the dutch website.
>
> I know there is some javascript to do this, but hey ! Who wants to use
that
> .... ?
>
> Can anyone help me out with this one ?

This was discussed earlier today in another thread. Go to the list archive
and look out for "Multiple URL Redirection":
http://marc.theaimsgroup.com/?l=php-general&r=1&b=200406&w=2

Regards,

Torsten Roehr

attached mail follows:


How would one cycle through and get all of the column names in a mysql
table?

say that i have...

id | title | name | description
1 | MR. | russ | age XX height XX
2 | MRS. | jan | age XX height XXX

and I want to print out the 4 column names...

how would one accomplish this?

Russ

attached mail follows:


Russell P Jones wrote:
> How would one cycle through and get all of the column names in a mysql
> table?
>
> say that i have...
>
> id | title | name | description
> 1 | MR. | russ | age XX height XX
> 2 | MRS. | jan | age XX height XXX
>
>
> and I want to print out the 4 column names...
>
> how would one accomplish this?
>
> Russ
>

This will get you started:
mysql_query('DESCRIBE table_name');

Please don't hijack threads.

attached mail follows:


Russell P Jones wrote:
> How would one cycle through and get all of the column names in a mysql
> table?
>
> say that i have...
>
> id | title | name | description
> 1 | MR. | russ | age XX height XX
> 2 | MRS. | jan | age XX height XXX
>
>
> and I want to print out the 4 column names...
>
> how would one accomplish this?

Either parse the results of a "DESC tablename" query or use the
mysql_list_fields() function.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


Curt Zirzow wrote:

> * Thus wrote K.Bogac Bokeer (bbokeeryahoo.com):
>
>>When $var is 0?
>>
>><?
>> $var = 0;
>
>
> or
> $var = '';
> $var = array();
> $var = false;
>
>
>> // Output: $var: $var not exists
>> if ( $var )
>> echo '$var: $var exists<br>';
>> else
>
>
>
>
> Curt

or null

--
paperCrane <Justin Patrin>

attached mail follows:


It depends on what you're running it on. Linux (which flavor), Unix
(which onw?), Mac OS X, Windows....

Nitin wrote:

> At last I've decided to upgrade it.
> Could you please tell me, which version is best candidate yet to upgrade to?
> And the procedure to upgrade with tar..
>
> Thanks in advance
>
>
> "Thomas Seifert" <thomas-listsmysnip.de> wrote in message
> news:20040605162649.5f32ce94.thomas-listsmysnip.de...
>
>>On Sat, 5 Jun 2004 19:31:34 +0530 nitinmehtakappa.net.in (Nitin) wrote:
>>
>>
>>>thanks for the help, but my PHP ver is 4.0.6...
>>>Any other suggestions??
>>>
>>
>>hmm, upgrade? :)
>>
>>really, its worth it!
>>
>>
>>thomas
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php

--
paperCrane <Justin Patrin>

attached mail follows:


mpublicoglobo.com wrote:

> Hi I have the following situation:
>
> I've got a domain that is hosted at a certain host. This host allows me
> to create subdomains, and also to add several domains to the same account.
> The thing is if I add a domain like xxx.com to my yyy.com both will be directed
> to my index.php page. I want to know if there is a way to recognize if the
> user typed to the url xxx.om or yyy.com and then send it to a certain folder.
> I thank any word of wisdom from you guys.
> Rodrigo

Or, if they'll do it, you can have your provider set up a virtualhost in
apache for each of the subdomains. That's really the best way to do
it... It seems strange to me that they would give you subdomains but not
  the ability to give them different content...

--
paperCrane <Justin Patrin>

attached mail follows:


--- Mike Mapsnac <mikerh9hotmail.com> wrote:
> I want to refresh page every 10 seconds, without clicking on
> "Refresh" button.

Use the Refresh header:

header('Refresh: 10; url=http://example.org/foo.php');

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

attached mail follows:


Using the code below, im getting a problem where it is printing out TWO
of each field value instead of one...

For example, a table like

id | name | age
----------------
1 | russ | 22
2 | jon | 23

would print out for the first row...

<tr><td>1</td><td>1</td><td>russ</td><td>russ</td><td>22</td><td>22</td>
</tr>

any ideas on whats going wrong? THanks in advance, and thanks to all
who helped out w/ my last question. answered it in a second!

--------------------------------------

$query = "SELECT * FROM volunteers";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){

echo '<tr>';

foreach($row as $key=>$value)

{ echo '<td><font size=-2 face=verdana>' . $value . '</font></td>';}

echo '</tr>';

}

attached mail follows:


rjonesemail.unc.edu wrote:

> Using the code below, im getting a problem where it is printing out TWO
> of each field value instead of one...
[snip]
> while($row = mysql_fetch_array($result)){

fetch_array returns an array where the indexes are numeric and where
they are the column names. So $row has four elements in it. You're
seeing exactly what should happen. Use fetch_row() or fetch_assoc()
instead.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


CC me please.

Does anyone know if ini_get returns the values BEFORE or AFTER the
.htaccess modifies them? i.e., does it return the server or local version?

attached mail follows:


Ah yes! Thanks, I see the problem; I have to switch the 8-byte chunks in
byte-order! (Why is Directconnect doing this...)
Thanks for your help. Greetings, Carl.

"Thijs Lensselink" <TLensselinkfactotummedia.nl> wrote in message
news:A306A04842B1D311BA280050DA699620F9E47Ent-vivenda.fm.local...
> check: http://www.cs.technion.ac.il/~biham/Reports/Tiger/testresults.html
> The results you posted seem to be right.
>
> Carl S. in 't Veld wrote on vrijdag 4 juni 2004 0:52:
>
> > I am trying to generate tiger tree hashes the same way as
> > directconnect does, but I am failing.
> >
> > I checked the output from php with the reference vectors from
> > http://www.cs.technion.ac.il/~biham...ssie-format.dat
> > and they appear to be different!
> >
> > echo bin2hex(mhash(MHASH_TIGER, 'abc'))."<br/>\n";
> > outputs
> > f258c1e88414ab2a527ab541ffc5b8bf935f7b951c132951
> > instead of
> > 2AAB1484E8C158F2BFB8C5FF41B57A525129131C957B5F93
> >
> > and, for example,
> > echo bin2hex(mhash(MHASH_TIGER, 'message digest'))."<br/>\n";
> > outputs
> > 951a2078cbf881d91c441e754830cf0df6295aa51aca7f51
> > instead of
> > D981F8CB78201A950DCF3048751E441C517FCA1AA55A29F6
> >
> > What am I doing wrong here?

attached mail follows:


Not sure if the subject was worded correctly, but
I was looking to see if this (or something like it) is possible.

$array = array('key_1' => 'This is some text',
                        'key_2' => '<b>' . $array['key_1'] . '</b>'
                      );

And the array structure would be something like ->
array('key_1' => 'This is some text',
         'key_2' => '<b>This is some text</b>')

Just wanted to see if it were possible, as my attempts were futile.
Its not a requirement on my end, just wanted to see if it were possible... :)

Thanks

attached mail follows:


Gerard Samuel wrote:
> Not sure if the subject was worded correctly, but
> I was looking to see if this (or something like it) is possible.
>
> $array = array('key_1' => 'This is some text',
> 'key_2' => '<b>' . $array['key_1'] . '</b>'
> );
>
> And the array structure would be something like ->
> array('key_1' => 'This is some text',
> 'key_2' => '<b>This is some text</b>')
>
> Just wanted to see if it were possible, as my attempts were futile.
> Its not a requirement on my end, just wanted to see if it were possible... :)
>
> Thanks
>

It is possible in 2 steps:

1. create the array:

$array = array('key_1' => 'This is some text');

2. Add the second key:

$array['key_2'] => '<b>' . $array['key_1'] . '</b>';

attached mail follows:


I could use one additional clarification regarding good practice.

As I understand the php manual the following is acceptable.

$foo= TRUE;

if($foo) do.............. ;

where $foo is a binary; but not a variable.

Use isset($var) for variables and be careful with $var= ' '; etc.
because $var is assigned, i.e., "set".

attached mail follows:


how about:

if (trim($foo) != '')

Respectfully,
Ligaya Turmelle

"Al" <newsridersite.org> wrote in message
news:20040606234452.31511.qmailpb1.pair.com...
> I could use one additional clarification regarding good practice.
>
> As I understand the php manual the following is acceptable.
>
> $foo= TRUE;
>
> if($foo) do.............. ;
>
> where $foo is a binary; but not a variable.
>
> Use isset($var) for variables and be careful with $var= ' '; etc.
> because $var is assigned, i.e., "set".

attached mail follows:


PHP 4.3.6
Image Magick 5.5.7
imagick 0.9.10
OS: Mac OS X (10.3.4)

   I'm trying to install imagick so that I can use ImageMagick functions
in PHP. I was using GD, but I need to load images from TIFF and write
thumbnails in jpeg with added text. I had it all working with jpegs,
but got stumped on reading in full sized TIFF images with GD.

   I've been using PHP 4.3.6 for a while and have successfully worked
with GD and installed a module for openbase support. I'm totally
stumped with imagick however. It seems I just can't get PHP to
recognize that the imagick module is installed.
   The installation instructions include:

1) make sure the path to Magick-config (the ImageMagick configuration
    script) is in your PATH environment variable
2) cd /usr/src/php/ext
3) untar the imagick tar
4) if the directory created is anything other then imagick, rename it to
    imagick
5) cd /usr/src/php/ext/imagick
6) phpize
7) cd /usr/src/php
8) rm ./configure
9) ./buildconf
10) run configure as you normally would and add --with-imagick
     If Imagemagick is installed in a non standard dir, add this dir to
--with-im
agick=dir
     If you want GraphicsMagick instead of ImageMagick as backend, add
--with-ima
gick-gm
11) make
12) make install

   When I go thru these steps, phpinfo shows no reference to imagick.
Yes, I used --with-imagick and tried --with-imagick=<dir> as well.
   I've noticed when I rebuild the configure file, there is no reference
in it for imagick. Conversely, there ARE references for my openbase
module, so I am assuming the problem is in the module installation
itself (i.e. telling php that the module exists). Is that the job of
phpize?

   Any help would be appreciated.

Robert

p.s. During the install process I never got errors, but did get a few
warnings that look like they are just complaining about doing things
the "old way":

./buildconf --force
Forcing buildconf
using default Zend directory
buildconf: checking installation...
buildconf: autoconf version 2.57 (ok)
buildconf: Your version of autoconf likely contains buggy cache code.
            Running cvsclean for you.
            To avoid this, install autoconf-2.13 and automake-1.5.
buildconf: libtool version 1.5 (ok)
rebuilding configure
rebuilding main/php_config.h.in
WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
WARNING: and `config.h.top', to define templates for `config.h.in'
WARNING: is deprecated and discouraged.

WARNING: Using the third argument of `AC_DEFINE' and
WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
WARNING: `acconfig.h':

WARNING: AC_DEFINE([NEED_MAIN], 1,
WARNING: [Define if a function `main' is needed.])

WARNING: More sophisticated templates can also be produced, see the
WARNING: documentation.

---------------------------------
Robert Duran
robertagathonvm.com
---------------------------------

attached mail follows:


Hey, I hope I'm not stating the obvious, but last time I used
ImageMagick (5.5.7 - in my receipts folder, I just checked) for use
with PHP under Mac OS X, I just downloaded a package from
http://entropy.ch/ and installed it and life was good. I think it's
still up for download. No messing with tar or anything else - just
simple, straightforward GUI installation.

Also, fink ( http://fink.sf.net/ ) can install ImageMagick for you.
Personally, unless you have special needs, I would say to go for the
.pkg installed from entropy.ch, but whatever works for you.

As far as the specific process you're working on, if you really want
_that_ installation, somebody else will have to tell you how to make it
work. I don't know the specific process off hand.

-Galen

On Jun 6, 2004, at 5:03 PM, Robert Duran wrote:

> PHP 4.3.6
> Image Magick 5.5.7
> imagick 0.9.10
> OS: Mac OS X (10.3.4)
>
> I'm trying to install imagick so that I can use ImageMagick
> functions in PHP. I was using GD, but I need to load images from TIFF
> and write thumbnails in jpeg with added text. I had it all working
> with jpegs, but got stumped on reading in full sized TIFF images with
> GD.
>
> I've been using PHP 4.3.6 for a while and have successfully worked
> with GD and installed a module for openbase support. I'm totally
> stumped with imagick however. It seems I just can't get PHP to
> recognize that the imagick module is installed.
> The installation instructions include:
>
> 1) make sure the path to Magick-config (the ImageMagick configuration
> script) is in your PATH environment variable
> 2) cd /usr/src/php/ext
> 3) untar the imagick tar
> 4) if the directory created is anything other then imagick, rename it
> to
> imagick
> 5) cd /usr/src/php/ext/imagick
> 6) phpize
> 7) cd /usr/src/php
> 8) rm ./configure
> 9) ./buildconf
> 10) run configure as you normally would and add --with-imagick
> If Imagemagick is installed in a non standard dir, add this dir to
> --with-im
> agick=dir
> If you want GraphicsMagick instead of ImageMagick as backend, add
> --with-ima
> gick-gm
> 11) make
> 12) make install
>
> When I go thru these steps, phpinfo shows no reference to imagick.
> Yes, I used --with-imagick and tried --with-imagick=<dir> as well.
> I've noticed when I rebuild the configure file, there is no
> reference in it for imagick. Conversely, there ARE references for my
> openbase module, so I am assuming the problem is in the module
> installation itself (i.e. telling php that the module exists). Is
> that the job of phpize?
>
> Any help would be appreciated.
>
> Robert
>
> p.s. During the install process I never got errors, but did get a few
> warnings that look like they are just complaining about doing things
> the "old way":
>
> ./buildconf --force
> Forcing buildconf
> using default Zend directory
> buildconf: checking installation...
> buildconf: autoconf version 2.57 (ok)
> buildconf: Your version of autoconf likely contains buggy cache code.
> Running cvsclean for you.
> To avoid this, install autoconf-2.13 and automake-1.5.
> buildconf: libtool version 1.5 (ok)
> rebuilding configure
> rebuilding main/php_config.h.in
> WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
> WARNING: and `config.h.top', to define templates for `config.h.in'
> WARNING: is deprecated and discouraged.
>
> WARNING: Using the third argument of `AC_DEFINE' and
> WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
> WARNING: `acconfig.h':
>
> WARNING: AC_DEFINE([NEED_MAIN], 1,
> WARNING: [Define if a function `main' is needed.])
>
> WARNING: More sophisticated templates can also be produced, see the
> WARNING: documentation.
>
> ---------------------------------
> Robert Duran
> robertagathonvm.com
> ---------------------------------

attached mail follows:


Hello everyone!

I'm trying to call a class method dynamically, but keep getting a SYNTAX
ERROR. Can anyone shed some light on this? Is this impossible?

==The Code

function &modCall($_class){
  $this->LoadClass($_class); //LoadClass includes the class file, but
                               //does not initialize it.

  //if the class has the method, then call it.

  if(in_array('sayHello',get_class_methods($_class)){

           $_class::sayHello();

           // this line reports a syntax error with $_class::sayHello()
           // but (assuming the value of $_class was 'myClass')
           // myClass::sayHello() works!

  }

    //I've also tried the following:
    // ${_class)::sayHello();
    // {$_class}::sayHello();
    // $_class.'::sayHello()';

}

Any suggestions!

=P e p i e D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.