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 19 Jul 2005 01:40:57 -0000 Issue 3575

php-general-digest-helplists.php.net
Date: Mon Jul 18 2005 - 20:40:57 CDT


php-general Digest 19 Jul 2005 01:40:57 -0000 Issue 3575

Topics (messages 218865 through 218931):

Re: jpgs into database
        218865 by: Matthew Weier O'Phinney
        218881 by: George B
        218882 by: glumtail
        218884 by: Tyler Kiley

Session has new id on 'some' pages.
        218866 by: Andy Pieters
        218869 by: Andy Pieters
        218870 by: Marek Kilimajer
        218872 by: Edward Vermillion

Data and variable transfer
        218867 by: Jon

Re: Need help with PHP / MySQL connect problem
        218868 by: Rick Emery
        218871 by: Linda H
        218873 by: eoghan
        218874 by: Mark Rees

PHP from CLI with SAPI
        218875 by: Fredrik Tolf
        218901 by: Catalin Trifu
        218905 by: Mikey
        218914 by: Evert | Rooftop
        218916 by: glumtail
        218919 by: Fredrik Tolf
        218922 by: Fredrik Tolf
        218927 by: Rasmus Lerdorf

sytax errors
        218876 by: babu
        218879 by: John Nichel

Date function and MySQL
        218877 by: Philip Thompson

Re: SOLVED! Need help with PHP / MySQL connect problem
        218878 by: Linda H

libCURL help
        218880 by: Jon
        218917 by: Catalin Trifu

change letter to all caps
        218883 by: George B
        218885 by: Jay Blanchard
        218886 by: webmaster.elaconta.com
        218887 by: John Nichel
        218888 by: eoghan
        218899 by: Matthew Weier O'Phinney

syntax error, unexpected T_STRING
        218889 by: George B
        218890 by: Jim Moseby
        218891 by: John Nichel
        218892 by: George B
        218893 by: George B
        218898 by: Matthew Weier O'Phinney
        218900 by: Jim Moseby
        218915 by: Jochem Maas

show a field in php file
        218894 by: George B
        218895 by: John Nichel
        218896 by: Jay Blanchard
        218897 by: vid.phpcult.com
        218918 by: Jochem Maas
        218928 by: George B

Tracking a mobile phone
        218902 by: Thomas
        218903 by: Ethilien
        218907 by: Andy Pieters
        218909 by: George B
        218910 by: Mikey
        218912 by: Sebastian
        218913 by: Evert | Rooftop

Include path quirks
        218904 by: Ethilien
        218911 by: Ethilien
        218920 by: Edward Vermillion
        218921 by: Jochem Maas

Re: Missing or wrong reply-to headers in this mailing list
        218906 by: Stephen Allen
        218924 by: Tyler Kiley

Re: Tracking a mobile phone... PHP related?
        218908 by: tg-php.gryffyndevelopment.com

Char encoding using fget or curl
        218923 by: Marcelo Volmaro
        218925 by: Jochem Maas
        218926 by: Marcelo Volmaro
        218929 by: Ligaya Turmelle

Is there a way to get a variable name as a string?
        218930 by: Daevid Vincent
        218931 by: Ryan A

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:


* Jasper Bryant-Greene <jasperbryant-greene.name> :
> George B wrote:
> > is it possible to put in a jpg file into a database? I am trying to make
> > like a catalong and have all the files (including pics) and everyone can
> > see.
> > is this possible?
>
> Sure -- if you're using a MySQL database, just use a BLOB field and put
> the data in as you would a string of text.

Be aware of your storage requirements, however. There are several BLOB
types -- TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB -- so make certain you
choose the one that exceeds the maximum file size you expect to place in
the DB.

Additionally, there are performance hits to storing images in a
database. Another approach that is widely used is to store the images on
the filesystem, and then image *details* -- location, size, caption,
photographer, etc. -- in the database. This is typically faster, and
will reduce the number of DB calls.

--
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

attached mail follows:


Matthew Weier O'Phinney wrote:
> * Jasper Bryant-Greene <jasperbryant-greene.name> :
>
>>George B wrote:
>>
>>>is it possible to put in a jpg file into a database? I am trying to make
>>>like a catalong and have all the files (including pics) and everyone can
>>>see.
>>>is this possible?
>>
>>Sure -- if you're using a MySQL database, just use a BLOB field and put
>>the data in as you would a string of text.
>
>
> Be aware of your storage requirements, however. There are several BLOB
> types -- TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB -- so make certain you
> choose the one that exceeds the maximum file size you expect to place in
> the DB.
>
> Additionally, there are performance hits to storing images in a
> database. Another approach that is widely used is to store the images on
> the filesystem, and then image *details* -- location, size, caption,
> photographer, etc. -- in the database. This is typically faster, and
> will reduce the number of DB calls.
>
yeah that probably is a better idea :)

attached mail follows:


I heard that Microsoft.com <http://Microsoft.com> stores every images in
database.
Maybe the cost is the most important thing.
 2005/7/19, George B <geoizilgmail.com>:
>
> Matthew Weier O'Phinney wrote:
> > * Jasper Bryant-Greene <jasperbryant-greene.name> :
> >
> >>George B wrote:
> >>
> >>>is it possible to put in a jpg file into a database? I am trying to
> make
> >>>like a catalong and have all the files (including pics) and everyone
> can
> >>>see.
> >>>is this possible?
> >>
> >>Sure -- if you're using a MySQL database, just use a BLOB field and put
> >>the data in as you would a string of text.
> >
> >
> > Be aware of your storage requirements, however. There are several BLOB
> > types -- TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB -- so make certain you
> > choose the one that exceeds the maximum file size you expect to place in
> > the DB.
> >
> > Additionally, there are performance hits to storing images in a
> > database. Another approach that is widely used is to store the images on
> > the filesystem, and then image *details* -- location, size, caption,
> > photographer, etc. -- in the database. This is typically faster, and
> > will reduce the number of DB calls.
> >
> yeah that probably is a better idea :)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I've always liked storing all data in the DB to keep things simple, so
I stored images in the DB and then cache them on the filesystem when
they're first requested. Granted, it's pretty inefficient with disk
space, but if you have a good ORM db lib and caching lib, it's
extremely convenient.

attached mail follows:


Hi all

We have a extensive software that uses php session to store some very basic
session information.

ALL, and I do mean ALL files (except for globals.php) start like this:

<?php
  require_once "../scripts/globals.php";
...
?>

And the file globals.php starts with
<?php
session_start();

We have hit a bug that we do not understand. On our test servers (php 4.3.11,
php 4.3.10, and php 4.2.0) everything works as intended. Putting someting in
the session variables is remembered on every other page.

We actually deployed the product on a php 4.3.8 server and there we get the
complaint that session data is only remembered on 'some' pages. After
verification, it seems that on the pages that do not reproduce the session
data, a second session is used.

page 1: session id L43403470384, session data: OK
click link to page 2: session id DG5475232780, session data: null
click link back to page 1: session id L43403470384, session data: OK
click link to page 3: session id DG5475232780, session data: null
click link to page 4: session id L43403470384, session data: OK

Has anyone seen this behaviour before, or has any clues what is the problem?

With kind regards

Andy

--
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-) W+++>+++$ !N o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+) !tv b-() DI(+) D+(+++) G(+)
e>++++$ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQBC26/12GLGPJ3Q07wRAp/jAJ4oCte25yij5YE1kENvyMaPQ02TnwCgqueR
nYyu3kPLxo2PGPco3vB7hZc=
=say4
-----END PGP SIGNATURE-----

