|
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 28 Sep 2006 20:30:56 -0000 Issue 4373
php-general-digest-help
lists.php.net
Date: Thu Sep 28 2006 - 15:30:56 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 28 Sep 2006 20:30:56 -0000 Issue 4373
Topics (messages 242342 through 242377):
How do i check if a variable is a reference or a copy?
242342 by: Mathijs
242344 by: Dave Goodchild
242367 by: Richard Lynch
242375 by: Martin Alterisio
Convert UTF-8 to windows-874?
242343 by: Peter Lauri
242346 by: Peter Lauri
242349 by: Peter Lauri
242358 by: Richard Lynch
242368 by: Peter Lauri
Re: Wallet based shopping cart
242345 by: Ryan A
242362 by: Richard Lynch
Re: strange errors from command line vs. web
242347 by: blackwater dev
242348 by: Ivo F.A.C. Fokkema
242359 by: blackwater dev
242365 by: Richard Lynch
242366 by: Travis Doherty
242373 by: blackwater dev
Re: I can see my php code in browser? [SOLVED]
242350 by: afan.afan.net
mysql_real_escape_string() question
242351 by: tedd
242353 by: Ivo F.A.C. Fokkema
242354 by: Eric Butera
242357 by: Richard Lynch
242372 by: tedd
242374 by: tedd
recv() socket question
242352 by: Jeff Lanzarotta
242355 by: Richard Lynch
242356 by: Jeff Lanzarotta
Re: IEEE Software Special Issue on Rapid Application Development with Dynamically Typed Languages
242360 by: Laurence Tratt
Re: Custom Session Handler
242361 by: Richard Lynch
Re: Logical OR in assignment
242363 by: Richard Lynch
Re: Best open source project/framework to support a php training course?
242364 by: Richard Lynch
problem with email characters
242369 by: Ross
242370 by: Ross
242371 by: Manuel Lemos
Changing values in .htaccess
242376 by: Martin Marques
242377 by: Curt Zirzow
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:
Hello there,
Is there a way to check if a variable is passed by reference or if it is
just a copy. With something like is_copy or is_reference?
Thx in advance.
attached mail follows:
Why do you want to do that? To check whether a variable is passed by
reference or value look at the function prototype. If you clarify the
reasons why you want to do that it would help.
>
>
>
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
attached mail follows:
On Thu, September 28, 2006 5:03 am, Mathijs wrote:
> Is there a way to check if a variable is passed by reference or if it
> is
> just a copy. With something like is_copy or is_reference?
If your code doesn't already "know" which it is, you've screwed up
somewhere.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
2006/9/28, Mathijs <m.v.veluw
smscity.nl>:
>
> Hello there,
>
> Is there a way to check if a variable is passed by reference or if it is
> just a copy. With something like is_copy or is_reference?
>
> Thx in advance.
>
Is this part of the "I don't know if two vars reference the same object in
PHP4" dilemma?
attached mail follows:
Hi group,
I am having a site all encoded in UTF-8, and it works fine. I use AJAX a lot
to send data back and forth to the server.
I have one service that requires that I send the data in windows-874
encoding (SMS gateway in Thailand). So is there anyway I can take the data
that is UTF-8 and then convert it to windows-874 and then send it to the SMS
gateway?
Best regards,
Peter Lauri
www.lauri.se <http://www.lauri.se/> - personal web site
www.dwsasia.com <http://www.dwsasia.com/> - company web site
attached mail follows:
I think I am on the right track right now.
There is a function mb_convert_encoding() that could be used. However, I
have not found out how to code windows-874?
Warning: mb_convert_encoding(): Unknown encoding "ISO-8859-11" in
D:\webserver\viphavadee\sms\classes\sms.class.php on line 17
Was one of my attempts...
Anyone with a hint of how to work out this problem?
/Peter
-----Original Message-----
From: Peter Lauri [mailto:lists
dwsasia.com]
Sent: Thursday, September 28, 2006 5:10 PM
To: 'PHP General'
Subject: [PHP] Convert UTF-8 to windows-874?
Hi group,
I am having a site all encoded in UTF-8, and it works fine. I use AJAX a lot
to send data back and forth to the server.
I have one service that requires that I send the data in windows-874
encoding (SMS gateway in Thailand). So is there anyway I can take the data
that is UTF-8 and then convert it to windows-874 and then send it to the SMS
gateway?
Best regards,
Peter Lauri
www.lauri.se <http://www.lauri.se/> - personal web site
www.dwsasia.com <http://www.dwsasia.com/> - company web site
attached mail follows:
Hi,
I was on the right track. However, the mbstring does not seam to support
windows-874 (ISO-8859-11).
What is the next step I could take? One not the good is to convert the whole
system to Windows-874 and use that, but that is not so fun. Please help me
:)
Best regards,
Peter Lauri
-----Original Message-----
From: Peter Lauri [mailto:lists
dwsasia.com]
Sent: Thursday, September 28, 2006 7:16 PM
To: 'Peter Lauri'; 'PHP General'
Subject: RE: [PHP] Convert UTF-8 to windows-874?
I think I am on the right track right now.
There is a function mb_convert_encoding() that could be used. However, I
have not found out how to code windows-874?
Warning: mb_convert_encoding(): Unknown encoding "ISO-8859-11" in
D:\webserver\viphavadee\sms\classes\sms.class.php on line 17
Was one of my attempts...
Anyone with a hint of how to work out this problem?
/Peter
-----Original Message-----
From: Peter Lauri [mailto:lists
dwsasia.com]
Sent: Thursday, September 28, 2006 5:10 PM
To: 'PHP General'
Subject: [PHP] Convert UTF-8 to windows-874?
Hi group,
I am having a site all encoded in UTF-8, and it works fine. I use AJAX a lot
to send data back and forth to the server.
I have one service that requires that I send the data in windows-874
encoding (SMS gateway in Thailand). So is there anyway I can take the data
that is UTF-8 and then convert it to windows-874 and then send it to the SMS
gateway?
Best regards,
Peter Lauri
www.lauri.se <http://www.lauri.se/> - personal web site
www.dwsasia.com <http://www.dwsasia.com/> - company web site
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I think that the iconv function/package may have what you are looking
for...
This is just a parrot of previous answers to similar questions.
I have no personal knowledge...
You could also contact the Thai folks and find out if there is
anything "close enough" to Windows-874 to use.
From my limited understanding, sometimes the difference between 2
encodings is sooooooo minor that you're only screwing up a couple
characters, and only a linguist cares. :-v
I also suspect that MS, in typical fashion, may have "stolen" (no!) a
character encoding, renamed it windows-874, and it's really really the
same thing as an OSS encoding of another name.
On Thu, September 28, 2006 7:16 am, Peter Lauri wrote:
> I think I am on the right track right now.
>
> There is a function mb_convert_encoding() that could be used. However,
> I
> have not found out how to code windows-874?
>
> Warning: mb_convert_encoding(): Unknown encoding "ISO-8859-11" in
> D:\webserver\viphavadee\sms\classes\sms.class.php on line 17
>
> Was one of my attempts...
>
> Anyone with a hint of how to work out this problem?
>
> /Peter
>
>
> -----Original Message-----
> From: Peter Lauri [mailto:lists
dwsasia.com]
> Sent: Thursday, September 28, 2006 5:10 PM
> To: 'PHP General'
> Subject: [PHP] Convert UTF-8 to windows-874?
>
> Hi group,
>
>
>
> I am having a site all encoded in UTF-8, and it works fine. I use AJAX
> a lot
> to send data back and forth to the server.
>
>
>
> I have one service that requires that I send the data in windows-874
> encoding (SMS gateway in Thailand). So is there anyway I can take the
> data
> that is UTF-8 and then convert it to windows-874 and then send it to
> the SMS
> gateway?
>
>
>
> Best regards,
>
> Peter Lauri
>
>
>
> www.lauri.se <http://www.lauri.se/> - personal web site
>
> www.dwsasia.com <http://www.dwsasia.com/> - company web site
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Iconv did it for me, a great thanks!!!
/Peter
-----Original Message-----
From: Richard Lynch [mailto:ceo
l-i-e.com]
Sent: Thursday, September 28, 2006 11:12 PM
To: Peter Lauri
Cc: 'PHP General'
Subject: RE: [PHP] Convert UTF-8 to windows-874?
I think that the iconv function/package may have what you are looking
for...
This is just a parrot of previous answers to similar questions.
I have no personal knowledge...
You could also contact the Thai folks and find out if there is
anything "close enough" to Windows-874 to use.
From my limited understanding, sometimes the difference between 2
encodings is sooooooo minor that you're only screwing up a couple
characters, and only a linguist cares. :-v
I also suspect that MS, in typical fashion, may have "stolen" (no!) a
character encoding, renamed it windows-874, and it's really really the
same thing as an OSS encoding of another name.
On Thu, September 28, 2006 7:16 am, Peter Lauri wrote:
> I think I am on the right track right now.
>
> There is a function mb_convert_encoding() that could be used. However,
> I
> have not found out how to code windows-874?
>
> Warning: mb_convert_encoding(): Unknown encoding "ISO-8859-11" in
> D:\webserver\viphavadee\sms\classes\sms.class.php on line 17
>
> Was one of my attempts...
>
> Anyone with a hint of how to work out this problem?
>
> /Peter
>
>
> -----Original Message-----
> From: Peter Lauri [mailto:lists
dwsasia.com]
> Sent: Thursday, September 28, 2006 5:10 PM
> To: 'PHP General'
> Subject: [PHP] Convert UTF-8 to windows-874?
>
> Hi group,
>
>
>
> I am having a site all encoded in UTF-8, and it works fine. I use AJAX
> a lot
> to send data back and forth to the server.
>
>
>
> I have one service that requires that I send the data in windows-874
> encoding (SMS gateway in Thailand). So is there anyway I can take the
> data
> that is UTF-8 and then convert it to windows-874 and then send it to
> the SMS
> gateway?
>
>
>
> Best regards,
>
> Peter Lauri
>
>
>
> www.lauri.se <http://www.lauri.se/> - personal web site
>
> www.dwsasia.com <http://www.dwsasia.com/> - company web site
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi,
I am looking for a shopping cart/member script that will allow members of a
site to purchase credits and then spend their credits on my site. I have
trawled for hours but can't seem to find one anywhere. :-$
Anyone got any ideas???????
Frustrated and wanting to move forward!!
Hey!
I have not heard of such a script, sounds kind of specialized, guessing you would have to make this mate... shouldnt be _very_ hard to do thought.
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
---------------------------------
Get your email and more, right on the new Yahoo.com
attached mail follows:
On Thu, September 28, 2006 1:41 am, wizard007 wrote:
> I am looking for a shopping cart/member script that will allow members
> of a
> site to purchase credits and then spend their credits on my site. I
> have
> trawled for hours but can't seem to find one anywhere. :-$
> Anyone got any ideas???????
>
> Frustrated and wanting to move forward!!
You may want to try Googling for "PHP micropayments" and "PHP
microeconomy" and similar words. I think that's what it's called...
It's also entirely possible that the Merchant Account agreements
specifically prohibit this kind of economic model, as it puts a great
deal of the Security in your hands, instead of theirs, but,
ultimately, their exposure to Risk is even higher than yours. So the
answer might be "You can't do that" :-(
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Ok, I've set up a username and password using Grant All Privileges, blah.
with username and password. For some reason though the web now can't login
with that. I then changed the root db password and put that in the config
and the web side does run properly with that username, password. I still
can't run the script from the command line even when I su to root. I am in
a virtual hosting situation so not sure if that's it. Does it not know what
to do with localhost in a virtual hosting situation when running it from the
command line but does from the web? I'm trying to print the error but it
just seems to die:
echo "about to connect";
$this->connectionID=
mysql_connect($this->host, $this->user,
$this->password);
echo "after connect";
From the command line, it never prints the after connect...just seems to die
without error...or at least no error to the screen and I do have a check
right after to kick off the mysql error if there is no connection ID but
again, I am su'ing to root so I thought it would always have rights. Not
really sure what to do next.
Thanks!
On 9/27/06, Richard Lynch <ceo
l-i-e.com> wrote:
>
> On Wed, September 27, 2006 11:36 am, blackwater dev wrote:
> > I have some code that makes a connection to the db. When I run this
> > code
> > from the command line, it stops at the db connection.
>
> Show us the code, without any embedded passwords, of course...
>
>
> > If I call the
> > script
> > from the browser, it works fine.
>
> This almost always boils down to:
> PHP runs as "nobody" or a similarly unpowered user
> You log in as you, blackwaterdev or whatever, with many powers.
>
> In this case, it looks like 'nobody' has their own database, and is
> allowed to connect to it, but you are not.
>
> > I've changed the permissions and
> > that
> > didn't work.
>
> Changed which permissions?
>
> mysql_admin?
> If so, did you reload the permissions after change?
>
> File executable?
>
> What?
>
> > The db connection is the basic, localhost, root, with no
> > password.
>
> Now that is an entirely separate problem.
>
> DON'T DO THAT!
>
> :-)
>
> > What else can I try?
>
> You're going to have to create a user and set a password anyway, so do
> that first.
>
> There's no point in getting localhost/root/[blank] to work when it's
> not what you want anyway.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>
>
attached mail follows:
Hi,
(sorry for top-posting)
This is the great way PHP-cli lets you know it hasn't got any MySQL
support :)
Enable that, and you're good to go. Mind you, PHP-cli has a separate
php.ini file.
Ivo
On Thu, 28 Sep 2006 08:26:13 -0400, blackwater dev wrote:
> Ok, I've set up a username and password using Grant All Privileges, blah.
> with username and password. For some reason though the web now can't login
> with that. I then changed the root db password and put that in the config
> and the web side does run properly with that username, password. I still
> can't run the script from the command line even when I su to root. I am in
> a virtual hosting situation so not sure if that's it. Does it not know what
> to do with localhost in a virtual hosting situation when running it from the
> command line but does from the web? I'm trying to print the error but it
> just seems to die:
>
> echo "about to connect";
> $this->connectionID=
mysql_connect($this->host, $this->user,
> $this->password);
> echo "after connect";
>
> From the command line, it never prints the after connect...just seems to die
> without error...or at least no error to the screen and I do have a check
> right after to kick off the mysql error if there is no connection ID but
> again, I am su'ing to root so I thought it would always have rights. Not
> really sure what to do next.
>
> Thanks!
>
> On 9/27/06, Richard Lynch <ceo
l-i-e.com> wrote:
>>
>> On Wed, September 27, 2006 11:36 am, blackwater dev wrote:
>> > I have some code that makes a connection to the db. When I run this
>> > code
>> > from the command line, it stops at the db connection.
>>
>> Show us the code, without any embedded passwords, of course...
>>
>>
>> > If I call the
>> > script
>> > from the browser, it works fine.
>>
>> This almost always boils down to:
>> PHP runs as "nobody" or a similarly unpowered user
>> You log in as you, blackwaterdev or whatever, with many powers.
>>
>> In this case, it looks like 'nobody' has their own database, and is
>> allowed to connect to it, but you are not.
>>
>> > I've changed the permissions and
>> > that
>> > didn't work.
>>
>> Changed which permissions?
>>
>> mysql_admin?
>> If so, did you reload the permissions after change?
>>
>> File executable?
>>
>> What?
>>
>> > The db connection is the basic, localhost, root, with no
>> > password.
>>
>> Now that is an entirely separate problem.
>>
>> DON'T DO THAT!
>>
>> :-)
>>
>> > What else can I try?
>>
>> You're going to have to create a user and set a password anyway, so do
>> that first.
>>
>> There's no point in getting localhost/root/[blank] to work when it's
>> not what you want anyway.
>>
>> --
>> Like Music?
>> http://l-i-e.com/artists.htm
>>
>>
>>
attached mail follows:
Ok, dumb question but how do I do that? I know how to re-compile the
standard php. My code also uses mssql via freetds, does that somehow need
to be enabled as it doesn't seem to fail there.
Thanks!
On 9/28/06, Ivo F.A.C. Fokkema <I.F.A.C.Fokkema
lumc.nl> wrote:
>
> Hi,
>
> (sorry for top-posting)
>
> This is the great way PHP-cli lets you know it hasn't got any MySQL
> support :)
>
> Enable that, and you're good to go. Mind you, PHP-cli has a separate
> php.ini file.
>
> Ivo
>
>
>
> On Thu, 28 Sep 2006 08:26:13 -0400, blackwater dev wrote:
> > Ok, I've set up a username and password using Grant All Privileges,
> blah.
> > with username and password. For some reason though the web now can't
> login
> > with that. I then changed the root db password and put that in the
> config
> > and the web side does run properly with that username, password. I
> still
> > can't run the script from the command line even when I su to root. I am
> in
> > a virtual hosting situation so not sure if that's it. Does it not know
> what
> > to do with localhost in a virtual hosting situation when running it from
> the
> > command line but does from the web? I'm trying to print the error but
> it
> > just seems to die:
> >
> > echo "about to connect";
> > $this->connectionID=
mysql_connect($this->host, $this->user,
> > $this->password);
> > echo "after connect";
> >
> > From the command line, it never prints the after connect...just seems to
> die
> > without error...or at least no error to the screen and I do have a check
> > right after to kick off the mysql error if there is no connection ID but
> > again, I am su'ing to root so I thought it would always have
> rights. Not
> > really sure what to do next.
> >
> > Thanks!
> >
> > On 9/27/06, Richard Lynch <ceo
l-i-e.com> wrote:
> >>
> >> On Wed, September 27, 2006 11:36 am, blackwater dev wrote:
> >> > I have some code that makes a connection to the db. When I run this
> >> > code
> >> > from the command line, it stops at the db connection.
> >>
> >> Show us the code, without any embedded passwords, of course...
> >>
> >>
> >> > If I call the
> >> > script
> >> > from the browser, it works fine.
> >>
> >> This almost always boils down to:
> >> PHP runs as "nobody" or a similarly unpowered user
> >> You log in as you, blackwaterdev or whatever, with many powers.
> >>
> >> In this case, it looks like 'nobody' has their own database, and is
> >> allowed to connect to it, but you are not.
> >>
> >> > I've changed the permissions and
> >> > that
> >> > didn't work.
> >>
> >> Changed which permissions?
> >>
> >> mysql_admin?
> >> If so, did you reload the permissions after change?
> >>
> >> File executable?
> >>
> >> What?
> >>
> >> > The db connection is the basic, localhost, root, with no
> >> > password.
> >>
> >> Now that is an entirely separate problem.
> >>
> >> DON'T DO THAT!
> >>
> >> :-)
> >>
> >> > What else can I try?
> >>
> >> You're going to have to create a user and set a password anyway, so do
> >> that first.
> >>
> >> There's no point in getting localhost/root/[blank] to work when it's
> >> not what you want anyway.
> >>
> >> --
> >> Like Music?
> >> http://l-i-e.com/artists.htm
> >>
> >>
> >>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Thu, September 28, 2006 7:26 am, blackwater dev wrote:
> Ok, I've set up a username and password using Grant All Privileges,
> blah.
> with username and password. For some reason though the web now can't
> login
> with that. I then changed the root db password and put that in the
> config
> and the web side does run properly with that username, password. I
> still
> can't run the script from the command line even when I su to root.
su root or not does *nothing* to help you run MySQL and do database
things.
MySQL has a user called 'root' but it's not in any way, shape, or form
related to the OS 'root'.
Well, okay, the *idea* is the same, and the *name* is the same... But
that's it!
The *only* thing that matters to MySQL is the username/password used
to connect, and what permissions have been granted in MySQL to that
username/password.
> echo "about to connect";
> $this->connectionID=
mysql_connect($this->host, $this->user,
> $this->password);
> echo "after connect";
Get rid of the
, at least until you figure out what is going on.
> again, I am su'ing to root so I thought it would always have rights.
Don't bother su-ing to root. It has no effect on MySQL whatsoever.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
blackwater dev wrote:
> Ok, dumb question but how do I do that? I know how to re-compile the
> standard php. My code also uses mssql via freetds, does that somehow
> need
> to be enabled as it doesn't seem to fail there.
>
> Thanks!
>
>> >
>> > echo "about to connect";
>> > $this->connectionID=
mysql_connect($this->host, $this->user,
>> > $this->password);
>> > echo "after connect";
>> >
>
Just to verify that this is in fact the problem you should remove the
'
' sign from mysql_connect. '
' is a way of supressing errors, you
specifically WANT that error. Is there a reason you have the '
' there?
If the error is 'Undefined function mysql_connect' then you do need to
get MySQL support compiled in... If it is available on the apache
module it should be available to the CLI as well.
If there is no 'undefined function' error then you should also be
calling 'echo mysql_error()' to see what the error is after connecting.
That error is going to give you more info than any of us can.
Travis
attached mail follows:
Yep, I get called to undefined function so I need to somehow re-compile the
cli version? How do I give support to just the cli version? I'm going to
the docs now.
Thanks!
On 9/28/06, Travis Doherty <travis
referable.com> wrote:
>
> blackwater dev wrote:
>
> > Ok, dumb question but how do I do that? I know how to re-compile the
> > standard php. My code also uses mssql via freetds, does that somehow
> > need
> > to be enabled as it doesn't seem to fail there.
> >
> > Thanks!
> >
> >> >
> >> > echo "about to connect";
> >> > $this->connectionID=
mysql_connect($this->host, $this->user,
> >> > $this->password);
> >> > echo "after connect";
> >> >
> >
> Just to verify that this is in fact the problem you should remove the
> '
' sign from mysql_connect. '
' is a way of supressing errors, you
> specifically WANT that error. Is there a reason you have the '
' there?
>
> If the error is 'Undefined function mysql_connect' then you do need to
> get MySQL support compiled in... If it is available on the apache
> module it should be available to the CLI as well.
>
> If there is no 'undefined function' error then you should also be
> calling 'echo mysql_error()' to see what the error is after connecting.
> That error is going to give you more info than any of us can.
>
> Travis
>
attached mail follows:
> You need a line like one of the following in your Apache http.conf file:
>
> LoadModule php4_module /usr/local/php/phpWeb/.libs/libphp4.so
> #LoadModule php5_module /usr/local/php/phpWeb/.libs/libphp5.so
>
This line I didn't need since module was alreadi loaded...
> You also need to register in your http.conf what file extensions cause
> the content to be processed by PHP. This is done via the following line
> (you may not want all of them for your system):
>
> AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml .html .htm
>
... and this was the "mmissing" part. I thought YAST will do everything :(
Yup. It works now. Thanks Rob!
Thanks to everybody else for help.
-afan
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi gang:
In one of my snip-its, namely:
http://xn--ovg.com/pdf
I was generating a pdf document after the user filled in a form. I
had been cleaning the user input by using --
$name = mysql_real_escape_string($name);
-- even though I wasn't using MySQL (the code was a cut-paste from
some other code I had).
However, everything worked!
But, a couple of days ago it suddenly stopped working. Now, I get the
following error:
Warning: mysql_real_escape_string(): Access denied for user
'nobody'
'localhost' (using password: NO) in ...
When I comment-out the offending statement, it runs. I replaced the
statement, but wonder what happened -- when did using
mysql_real_escape_string() require a password?
What's up with that? Any ideas as to what happened?
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
On Thu, 28 Sep 2006 11:06:45 -0400, tedd wrote:
> Hi gang:
>
> In one of my snip-its, namely:
>
> http://xn--ovg.com/pdf
>
> I was generating a pdf document after the user filled in a form. I
> had been cleaning the user input by using --
>
> $name = mysql_real_escape_string($name);
>
> -- even though I wasn't using MySQL (the code was a cut-paste from
> some other code I had).
>
> However, everything worked!
>
> But, a couple of days ago it suddenly stopped working. Now, I get the
> following error:
>
> Warning: mysql_real_escape_string(): Access denied for user
> 'nobody'
'localhost' (using password: NO) in ...
>
> When I comment-out the offending statement, it runs. I replaced the
> statement, but wonder what happened -- when did using
> mysql_real_escape_string() require a password?
>
> What's up with that? Any ideas as to what happened?
>
> tedd
Hi Tedd,
According to
http://nl3.php.net/mysql_real_escape_string
The function requires a MySQL connection. If there is none, it
will try and create one. That fails now. Possibly you could use addslashes()?
Regards,
Ivo
attached mail follows:
On 9/28/06, Ivo F.A.C. Fokkema <I.F.A.C.Fokkema
lumc.nl> wrote:
>
> Hi Tedd,
>
> According to
> http://nl3.php.net/mysql_real_escape_string
>
> The function requires a MySQL connection. If there is none, it
> will try and create one. That fails now. Possibly you could use addslashes()?
>
> Regards,
>
> Ivo
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Don't use addslashes. Keep using mysql_real_escape string but make
sure you have a valid link identifier like Ivo said.
string mysql_real_escape_string ( string unescaped_string [, resource
link_identifier] )
attached mail follows:
On Thu, September 28, 2006 10:06 am, tedd wrote:
> In one of my snip-its, namely:
>
> http://xn--ovg.com/pdf
>
> I was generating a pdf document after the user filled in a form. I
> had been cleaning the user input by using --
>
> $name = mysql_real_escape_string($name);
>
> -- even though I wasn't using MySQL (the code was a cut-paste from
> some other code I had).
But you *WERE* using MySQL!
> However, everything worked!
>
> But, a couple of days ago it suddenly stopped working. Now, I get the
> following error:
>
> Warning: mysql_real_escape_string(): Access denied for user
> 'nobody'
'localhost' (using password: NO) in ...
One of two things happened.
Some auto-connect script is no longer running, or the 'nobody' user in
MySQL got nuked.
Cuz you used to be connected to MySQL, and it was using MySQL database
information to do the escaping.
> When I comment-out the offending statement, it runs. I replaced the
> statement, but wonder what happened -- when did using
> mysql_real_escape_string() require a password?
mysql_real_escape_string talks back to MySQL to ask it what character
encoding you are using, so it knows how to correctly escape
multi-byte/unicode/funky characters for MySQL usage.
Take out the "_real" bit, and it's doing a "fake" version that ignores
multibyte/unicode/funky characters.
So, short term, just delete '_real' from your function call, and it
will act exactly like before, except with the caveat that any
unicode/multibyte/funky characters may not be escaped the same way as
they were.
> What's up with that? Any ideas as to what happened?
One also has to ask WHY you would use MySQL's escaping for data that's
not going into MySQL.
That's almost certainly "wrong"
Though I confess, I'm sometimes at a loss how to properly escape
certain data for certain situations...
Here's an example:
Take the Subject of an email.
Sure, I've sanitized it to be sure there are no newlines for header
injection.
But now how do I properly escape it to be sure it's a kosher email
subject?
Where's the PHP function smtp_escape()?
I'm just passing it on from one user to another. I don't want to
munge it, nor make any assumptions about its format. It's just "data"
to me.
But to SMTP, there are bound to be all kinds of "rules" about it that
I have no desire, much less time, to research, code, and test in as
thorough a fashion as I should to be Professional.
And every developer who sends an email with PHP needs this, right?
So of the myriad PHP functions available, which one is the right one
to escape an email Subject.
I'm *NOT* asking for an answer to this specific question about email
Subjects!
I'm looking for a guide, a chart, a grid, an organized systemic
documentation of what data should be escaped how as it travels through
the "glue" that is PHP...
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
At 11:06 AM -0500 9/28/06, Richard Lynch wrote:
> > What's up with that? Any ideas as to what happened?
>
>One also has to ask WHY you would use MySQL's escaping for data that's
>not going into MySQL.
>
>That's almost certainly "wrong"
Richard:
Yes, according to:
http://us3.php.net/mysql_real_escape_string
The use of the statement looks for a MySQL connection and if there
isn't one, it tries to connect and thus producing the error I got
when it failed.
The answer to "WHY" I did it is that I cut/pasted the code from
another script. I was only concerned with cleaning the input and not
with using MySQL -- it was just one statement in several to scrub
various inputs.
However, I would have thought that if the code was going to fail, it
would have done so immediately. But it instead, it ran for weeks
without failure until just a few days ago. I checked the script
almost daily to see if it ran.
While it seems very unlikely to me, I must have also tested code that
opened a MySQL connection before testing that script. Strange
circumstances.
Thanks for the clarification.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
At 11:06 AM -0500 9/28/06, Richard Lynch wrote:
>Though I confess, I'm sometimes at a loss how to properly escape
>certain data for certain situations...
>
>Here's an example:
>Take the Subject of an email.
>
>Sure, I've sanitized it to be sure there are no newlines for header
>injection.
>
>But now how do I properly escape it to be sure it's a kosher email
>subject?
>
>Where's the PHP function smtp_escape()?
>
>I'm just passing it on from one user to another. I don't want to
>munge it, nor make any assumptions about its format. It's just "data"
>to me.
>
>But to SMTP, there are bound to be all kinds of "rules" about it that
>I have no desire, much less time, to research, code, and test in as
>thorough a fashion as I should to be Professional.
>
>And every developer who sends an email with PHP needs this, right?
>
>So of the myriad PHP functions available, which one is the right one
>to escape an email Subject.
>
>I'm *NOT* asking for an answer to this specific question about email
>Subjects!
>
>I'm looking for a guide, a chart, a grid, an organized systemic
>documentation of what data should be escaped how as it travels through
>the "glue" that is PHP...
Richard:
I realize that you are not asking for an answer, but for a guide --
however -- isn't the real problem here simply one of injection? Just
stop the user from injecting stuff in the subject and that would fix
it right? Or, am I underestimating the problem?
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
Hello,
I am writing a web page that contains some php code the will
send/receive a message from a java application running on our server.
The php code successfully sends a message to the server but will not,
as far as I know, receive the message back. The only way I know this is
that I attempt to echo out the message that is received and nothing
prints...
I am very new to php so I am using 'class.ClientSocket.php' written by
Juan M. Hidalgo to do all the communications...
What is odd is that I receive no errors either from either side.
Any ideas would be greatly appreciated.
-Jeff
-Jeff
attached mail follows:
On Thu, September 28, 2006 10:14 am, Jeff Lanzarotta wrote:
> I am writing a web page that contains some php code the will
> send/receive a message from a java application running on our server.
>
> The php code successfully sends a message to the server but will not,
> as far as I know, receive the message back. The only way I know this
> is
> that I attempt to echo out the message that is received and nothing
> prints...
>
> I am very new to php so I am using 'class.ClientSocket.php' written by
> Juan M. Hidalgo to do all the communications...
>
> What is odd is that I receive no errors either from either side.
>
> Any ideas would be greatly appreciated.
You could try contacting Juan and/or the Java guy who wrote the code...
You should also start reading class.ClientSocket.php and figuring out
how it works and adding debugging statements to see what's going on.
Ye Olde 'echo "got here\n";' is often the best answer in this situation.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
OK, I will try and contact Juan. I wrote the Java server. I believe the
Java side is working because I can send/receive messages just fine
using other clients written in other languages, just not the php
client...
Regards,
-Jeff
--- Richard Lynch <ceo
l-i-e.com> wrote:
> On Thu, September 28, 2006 10:14 am, Jeff Lanzarotta wrote:
> > I am writing a web page that contains some php code the will
> > send/receive a message from a java application running on our
> server.
> >
> > The php code successfully sends a message to the server but will
> not,
> > as far as I know, receive the message back. The only way I know
> this
> > is
> > that I attempt to echo out the message that is received and nothing
> > prints...
> >
> > I am very new to php so I am using 'class.ClientSocket.php' written
> by
> > Juan M. Hidalgo to do all the communications...
> >
> > What is odd is that I receive no errors either from either side.
> >
> > Any ideas would be greatly appreciated.
>
> You could try contacting Juan and/or the Java guy who wrote the
> code...
>
> You should also start reading class.ClientSocket.php and figuring out
> how it works and adding debugging statements to see what's going on.
>
> Ye Olde 'echo "got here\n";' is often the best answer in this
> situation.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
============================================================================
IEEE Software Special Issue
Rapid Application Development with Dynamically Typed Languages
Call for Papers
Publication: September/October 2007
Submission Deadline: 1 February 2007
============================================================================
Dynamically typed programming languages were once seen as slow, unreliable,
and suitable only for small throw-away tasks. However, their ability to aid
rapid systems development and to facilitate the pervasive, mobile, and
frequently updated systems that are increasingly in demand in the modern
world has led to their stock rising considerably.
While developers are ever keen to find out more about the details of dynamic
programming languages, managers are interested in finding out how they can
complement existing approved languages without diluting their organizations'
technical focus.
We thus solicit contributions in several areas related to dynamic
programming languages. Topics of interest include:
* Dynamic programming languages "in use".
* Organizations' experiences in integrating dynamic programming languages
into their existing language menagerie.
* Experiences of and techniques for using dynamic programming languages
effectively (including efficiency and scalability concerns).
* How dynamic programming languages have evolved and how they might
develop in the future.
* New techniques in challenging areas such as metaprogramming, reflection,
dynamic reconfigurability, and mobility.
For detailed author guidelines, please visit:
http://www.computer.org/software/author.htm
Manuscripts must not exceed 5,400 words including figures and tables, which
count for 200 words each. Submissions in excess of these limits may be
rejected without refereeing. The articles we deem within the theme's scope
will be peer-reviewed and are subject to editing for magazine style,
clarity, organization, and space.
For more information, please contact the Guest Editors Laurence Tratt and
Roel Wuyts at dyn
tratt.net.
attached mail follows:
On Thu, September 28, 2006 1:46 am, Glenn Richmond wrote:
> I couldn't find a developers list, so I hope this is the right list to
If you get no answer here, php-internals is a potential source, for a
quick reference to the right part of the source where that bit of code
lives.
Also try finding it for yourself in the source, or http://lxr.php.net
Good Luck -- It would certainly be very cool to have this extension
OpenSourced and added to PECL. Hint, hint.
Note that OpenSourcing it and adding it to PECL might get another
developer interested in fixing your current problem, too, so it's a
win for you.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Wed, September 27, 2006 10:05 pm, Larry Garfield wrote:
> The single pipe | is bitwise OR, yes. You're probably thinking of
> this
> construct:
>
> a = b || c
>
> Which is a valid and common default-value idiom in Python and
> Javascript, but
> I don't think works in PHP. (If it does, someone please correct me
> because
> I'd like to use it. <g>)
Check the operator precedence, as you might need $a = ($b || $c); but
there's nothing to stop you from using it if it make sense in context.
These basic operators are quite clearly documented in the manual...
Hint, hint.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Wed, September 27, 2006 8:47 pm, Ligaya A. Turmelle wrote:
> You should also make sure to go over security in one of your classes -
Might I suggest instead that *EVERY* lesson have a Security focus for
a few minutes on whatever issues are relevant to whatever is being
discussed -- and if you can't think of anything relevant to the
lesson, a general review of Security or a Security Tip unrelated is
never a Bad Idea.
If I was lucky enough to have somebody hire me to teach PHP, that
would be my approach.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Is there a function that sorts out all the dodgy characters in an email...
e.g.
? An update on Scottish Social Networks Forum ? A summary of the conference
"Social Networks - Evidence and Potential" ? Information on two
organisations playing their part in supporting positive social networks -
Counselling & Psychotherapy in Scotland and Neighbourhood Networks ?
I can use stripslashes(string); to remove the backslashes but what about the
blocks. I assume they are spaces.
Ross
attached mail follows:
Actually I think it is a carriage return!
Ross
""Ross"" <ross
aztechost.com> wrote in message
news:58.DF.21168.8C50C154
pb1.pair.com...
> Is there a function that sorts out all the dodgy characters in an email...
>
> e.g.
>
>
> ? An update on Scottish Social Networks Forum ? A summary of the
> conference "Social Networks - Evidence and Potential" ? Information on two
> organisations playing their part in supporting positive social networks -
> Counselling & Psychotherapy in Scotland and Neighbourhood Networks ?
>
>
> I can use stripslashes(string); to remove the backslashes but what about
> the blocks. I assume they are spaces.
>
>
> Ross
attached mail follows:
Hello,
on 09/28/2006 02:27 PM Ross said the following:
> Is there a function that sorts out all the dodgy characters in an email...
>
> e.g.
>
>
> ? An update on Scottish Social Networks Forum ? A summary of the conference
> "Social Networks - Evidence and Potential" ? Information on two
> organisations playing their part in supporting positive social networks -
> Counselling & Psychotherapy in Scotland and Neighbourhood Networks ?
>
>
> I can use stripslashes(string); to remove the backslashes but what about the
> blocks. I assume they are spaces.
There are no dodgy characters for e-mail. What you may need is to encode
those characters to send them by e-mail. You may need to use
quoted-printable for bodies and q-encoding for headers.
If you are not sure how to do that, you may want to try this MIME
message composing and sending class that takes care of that for you:
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
I'm trying helplessly to get session.use_trans_sid to true in one
directory that needs it. So I put this in an .htaccess file:
php_value session.use_trans_sid 1
The thing is, it didn't work. I also tried changing 1 to On with no luck
at all.
Ideas are welcome.
--
21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18
---------------------------------------------------------
Lic. Martín Marqués | SELECT 'mmarques' ||
Centro de Telemática | '
' || 'unl.edu.ar';
Universidad Nacional | DBA, Programador,
del Litoral | Administrador
---------------------------------------------------------
attached mail follows:
On 9/28/06, Martin Marques <martin
bugs.unl.edu.ar> wrote:
> I'm trying helplessly to get session.use_trans_sid to true in one
> directory that needs it. So I put this in an .htaccess file:
>
> php_value session.use_trans_sid 1
>
> The thing is, it didn't work. I also tried changing 1 to On with no luck
> at all.
Is .htaccess enabled at all? by default apache doesn't have it
enabled in most installations.
If you can, set this on a per directory setting in your virtualhost
setting within a <Directory> or <Location>, instead of turning on
.htaccess.
Curt
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]