attached mail follows:


Ok found the solution, seems like one page is on http://server.org.uk and the
other on www.server.org.uk even though its the same server it generates a
different session id!

--
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-) W+++>+++$ !N o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+) !tv b-() DI(+) D+(+++) G(+)
e>++++$ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQBC28C02GLGPJ3Q07wRAhZgAJ4hT8rFybWQWfMuqPVscEthWWeA+QCgiKpe
qRo/B+wbvKyOTtsrCBV7bJo=
=2Azb
-----END PGP SIGNATURE-----

attached mail follows:


Andy Pieters wrote:
> Ok found the solution, seems like one page is on http://server.org.uk and the
> other on www.server.org.uk even though its the same server it generates a
> different session id!
>

set the domain of the cookie to 'server.org.uk', it's the fifth
parameter of setcookie()

attached mail follows:


Andy Pieters wrote:
> Ok found the solution, seems like one page is on http://server.org.uk and the
> other on www.server.org.uk even though its the same server it generates a
> different session id!
>

That's a cookie thing, if your transmitting the session ids through
cookies, I'm going to assume that trans sid will do the same thing. The
deal is that when you go to server.org it's not going to have access to
a cookie set on www.server.org. I've had this happen to me too. I set a
variable like

$http_root = 'http://www.myserver.com/'

and then the links I generate have

$link = $http_root."newpage.php"

If the site is accessed at http://myserver.com then the links don't get
the right cookie.

the best thing to do is to set

$http_root = 'http://'.$_SERVER['SERVER_NAME']

,or whatever you have available in $_SERVER, then the links are all set
correctly. Or you can use relative paths like

$link = "index.php"

and the right cookie will be set/read.

attached mail follows:


OK this may not be the correct place to ask but maybe someone can help.

Related to the Post URL ?

How do I see the information passed from my browser to a site? I have
httpLiveHeaders for mozilla and that does not provide all the info that I
need. Or I am not getting something right.

I have been trying to use libCURL on some pages and seem to be having a heck
of a time doing so. I think what the problem is that a page posts and is
thin passed to JavaScript and .jsp that handles the rest of the pageload
sequence. I get an 500 error code every time.

When using a browser on the site when you click on the submit link it
populates a JavaScript and submits the post but I don't know how to handle
that in libCURL. I can make the post structure but the page is posting to
itself and thus the JavaScript is handling the data.

Is there some way that I can see what the rest of the page is doing aside
from the headers? I have tried several packet snuffers but while they can
get the traffic I have no idea how to decrypt the information to read it.
It is an HTTPS site and I can get the cookie information and such but I
don't know where to put it in the filters to make the info decrypt. Any
help on this matter would be appreciated.

attached mail follows:


Quoting Linda H <l199bellsouth.net>:

> I added the following to the top of my script:
>
> <?php
> echo phpinfo();
> ?>
>
> Got all sorts of environment and path info.

In addition to the other excellent suggestions so far, make sure
(looking at the phpinfo page, under "Configuration File Path") that
your install is using the php.ini file you think it is. I got bit by
this (I kept editing the php.ini file in one directory, but it was
reading the file from another).

It really does sound like error reporting is turned off.

hth,
Rick

--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
with your eyes turned skyward, for there you have been, and there
you will always long to return"
                                              -- Leonardo Da Vinci

attached mail follows:


For those who didn't join this thread at the beginning, I'm running MySQL
4.0.21, Apache 2.0.52 and PHP 5.0.2 on a Windows XP system.

I installed in the sequence - MySQL, then Apache, then PHP. MySQL was
running when the others were installed (which is what the book I am using
seemed to indicate). Apache was not running when PHP was installed.

>What does php.ini have for this line
>display_errors = On

Now we are getting somewhere. Even though error_reporting was set to E_ALL,
display_errors was Off. I set it On and now I'm getting an error.

Fatal error: Call to undefined function mysql_connect() in C:\Program
Files\Apache Group\Apache2\htdocs\example\test_connect.php on line 15

the phpinfo() display doesn't reference MySQL at all. It does reference
SQLite with the following info:

SQLite supportenabled:
PECL Module version 2.0-dev $Id: sqlite.c,v 1.146.2.2 2004/08/02 22:43:42
iliaa Exp $
SQLite Library: 2.8.14
SQLite Encoding: iso8859

Directive: sqlite_assoc_case, Local Value: 0, Master Value: 0

So it looks like MySQL didn't get configured with PHP.

In the PHP FAQ on database issues, I found the following:

"
4. PHP 5 no longer bundles MySQL client libraries, what does this mean to
me? Can I still use MySQL with PHP? I try to use MySQL and get "function
undefined" errors, what gives?

Yes. There will always be MySQL support in PHP of one kind or another. The
only change in PHP 5 is that we are no longer bundling the client library
itself. Some reasons in no particular order:
    * Most systems these days already have the client library installed.
    * Given the above, having multiple versions of the library can get
messy. For example, if you link mod_auth_mysql against one version and PHP
against another, and then enable both in Apache, you get a nice fat crash.
Also, the bundled library didn't always play well with the installed server
version. The most obvious symptom of this being disagreement over where to
find the mysql.socket Unix domain socket file.
    * Maintenance was somewhat lax and it was falling further and further
behind the released version.
    * Future versions of the library are under the GPL and thus we don't
have an upgrade path since we cannot bundle a GPL'ed library in a
BSD/Apache-style licensed project. A clean break in PHP 5 seemed like the
best option.

This won't actually affect that many people. Unix users, at least the ones
who know what they are doing, tend to always build PHP against their
system's libmyqlclient library simply by adding the --with-mysql=/usr
option when building PHP. Windows users may enable the extension
php_mysql.dll inside php.ini. Also, be sure libmysql.dll is available to
the systems PATH. For more details on how, read the FAQ on
<http://www.php.net/manual/en/faq.installation.php#faq.installation.addtopath>setting
up the Windows systems PATH. Because libmysql.dll (and many other PHP
related files) exist in the PHP folder, you'll want to add the PHP folder
to your systems PATH."

I added my PHP folder (C:\php5\) to my system path and restarted
(libmysql.ddl is in php5). Still get the error. I enabled the extension
php_mysql.dll in php.ini and Apache startup says it can't find it
(php_mysql.dll is in C:\php5\ext).

So, should I move php_mysql.dll to c:\php5, change the system path, or
what? And what about php.ini showing sqlite instead of MySQL? Do I need to
get the MySQL client libraries (what are they called and where do I put
them - I already have some mysql dll's in the PHP libraries.

Linda

attached mail follows:


Hi

Linda H wrote:
> For those who didn't join this thread at the beginning, I'm running
> MySQL 4.0.21, Apache 2.0.52 and PHP 5.0.2 on a Windows XP system.
>
> I installed in the sequence - MySQL, then Apache, then PHP. MySQL was
> running when the others were installed (which is what the book I am
> using seemed to indicate). Apache was not running when PHP was installed.
>
>> What does php.ini have for this line
>> display_errors = On
>
>
> Now we are getting somewhere. Even though error_reporting was set to
> E_ALL, display_errors was Off. I set it On and now I'm getting an error.
>
> Fatal error: Call to undefined function mysql_connect() in C:\Program
> Files\Apache Group\Apache2\htdocs\example\test_connect.php on line 15
>

do you have this in your php.ini extensions?
extension=php_mysql.dll
Make sure you extension path is referencing its location also so it can
find it...
for example:
extension_dir = "c:/php/ext/"

attached mail follows:


"Linda H" <l199bellsouth.net> wrote in message
news:6.2.0.14.2.20050718100506.032942f8mail.bellsouth.net...
> For those who didn't join this thread at the beginning, I'm running MySQL
> 4.0.21, Apache 2.0.52 and PHP 5.0.2 on a Windows XP system.
>
> I installed in the sequence - MySQL, then Apache, then PHP. MySQL was
> running when the others were installed (which is what the book I am using
> seemed to indicate). Apache was not running when PHP was installed.
>
> >What does php.ini have for this line
> >display_errors = On
>
> Now we are getting somewhere. Even though error_reporting was set to
E_ALL,
> display_errors was Off. I set it On and now I'm getting an error.
>
> Fatal error: Call to undefined function mysql_connect() in C:\Program
> Files\Apache Group\Apache2\htdocs\example\test_connect.php on line 15
>
> the phpinfo() display doesn't reference MySQL at all. It does reference
> SQLite with the following info:
>
> SQLite supportenabled:
> PECL Module version 2.0-dev $Id: sqlite.c,v 1.146.2.2 2004/08/02 22:43:42
> iliaa Exp $
> SQLite Library: 2.8.14
> SQLite Encoding: iso8859
>
> Directive: sqlite_assoc_case, Local Value: 0, Master Value: 0
>
> So it looks like MySQL didn't get configured with PHP.
>
> In the PHP FAQ on database issues, I found the following:
>
> "
> 4. PHP 5 no longer bundles MySQL client libraries, what does this mean to
> me? Can I still use MySQL with PHP? I try to use MySQL and get "function
> undefined" errors, what gives?
>
> Yes. There will always be MySQL support in PHP of one kind or another. The
> only change in PHP 5 is that we are no longer bundling the client library
> itself. Some reasons in no particular order:
> * Most systems these days already have the client library installed.
> * Given the above, having multiple versions of the library can get
> messy. For example, if you link mod_auth_mysql against one version and PHP
> against another, and then enable both in Apache, you get a nice fat crash.
> Also, the bundled library didn't always play well with the installed
server
> version. The most obvious symptom of this being disagreement over where to
> find the mysql.socket Unix domain socket file.
> * Maintenance was somewhat lax and it was falling further and further
> behind the released version.
> * Future versions of the library are under the GPL and thus we don't
> have an upgrade path since we cannot bundle a GPL'ed library in a
> BSD/Apache-style licensed project. A clean break in PHP 5 seemed like the
> best option.
>
> This won't actually affect that many people. Unix users, at least the ones
> who know what they are doing, tend to always build PHP against their
> system's libmyqlclient library simply by adding the --with-mysql=/usr
> option when building PHP. Windows users may enable the extension
> php_mysql.dll inside php.ini. Also, be sure libmysql.dll is available to
> the systems PATH. For more details on how, read the FAQ on
>
<http://www.php.net/manual/en/faq.installation.php#faq.installation.addtopat
h>setting
> up the Windows systems PATH. Because libmysql.dll (and many other PHP
> related files) exist in the PHP folder, you'll want to add the PHP folder
> to your systems PATH."
>
> I added my PHP folder (C:\php5\) to my system path and restarted
> (libmysql.ddl is in php5). Still get the error. I enabled the extension
> php_mysql.dll in php.ini and Apache startup says it can't find it
> (php_mysql.dll is in C:\php5\ext).

Make sure this is set as follows in php.ini, then restart apache

extension_dir = "c:\php\ext"

>
> So, should I move php_mysql.dll to c:\php5, change the system path, or
> what? And what about php.ini showing sqlite instead of MySQL? Do I need to
> get the MySQL client libraries (what are they called and where do I put
> them - I already have some mysql dll's in the PHP libraries.
>
> Linda

attached mail follows:


Hi!

I've begun to be more and more displeased with Apache lately, so I've
been thinking of writing my own HTTP server instead. I still want PHP
support, but writing a new SAPI for PHP seems like overkill.

Therefore, is it possible to use PHP from the command line, but still
enable some HTTP-server-only stuff, like GET and POST variables,
cookies, session management, file uploads, and so on? I haven't been
able to find any docs on doing that, but I'm thinking that it should be
possible.

So, can someone either point me to some docs in this, or, lacking such,
give me a short intro to it?

Thanks for reading!

Fredrik Tolf

attached mail follows:


        Hi,

   Why are you displeased with apache ? After all, the 60% share market
of apache must mean something :)

Catalin

Fredrik Tolf wrote:
> Hi!
>
> I've begun to be more and more displeased with Apache lately, so I've
> been thinking of writing my own HTTP server instead. I still want PHP
> support, but writing a new SAPI for PHP seems like overkill.
>
> Therefore, is it possible to use PHP from the command line, but still
> enable some HTTP-server-only stuff, like GET and POST variables,
> cookies, session management, file uploads, and so on? I haven't been
> able to find any docs on doing that, but I'm thinking that it should be
> possible.
>
> So, can someone either point me to some docs in this, or, lacking such,
> give me a short intro to it?
>
> Thanks for reading!
>
> Fredrik Tolf

attached mail follows:


Catalin Trifu wrote:

> Hi,
>
> Why are you displeased with apache ? After all, the 60% share market
>of apache must mean something :)
>
>Catalin
>
>
>Fredrik Tolf wrote:
>
>
>>Hi!
>>
>>I've begun to be more and more displeased with Apache lately, so I've
>>been thinking of writing my own HTTP server instead. I still want PHP
>>support, but writing a new SAPI for PHP seems like overkill.
>>
>>Therefore, is it possible to use PHP from the command line, but still
>>enable some HTTP-server-only stuff, like GET and POST variables,
>>cookies, session management, file uploads, and so on? I haven't been
>>able to find any docs on doing that, but I'm thinking that it should be
>>possible.
>>
>>So, can someone either point me to some docs in this, or, lacking such,
>>give me a short intro to it?
>>
>>Thanks for reading!
>>
>>Fredrik Tolf
>>
>>
>
>
>
All of the features you mentioned are those provided for you by Apache,
barring the session management. If you really want to write your own
http server then maybe take a look at the Apache source code. It will
either give you some good pointers or make you realise what a huge task
you are undertaking...

Mikey

attached mail follows:


Fredrik Tolf wrote:

>Hi!
>
>I've begun to be more and more displeased with Apache lately, so I've
>been thinking of writing my own HTTP server instead. I still want PHP
>support, but writing a new SAPI for PHP seems like overkill.
>
>Therefore, is it possible to use PHP from the command line, but still
>enable some HTTP-server-only stuff, like GET and POST variables,
>cookies, session management, file uploads, and so on? I haven't been
>able to find any docs on doing that, but I'm thinking that it should be
>possible.
>
>So, can someone either point me to some docs in this, or, lacking such,
>give me a short intro to it?
>
>Thanks for reading!
>
>Fredrik Tolf
>
>
Hi Fredrick,

I wonder too why you are displeased with apache =) to me (and I know
many others in this group) it is the best webserver around.
If you would want to do it (and not use php as a library [SAPI-style] )
you shouldn't look in to CLI, but into CGI.
Using CGI you can lauch a php process every time a script is called.
Many years ago they discovered this isn't the best way to handle this.
To launch a process every time a script is called takes too much time
and resources.
So they invented the FASTCGI interface, which allows php processes to
remain persistant in the memory. You would probably (depending on your
demands) want to have a bunch of php processes forked in the memory.

If it's an experment, I would say go for it. If you want to use it
commercially or at least in a live enviroment I would strongly
discourage you to do it.

In any case, if you want it to be fast, you want to do it 'SAPI-style'..

Enjoy!

Evert

attached mail follows:


just write an PHP-Server

attached mail follows:


On Mon, 2005-07-18 at 15:57 -0400, Evert | Rooftop wrote:
> Fredrik Tolf wrote:
> >I've begun to be more and more displeased with Apache lately, so I've
> >been thinking of writing my own HTTP server instead. I still want PHP
> >support, but writing a new SAPI for PHP seems like overkill.
> >
> >Therefore, is it possible to use PHP from the command line, but still
> >enable some HTTP-server-only stuff, like GET and POST variables,
> >cookies, session management, file uploads, and so on? I haven't been
> >able to find any docs on doing that, but I'm thinking that it should be
> >possible.
> >
> >So, can someone either point me to some docs in this, or, lacking such,
> >give me a short intro to it?
> >
> Hi Fredrick,

Hi!

> I wonder too why you are displeased with apache =) to me (and I know
> many others in this group) it is the best webserver around.

One of the problems for me with Apache is that it's too complex. To
begin with, it contains a million feature that I'll never use, but which
does bring up resource consumption.

It also contains a lot of high-performance stuff which impedes
flexibility, such as not being able to keep file descriptors to instead
be able to load-balance requests between workers and servers.

Almost foremost, however, I'm looking to build a server with far better
support for multi-user operation. While Apache with UserDir and suexec
does some things good, it cannot, for example, running PHP applications
as different users. I know there is a worker module for apache that can
run different vhosts as different users, but that's just vhosts -- you
still cannot define arbitrary authoritative domains (such as
directories) that are run as different users. At least not the way I've
understood it.

I'm just running a multi-user POSIX system at home with shell access,
and having to run all web processing as the apache user, well, kinda
sucks, when it could instead actually be run as the user it should run
as, and access the users' data correctly.

> If you would want to do it (and not use php as a library [SAPI-style] )
> you shouldn't look in to CLI, but into CGI.

Yes, that's what I meant. I meant calling PHP's CLI interface with a
CGI-style interface.

> Using CGI you can lauch a php process every time a script is called.
> Many years ago they discovered this isn't the best way to handle this.
> To launch a process every time a script is called takes too much time
> and resources.
> So they invented the FASTCGI interface, which allows php processes to
> remain persistant in the memory. You would probably (depending on your
> demands) want to have a bunch of php processes forked in the memory.

While that is true, I don't think that the "real" CGI interface would be
a problem with the kind of load that my server is under.

> If it's an experment, I would say go for it. If you want to use it
> commercially or at least in a live enviroment I would strongly
> discourage you to do it.

Well, of course it's not a commercial environment. I just want a good
multi-user server on my home system.

> In any case, if you want it to be fast, you want to do it 'SAPI-style'..

Well, I've been considering writing a SAPI for PHP. I haven't actually
looked at the SAPI interface, but I'm getting the feeling that that's
probably more work than writing an entire web server. ;)

Anyways, thanks for your input!

Fredrik Tolf

attached mail follows:


On Mon, 2005-07-18 at 20:44 +0100, Mikey wrote:
> Catalin Trifu wrote:
> >Fredrik Tolf wrote:
> >>I've begun to be more and more displeased with Apache lately, so I've
> >>been thinking of writing my own HTTP server instead. I still want PHP
> >>support, but writing a new SAPI for PHP seems like overkill.
> >>
> >>Therefore, is it possible to use PHP from the command line, but still
> >>enable some HTTP-server-only stuff, like GET and POST variables,
> >>cookies, session management, file uploads, and so on? I haven't been
> >>able to find any docs on doing that, but I'm thinking that it should be
> >>possible.
> >>
> >>So, can someone either point me to some docs in this, or, lacking such,
> >>give me a short intro to it?
> >
> All of the features you mentioned are those provided for you by Apache,
> barring the session management. If you really want to write your own
> http server then maybe take a look at the Apache source code. It will
> either give you some good pointers or make you realise what a huge task
> you are undertaking...

Are you sure about this? The way I've understood it, the web server just
passes the URL to PHP, and then PHP parses and extracts the GET
variables from it and construct an array of them.

Likewise, surely the server just passes the content passed by the client
browser, and then PHP extracts the POST variables and file uploads,
right? I wouldn't think that Apache extracts POST variables and file
uploads by itself.

Same thing with cookies, right? Surely, the webserver just passes the
headers to PHP, which extracts the cookies, right?

I would think that it should be possible to pass the URL, headers, and
client-passed content to PHP via PHP's CLI interface, to let it do that
job. Isn't that possible?

Even if not, parsing GET URLs and headers doesn't really seem like a
very huge undertaking. I realize that Apache is huge, but that's just
because it has so insanely many features -- an HTTP server in itself
shouldn't need to be very complex, the way I see it.

Thanks for responding!

Fredrik Tolf

attached mail follows:


Fredrik Tolf wrote:
> On Mon, 2005-07-18 at 15:57 -0400, Evert | Rooftop wrote:
>
>>Fredrik Tolf wrote:
>>
>>>I've begun to be more and more displeased with Apache lately, so I've
>>>been thinking of writing my own HTTP server instead. I still want PHP
>>>support, but writing a new SAPI for PHP seems like overkill.
>>>
>>>Therefore, is it possible to use PHP from the command line, but still
>>>enable some HTTP-server-only stuff, like GET and POST variables,
>>>cookies, session management, file uploads, and so on? I haven't been
>>>able to find any docs on doing that, but I'm thinking that it should be
>>>possible.
>>>
>>>So, can someone either point me to some docs in this, or, lacking such,
>>>give me a short intro to it?
>>>
>>
>>Hi Fredrick,
>
>
> Hi!
>
>
>>I wonder too why you are displeased with apache =) to me (and I know
>>many others in this group) it is the best webserver around.
>
>
> One of the problems for me with Apache is that it's too complex. To
> begin with, it contains a million feature that I'll never use, but which
> does bring up resource consumption.
>
> It also contains a lot of high-performance stuff which impedes
> flexibility, such as not being able to keep file descriptors to instead
> be able to load-balance requests between workers and servers.
>
> Almost foremost, however, I'm looking to build a server with far better
> support for multi-user operation. While Apache with UserDir and suexec
> does some things good, it cannot, for example, running PHP applications
> as different users. I know there is a worker module for apache that can
> run different vhosts as different users, but that's just vhosts -- you
> still cannot define arbitrary authoritative domains (such as
> directories) that are run as different users. At least not the way I've
> understood it.
>
> I'm just running a multi-user POSIX system at home with shell access,
> and having to run all web processing as the apache user, well, kinda
> sucks, when it could instead actually be run as the user it should run
> as, and access the users' data correctly.
>
>
>>If you would want to do it (and not use php as a library [SAPI-style] )
>>you shouldn't look in to CLI, but into CGI.
>
>
> Yes, that's what I meant. I meant calling PHP's CLI interface with a
> CGI-style interface.
>
>
>>Using CGI you can lauch a php process every time a script is called.
>>Many years ago they discovered this isn't the best way to handle this.
>>To launch a process every time a script is called takes too much time
>>and resources.
>>So they invented the FASTCGI interface, which allows php processes to
>>remain persistant in the memory. You would probably (depending on your
>>demands) want to have a bunch of php processes forked in the memory.
>
>
> While that is true, I don't think that the "real" CGI interface would be
> a problem with the kind of load that my server is under.

Sounds like you are simply looking for Apache's suexec feature. That
will let you run PHP (CGI version) as any given user on any given request.

-Rasmus

attached mail follows:


Hi,
 
could someone please check where the sytax error is in these statements.
 
$sqlstmt= "EXEC sp_addlogin ".$adduser." , ".$addpass;
$sqlstmt1= "EXEC sp_adduser loginame= ".$adduser." , name_in_db= ".$adduser;
$sqlstmt2= "GRANT CREATE TABLE TO ".$adduser;
$sql=mssql_query($sqlstmt);
$sql1=mssql_query($sqlstmt1);
$sql2=mssql_query($sqlstmt2);
 
thanks
babu

                
---------------------------------
Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail

attached mail follows:


babu wrote:
> Hi,
>
> could someone please check where the sytax error is in these statements.
>
> $sqlstmt= "EXEC sp_addlogin ".$adduser." , ".$addpass;
> $sqlstmt1= "EXEC sp_adduser loginame= ".$adduser." , name_in_db= ".$adduser;
> $sqlstmt2= "GRANT CREATE TABLE TO ".$adduser;
> $sql=mssql_query($sqlstmt);
> $sql1=mssql_query($sqlstmt1);
> $sql2=mssql_query($sqlstmt2);

Didn't php give you a line number?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


Hi all.

I have the week number (for example, this is the 29th week of the
year and it begins on 7/17/05). Does anyone know how to obtain the
first (and maybe the last) date of the week if you only know the week
number of the year? Would it be better for me to obtain this in PHP
or MySQL? or both?

I have researched the archives on a few lists and I know that others
have asked this same questions, but I have not found a good solution.
I have also looked on MySQL's "date and time functions" page, but had
little luck.

Any thoughts would be appreciated.
~Philip

attached mail follows:


>do you have this in your php.ini extensions?
>extension=php_mysql.dll

yes

>Make sure you extension path is referencing its location also so it can
>find it...
>for example:
>extension_dir = "c:/php/ext/"

I changed this and now I can connect to MySQL! Haven't runa query yet, but
I think I'm past the roadblock. Thanks so much to all who helped.

Linda

attached mail follows:


is there some way to get a .do file from a server is it readable? I think
that may be my whole problem with my curl sequence. I need to see what the
routing file is doing

attached mail follows:


        hi,

   Usually the .do files are servlets and the .do stuff you enter is rewritten
by the server internally to point to the actual servlet.
   With a http request you will get whatever the servlet is spitting out the wire.

Catalin

Jon wrote:
> is there some way to get a .do file from a server is it readable? I think
> that may be my whole problem with my curl sequence. I need to see what the
> routing file is doing

attached mail follows:


Lets say I have a form. And when user types in the form and clicks go,
it shows output.
but.
lets say the person type in
monday
But I want the php code to change it too
MONDAY
how do I do that?
Thanks!

attached mail follows:


[snip]
Lets say I have a form. And when user types in the form and clicks go,
it shows output.
but.
lets say the person type in
monday
But I want the php code to change it too
MONDAY
how do I do that?
[/snip]

http://www.php.net/strtoupper

attached mail follows:


$uppercasestring=strtoupper($originalstring);

----- Original Message -----
From: "George B" <geoizilgmail.com>
To: <php-generallists.php.net>
Sent: Monday, July 18, 2005 6:59 PM
Subject: [PHP] change letter to all caps

> Lets say I have a form. And when user types in the form and clicks go,
> it shows output.
> but.
> lets say the person type in
> monday
> But I want the php code to change it too
> MONDAY
> how do I do that?
> Thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


George B wrote:
> Lets say I have a form. And when user types in the form and clicks go,
> it shows output.
> but.
> lets say the person type in
> monday
> But I want the php code to change it too
> MONDAY
> how do I do that?

The manual is your friend.

http://us2.php.net/manual/en/function.strtoupper.php

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


Hi

On 18 Jul 2005, at 18:59, George B wrote:

> Lets say I have a form. And when user types in the form and clicks
> go, it shows output.
> but.
> lets say the person type in
> monday
> But I want the php code to change it too
> MONDAY
> how do I do that?
> Thanks!

have a look here:
http://ie2.php.net/manual/en/function.strtoupper.php

eoghan

attached mail follows:


* George B <geoizilgmail.com>:
> Lets say I have a form. And when user types in the form and clicks go,
> it shows output.
> but.
> lets say the person type in
> monday
> But I want the php code to change it too
> MONDAY
> how do I do that?

The PHP manual is your friend, if you know what to look for. You're
manipulating a string, so look in the 'Strings' section of the manual
(http://php.net/strings). Then look for words like 'case' or 'upper',
and you'll find:

    strtoupper - Make a string uppercase

Enjoy!

--
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

attached mail follows:


I am trying to connect to a datbase:

"
mysql_select_db ('database')
        or die ("couldnt connect to databse")
"
What is wrong here?
This is the error:

Parse error: syntax error, unexpected T_STRING in file name on line 12

attached mail follows:


>
> I am trying to connect to a datbase:
>
> "
> mysql_select_db ('database')
> or die ("couldnt connect to databse")
> "
> What is wrong here?
> This is the error:
>
> Parse error: syntax error, unexpected T_STRING in file name on line 12
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Extra spaces, and no semicolon?
try:

mysql_select_db('database') or die("couldnt connect to databse");

JM

attached mail follows:


George B wrote:
> I am trying to connect to a datbase:
>
> "
> mysql_select_db ('database')
> or die ("couldnt connect to databse")
> "
> What is wrong here?
> This is the error:
>
> Parse error: syntax error, unexpected T_STRING in file name on line 12
>

Are either one of those lines, line 12?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


George B wrote:
> I am trying to connect to a datbase:
>
> "
> mysql_select_db ('database')
> or die ("couldnt connect to databse")
> "
> What is wrong here?
> This is the error:
>
> Parse error: syntax error, unexpected T_STRING in file name on line 12
this code works though

$db = mysql_connect("localhost", "myaccount", "mypass") or die("Could
not connect.");
if(!$db)
        die("no db");
if(!mysql_select_db("database",$db))
          die("No database selected.");

attached mail follows:


Jim Moseby wrote:
>>I am trying to connect to a datbase:
>>
>>"
>>mysql_select_db ('database')
>> or die ("couldnt connect to databse")
>>"
>>What is wrong here?
>>This is the error:
>>
>>Parse error: syntax error, unexpected T_STRING in file name on line 12
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
>
> Extra spaces, and no semicolon?
> try:
>
> mysql_select_db('database') or die("couldnt connect to databse");
>
> JM
Thanks JM!
It was another one of my usual mistakes :P
Forgot the semicolon. I don't underestand why you have to put in so many
semicolons... Hmm.. Is it a thing from C or something?

attached mail follows:


* George B <geoizilgmail.com> :
> Jim Moseby wrote:
> > > I am trying to connect to a datbase:
> > >
> > > "
> > > mysql_select_db ('database')
> > > or die ("couldnt connect to databse")
> > > "
> > > What is wrong here?
> > > This is the error:
> > >
> > > Parse error: syntax error, unexpected T_STRING in file name on line 12
> >
> > Extra spaces, and no semicolon?
> > try:
> >
> > mysql_select_db('database') or die("couldnt connect to databse");
> >
> Thanks JM!
> It was another one of my usual mistakes :P
> Forgot the semicolon. I don't underestand why you have to put in so many
> semicolons... Hmm.. Is it a thing from C or something?

C *AND* something... PHP borrows heavily from both C and perl (and a
variety of other languages) -- both of which use this notation. Most
languages I've used other than python use a delimiter to indicate the
end of a statement (python does as well, technically -- the EOL
character).

--
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

attached mail follows:


> Thanks JM!
> It was another one of my usual mistakes :P
> Forgot the semicolon. I don't underestand why you have to put
> in so many
> semicolons... Hmm.. Is it a thing from C or something?

When I see that T_STRING error, missing semicolon is the first thing I look
for. I don't know the history of the semicolon, but I imagine the need for
them is rooted in the necessity for PHP to know where a line of code ends
and the next one starts. Just a guess. ;o)

JM

attached mail follows:


George B wrote:
> George B wrote:
>
>> I am trying to connect to a datbase:
>>
>> "
>> mysql_select_db ('database')
>> or die ("couldnt connect to databse")
>> "
>> What is wrong here?
>> This is the error:
>>
>> Parse error: syntax error, unexpected T_STRING in file name on line 12
>
> this code works though

the semicolon delimits a single statement (however complex).
tabs and spaces have no 'token' meaning. as in the parser doesn't give a
hoot if you write the whole scripton a single line. (I use the word statement
but I'm not sure that's the correct name for it - anyone care to add?)
if/else/else if/while/for(/etc?) have the quality that you can leave
out the braces if you are only wish to conditionally execute 1 statement
... e.g:

// run this on the cmdline or change the '\n's to '<br />'
$a = $b = $c = "A"; $d = array("A"); $e = "B";

echo "\nplainfoos and foofoos:\n";

// this one you dont see (the silentfoo)
if (!in_array(str_replace($a,$b,$c),$d))
        echo "silentfoo\n";

// this is like the next one
if (in_array(str_replace($a,$b,$c),$d))
        echo "foo\n";

// this is like the previous one
if (in_array(str_replace($a,$b,$c),$d)) {
        echo "foo\n";
}

///////////////////////////////////

// this is not like the next one
if (in_array(str_replace($a,$b,$c),array($e)))
        echo "foo";
        echo "foo\n";

// this is not like the previous one
if (in_array(str_replace($a,$b,$c),$d)) {
        echo "foo";
        echo "foo\n";
}

and now a word from our sponsor for this evening about die()ing ...
>
> $db = mysql_connect("localhost", "myaccount", "mypass") or die("Could
> not connect.");

<?
function yourmoney($kids = 1) { return 80 - (90 * $kids); }
function yourlife($lastWords = "errr") { die(strval($s)); }

yourmoney() or yourlife("is no choice at all.");
?>

(it has to be added that we are talking about those special kind of
children that are capable of 'breaking' your friends Hummer ;-))

[not a true story - just popped into my head.]

> if(!$db)
> die("no db");
> if(!mysql_select_db("database",$db))
> die("No database selected.");

die(); die(); die() ... see it doesn't even sound very nice ;-)

have fun!

>

attached mail follows:


Hey guys how would i show a filed from a MySQL database in a php file?
Isnt it this?
SELECT * FROM `user`
But that dosent work because it comes out blank :-\
And I already am connected to the database
Code:

mysql_connect ('localhost','myaccount','mypass')
        or die ("could not connect to server");
mysql_select_db ('database')
        or die ("could not connect to database");

$query = "SELECT *
FROM `user`
LIMIT 0 , 30";
        mysql_query($query);

attached mail follows:


George B wrote:
<snip non-researched basic stuff>

http://us2.php.net/manual/en/index.php

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


[snip]
...a lot of stuff from George....
[/snip]

George,

We appreciate that you are asking a lot of questions and hope that you
become a proficient user of PHP. We do recommend that you spend some
time with a tutorial or two (Google is your friend) and a little time
with the manual. Many of your questions are answwered and often there is
more than one way to do things.

Thank you.

To show a field from a query you have to

a. get the data from a query

$myQuery = "SELECT foo FROM table ";
if(!($myResult = mysql_query($myQuery, $myConnection))){
        echo mysql_error . "\n";
        exit();
}

while($myRow = mysql_fetch_array($myResult)){
        echo $myRow['foo'] . "<br>\n";
}

b. display the data

attached mail follows:


Thats just executing the query.. you need to use the result set, and
iterate over it...

$rs = mysql_query($query);
while($row=mysql_fetch_array($rs)) {
 echo $row[0]; ...

}

stuff like that.

> Hey guys how would i show a filed from a MySQL database in a php file?
> Isnt it this?
> SELECT * FROM `user`
> But that dosent work because it comes out blank :-\
> And I already am connected to the database
> Code:
>
> mysql_connect ('localhost','myaccount','mypass')
> or die ("could not connect to server");
> mysql_select_db ('database')
> or die ("could not connect to database");
>
> $query = "SELECT *
> FROM `user`
> LIMIT 0 , 30";
> mysql_query($query);
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


John Nichel wrote:
> George B wrote:
> <snip non-researched basic stuff>
>
> http://us2.php.net/manual/en/index.php
>

:-) anyone care for a php mysql extension:

mysql_do_xml_http_request_bound_richdatagrid([string] query);

george if you want to keep asking questions on NRBS**
then you'll need to change email addrs + name :-)

** from Johns 'non-researched basic stuff' I like the way
the BS comes out ... :-P

attached mail follows:


Jochem Maas wrote:
> John Nichel wrote:
>
>> George B wrote:
>> <snip non-researched basic stuff>
>>
>> http://us2.php.net/manual/en/index.php
>>
>
> :-) anyone care for a php mysql extension:
>
> mysql_do_xml_http_request_bound_richdatagrid([string] query);
>
> george if you want to keep asking questions on NRBS**
> then you'll need to change email addrs + name :-)
>
> ** from Johns 'non-researched basic stuff' I like the way
> the BS comes out ... :-P
what is it wrong to ask questions on a php general mailing list where I
know there are a bunch of people that can help? I do have a php book
But it dosent show. Why can other people ask questions but I cant?

attached mail follows:


Hi there,

 

I was wondering if anybody has attempted to track a mobile phone through a
country. I know that this is usually more a case for the FBI . a friend of
mine is going on a 4 month bike tour and I would like to 'track' him for
locations. I thought of an sms receiving system, but if could do any other
way would be great.

 

Any ideas?

 

Thomas

attached mail follows:


I think that would require tapping the cellphone network, which I doubt
they would let you do since it be a major violation of privacy, because
you could track the general location of anyone on their network.

Thomas wrote:
> Hi there,
>
>
>
> I was wondering if anybody has attempted to track a mobile phone through a
> country. I know that this is usually more a case for the FBI . a friend of
> mine is going on a 4 month bike tour and I would like to 'track' him for
> locations. I thought of an sms receiving system, but if could do any other
> way would be great.
>
>
>
> Any ideas?
>
>
>
> Thomas
>
>

attached mail follows:


Hi

I did hear of a gps feature that's been tested here. Basically you subscribe
to a service by your provider and then you choose where to forward the data.
I've seen it in use in some company that tracks it's least selling
representatives (with their approval, off course).

With kind regards

Andy

On Monday 18 July 2005 21:41, Ethilien wrote:
> I think that would require tapping the cellphone network, which I doubt
> they would let you do since it be a major violation of privacy, because
> you could track the general location of anyone on their network.
>
> Thomas wrote:
> > Hi there,
> >
> >
> >
> > I was wondering if anybody has attempted to track a mobile phone through
> > a country. I know that this is usually more a case for the FBI . a friend
> > of mine is going on a 4 month bike tour and I would like to 'track' him
> > for locations. I thought of an sms receiving system, but if could do any
> > other way would be great.
> >
> >
> >
> > Any ideas?
> >
> >
> >
> > Thomas

--
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-) W+++>+++$ !N o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+) !tv b-() DI(+) D+(+++) G(+)
e>++++$ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQBC3Ade2GLGPJ3Q07wRArF+AJ9MwB59s26S1z3DVClmbzzW9JoczgCgig+E
URrdVvjJfbbOaC3XcHqr9F4=
=SVeB
-----END PGP SIGNATURE-----

attached mail follows:


Ethilien wrote:
> I think that would require tapping the cellphone network, which I doubt
> they would let you do since it be a major violation of privacy, because
> you could track the general location of anyone on their network.
>
> Thomas wrote:
>
>> Hi there,
>>
>>
>>
>> I was wondering if anybody has attempted to track a mobile phone
>> through a
>> country. I know that this is usually more a case for the FBI . a
>> friend of
>> mine is going on a 4 month bike tour and I would like to 'track' him for
>> locations. I thought of an sms receiving system, but if could do any
>> other
>> way would be great.
>>
>>
>>
>> Any ideas?
>>
>>
>>
>> Thomas
>>
>>
There was a way to do this... But it wasnt with cellphones... They have
a tutorial thing on slashdot

attached mail follows:


Thomas wrote:

>Hi there,
>
>
>
>I was wondering if anybody has attempted to track a mobile phone through a
>country. I know that this is usually more a case for the FBI . a friend of
>mine is going on a 4 month bike tour and I would like to 'track' him for
>locations. I thought of an sms receiving system, but if could do any other
>way would be great.
>
>
>
>Any ideas?
>
>
>
>Thomas
>
>
>
>
This is totally off the top of my head, but I recall that a company has
started providing a service in the UK that allows you to track the
location of a registered mobile phone visiting a WAP page with a map.
Is not much info, I kow, but it might be a starting place for you...

Mikey

attached mail follows:


The phone would have to have GPS capabilities..

Ethilien wrote:

> I think that would require tapping the cellphone network, which I
> doubt they would let you do since it be a major violation of privacy,
> because you could track the general location of anyone on their network.
>
> Thomas wrote:
>
>> Hi there,
>>
>>
>>
>> I was wondering if anybody has attempted to track a mobile phone
>> through a
>> country. I know that this is usually more a case for the FBI . a
>> friend of
>> mine is going on a 4 month bike tour and I would like to 'track' him for
>> locations. I thought of an sms receiving system, but if could do any
>> other
>> way would be great.
>>
>>
>>
>> Any ideas?
>>
>>
>>
>> Thomas
>>
>>
>

--
Certified E-mail - No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.336 / Virus Database: 267.9.0/50 - Release Date: 7/16/2005

attached mail follows:


Yea that would be very very hard.. besides if your friend would do the
trip in the usa, I doubt he can access the network at all ;)
In any case, the most realistic choice would be to buy a GPS-enabled
phone and write a nice Java app that does the job for you (maybe even
flash-lite can do it).

Evert

Ethilien wrote:

> I think that would require tapping the cellphone network, which I
> doubt they would let you do since it be a major violation of privacy,
> because you could track the general location of anyone on their network.
>
> Thomas wrote:
>
>> Hi there,
>>
>>
>>
>> I was wondering if anybody has attempted to track a mobile phone
>> through a
>> country. I know that this is usually more a case for the FBI . a
>> friend of
>> mine is going on a 4 month bike tour and I would like to 'track' him for
>> locations. I thought of an sms receiving system, but if could do any
>> other
>> way would be great.
>>
>>
>>
>> Any ideas?
>>
>>
>>
>> Thomas
>>
>>
>

attached mail follows:


I've been attempting to write an application with a bit more ordered
directory structure than I normally use, and I ran into the rather
annoying problem with include() where relative paths are only based off
of the current working directory, and not that of the included script.
This makes it impossible to include script correctly, because the path
from the working directory is different than that of the included file.

The problem is I'm trying to include
/include/global.php

from
/elements/nav.php

but topnav is included by
/index.php

Which results in a failed top open stream error. Is there any way around
this annoying idiosyncrasy?

attached mail follows:


Actually, I think I might have found a solution, although its not a very
good one.

include realpath(dirname(__FILE__) . "/" . "../include/global.php");

Ethilien wrote:
> I've been attempting to write an application with a bit more ordered
> directory structure than I normally use, and I ran into the rather
> annoying problem with include() where relative paths are only based off
> of the current working directory, and not that of the included script.
> This makes it impossible to include script correctly, because the path
> from the working directory is different than that of the included file.
>
> The problem is I'm trying to include
> /include/global.php
>
> from
> /elements/nav.php
>
> but topnav is included by
> /index.php
>
> Which results in a failed top open stream error. Is there any way around
> this annoying idiosyncrasy?

attached mail follows:


Ethilien wrote:
> Actually, I think I might have found a solution, although its not a very
> good one.
>
> include realpath(dirname(__FILE__) . "/" . "../include/global.php");
>
> Ethilien wrote:
>
>> I've been attempting to write an application with a bit more ordered
>> directory structure than I normally use, and I ran into the rather
>> annoying problem with include() where relative paths are only based
>> off of the current working directory, and not that of the included
>> script. This makes it impossible to include script correctly, because
>> the path from the working directory is different than that of the
>> included file.
>>
>> The problem is I'm trying to include
>> /include/global.php
>>
>> from
>> /elements/nav.php
>>
>> but topnav is included by
>> /index.php
>>
>> Which results in a failed top open stream error. Is there any way
>> around this annoying idiosyncrasy?
>
>

What I do, and a lot of other folks I borrowed the idea from, is to set
a variable or constant, something like

define('INCLUDE_DIR', "include/")

in your index, or init file. Then when you need to do an include from
another included file you just do include INCLUDE_DIR."somefile.php" and
the path is set for you.

All file paths are going to be relevant to the first script hit, so you
can change the actual path to your include directory relative to that
script.

attached mail follows:


Ethilien wrote:
> Actually, I think I might have found a solution, although its not a very
> good one.
>
> include realpath(dirname(__FILE__) . "/" . "../include/global.php");

alot of people do something _like_:

define('GLOBAL_BASE_DIR', dirname(__FILE__));

somewhere near the beginning of their startup code...
so you can subsequently do:

require_once GLOBAL_BASE_DIR . '/include/xyz.php';

but maybe you should also look at the ini setting 'include_path'

>
> Ethilien wrote:
>
>> I've been attempting to write an application with a bit more ordered
>> directory structure than I normally use, and I ran into the rather
>> annoying problem with include() where relative paths are only based
>> off of the current working directory, and not that of the included
>> script. This makes it impossible to include script correctly, because
>> the path from the working directory is different than that of the
>> included file.
>>
>> The problem is I'm trying to include
>> /include/global.php
>>
>> from
>> /elements/nav.php
>>
>> but topnav is included by
>> /index.php
>>
>> Which results in a failed top open stream error. Is there any way
>> around this annoying idiosyncrasy?
>
>

attached mail follows:


On Tue, Jul 12, 2005 at 09:23:59PM +0300 or thereabouts, Ahmed Saad wrote:
> Hi all,
>
> I've been around this list for a month or something but i just
> discovered today that all my replies weren't sent to the list but
> instead to the individual who sent the message. I haven't administered
> any list systems before but at Apache for example it appends a
> reply-to header pointing to the mailing list posting addresss
> (php-generallists.php.net, in our case). You hit reply and type the
> message. I think it rather confusing as we have to add
> php-generallists.php.net in CC or TO fields and it results in
> duplicate messages.
>
> Can the list administators can fix this? (appending the correct reply-to header)

Hopefully they won't, please read
<http://www.unicom.com/pw/reply-to-harmful.html>

I use mutt, replying to a subscribed list (like this one) is simple. One simply
hits the 'L' key. Perhaps you need a good e-mail client ...

--
Steve A.
-----------------------------------------------
Monday Jul 18 2005 16:10:01 EDT
-----------------------------------------------
Os espinhos que colhi são da árvore que plantei.
                -- Lord Byron, poeta inglês

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC3A2HXNTgRvikjfERArnLAJ4oYSQeUoJCi42/H5+40oGCWawCDwCgj/oi
Zy0pRF5fMy+M2xRLQu5yz+4=
=Mgjc
-----END PGP SIGNATURE-----

attached mail follows:


On 7/12/05, Rasmus Lerdorf <rasmuslerdorf.com> wrote:
> Probably just means the lists aren't very technical.

That comment amused me greatly, because the only other mailinglist I'm
on is the Ruby on Rails list, and that one does reply-to munging.
What that says about the respective userbases of PHP and RoR, I'm not
sure... :p

attached mail follows:


Not really a PHP question, but you could look to see if your friend has a GPS enabled phone and phone service and if there's an API for pulling the location from the phone co's systems. Then you could see if there's a PHP solution for interfacing with that API.

Some cell phone companies let you see where the cell phone is on online maps. Without resorting to FBI or Spy Store tactics, that's probably your best bet. But is only good if they're riding through areas with service for that cell system and only if they have a GPS enabled phone and service that supports tracking.

Lots of If's.

-TG

= = = Original message = = =

I think that would require tapping the cellphone network, which I doubt
they would let you do since it be a major violation of privacy, because
you could track the general location of anyone on their network.

Thomas wrote:
> Hi there,
>
>
>
> I was wondering if anybody has attempted to track a mobile phone through a
> country. I know that this is usually more a case for the FBI . a friend of
> mine is going on a 4 month bike tour and I would like to 'track' him for
> locations. I thought of an sms receiving system, but if could do any other
> way would be great.
>
>
>
> Any ideas?
>
>
>
> Thomas

___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

attached mail follows:


Hi!,
I need to get some information from a webpage, that is served as UTF-8.
I need that information because the page contains different language
characters. The problem is that no matter if I use fget or the CURL
libraries, i got the information in ISO-8859-1.
How can i overcome this? Take in consideration that not all UTF-8 can be
converted to ISO-8859-1 (chinese, for example)

Thanks in advance!

--
Marcelo Volmaro

attached mail follows:


Marcelo Volmaro wrote:
> Hi!,
> I need to get some information from a webpage, that is served as UTF-8.
> I need that information because the page contains different language
> characters. The problem is that no matter if I use fget or the CURL
> libraries, i got the information in ISO-8859-1.
> How can i overcome this? Take in consideration that not all UTF-8 can
> be converted to ISO-8859-1 (chinese, for example)

http://php.net/iconv
http://php.net/mbstring

I wish I could tell you more. but I'm don't really understand it.

>
> Thanks in advance!
>

attached mail follows:


But my problem is that the information i get from the fget or curl is
ALREADY converted!!!
And by what i see, the function overloading don´t work on fget.

On Mon, 18 Jul 2005 18:56:36 -0300, Jochem Maas <jochemiamjochem.com>
wrote:

> Marcelo Volmaro wrote:
>> Hi!,
>> I need to get some information from a webpage, that is served as UTF-8.
>> I need that information because the page contains different language
>> characters. The problem is that no matter if I use fget or the CURL
>> libraries, i got the information in ISO-8859-1.
>> How can i overcome this? Take in consideration that not all UTF-8 can
>> be converted to ISO-8859-1 (chinese, for example)
>
> http://php.net/iconv
> http://php.net/mbstring
>
> I wish I could tell you more. but I'm don't really understand it.
>
>
>> Thanks in advance!
>>
>

--
Marcelo Volmaro

attached mail follows:


I have never done this but - have you tried using curl_setopt to have
is sent as a binary file and try to go from there?

Marcelo Volmaro wrote:

> But my problem is that the information i get from the fget or curl is
> ALREADY converted!!!
> And by what i see, the function overloading don´t work on fget.
>
> On Mon, 18 Jul 2005 18:56:36 -0300, Jochem Maas <jochemiamjochem.com>
> wrote:
>
>> Marcelo Volmaro wrote:
>>
>>> Hi!,
>>> I need to get some information from a webpage, that is served as UTF-8.
>>> I need that information because the page contains different
>>> language characters. The problem is that no matter if I use fget or
>>> the CURL libraries, i got the information in ISO-8859-1.
>>> How can i overcome this? Take in consideration that not all UTF-8
>>> can be converted to ISO-8859-1 (chinese, for example)
>>
>>
>> http://php.net/iconv
>> http://php.net/mbstring
>>
>> I wish I could tell you more. but I'm don't really understand it.
>>
>>
>>> Thanks in advance!
>>>
>>
>
>
>

--
Respectfully,
Ligaya Turmelle

"Life is a game.... so have fun"

attached mail follows:


Is there a way to get the name of a variable as a string? For example...

Function myname ($foo)
{
        echo "the variable name passed in is ".realname($foo);
}

myname($bar);
       ^^^^

I want to see printed out:

"the variable name passed in is bar"
                                          ^^^

Dig what I'm trying to do?

And 'why?' you may ask am I trying to do this... Well, I am sick of always
putting an "echo 'printing out bar:'; print_r($bar);" all the time. I want
to make a wrapper function.

I also have written one for XML that would be nice to make a NAME='bar'
attribute...

/**
* Print out an array in XML form (useful for debugging)
* access public
* author Daevid Vincent [daeviddaevid.com]
* since 4.0b4
* version 1.0
* date 07/18/05
*/
function print_r_xml($myArray)
{
        print xmltag('ARRAY', array('NAME'=>'myArray'), 1);
        foreach($myArray as $k => $v)
        {
                if (is_array($v))
                        print_r_xml($v);
                else
                        print xmltag($k,htmlspecialchars($v));
        }
        print xmltag('ARRAY', null, 2);
}

attached mail follows:


Maybe something like:

 Function myname ($foo)
 {
$return_value="the variable name passed in is ".$foo;
return $return_value;
}

echo myname($bar);

Just a guess.....

On 7/19/2005 3:27:57 AM, Daevid Vincent (daeviddaevid.com) wrote:
> Is there a way to get the name of a variable as a string? For example...
>
> Function myname ($foo)
> {
> echo "the variable name passed in is ".realname($foo);
> }
>
> myname($bar);
> ^^^^
>
> I want to see printed out:
>
> "the variable name passed in is bar"
> ^^^
>
> Dig what
> I'm trying to do?
>
> And 'why?' you may ask am I trying to do this... Well, I am sick of always
> putting an "echo 'printing
> out
> bar:'; print_r($bar);" all the time. I want
> to make a wrapper function.
>
> I also have written one for XML that would be nice to make a NAME='bar'
> attribute...
>
> /**
> * Print out an array in XML form (useful for debugging)
> * access public
> * author Daevid Vincent [daeviddaevid.com]
> * since 4.0b4
> * version 1.0
> * date 07/18/05
> */
> function print_r_xml($myArray)
> {
> print xmltag('ARRAY', array('NAME'=>'myArray'), 1);
> foreach($myArray as $k => $v)
> {
> if (is_array($v))
> print_r_xml($v);
> else
> print xmltag($k,htmlspecialchars($v));
> }
> print xmltag('ARRAY', null, 2);
> }
>
> --
> P