php-general Digest 30 Jun 2003 02:32:02 -0000 Issue 2147
Topics (messages 153319 through 153355):
Re: $_POST problem >> SUPERGLOBALS
153319 by: Philip Olson
Re: web site security: how to hide login info for mysql-connection
153320 by: anders thoresson
153321 by: Avvio - Frank
153322 by: Jaap van Ganswijk
Re: File Uploads!
153323 by: Jason Wong
153340 by: Catalin Trifu
PHP5 with MySQL on windows
153324 by: janet.valade.com
153330 by: Philip Olson
PHP 5.0.0 Beta 1
153325 by: Sterling Hughes
153326 by: Robert Cummings
Re: [PHP-QA] Re: [PHP] PHP 5.0.0 Beta 1
153327 by: Derick Rethans
153328 by: Robert Cummings
Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP] PHP 5.0.0 Beta 1
153329 by: Sascha Schumann
153352 by: Manuel Lemos
time calcs
153331 by: Larry R. Sieting
153332 by: Jason Wong
ARGHHH!!! POST variable problem
153333 by: Sparky Kopetzky
153334 by: Jason Wong
153335 by: Sparky Kopetzky
153336 by: Reuben D. Budiardja
153337 by: Chris Hayes
153339 by: Sparky Kopetzky
Close Connection to Browser
153338 by: Thomas Weber
153341 by: David Otton
Re: Performance question
153342 by: Justin French
Re: Another newbie
153343 by: Lars Torben Wilson
Re: passwd protected page
153344 by: Justin French
Re: Securing PHP code
153345 by: Doug Essinger-Hileman
153347 by: - Edwin -
153349 by: John Manko
153350 by: Doug Essinger-Hileman
153351 by: Leif K-Brooks
153353 by: - Edwin -
153355 by: Doug Essinger-Hileman
IsSet() and $_SESSION
153346 by: John Manko
php.net's custom 404 scripts
153348 by: Justin French
A simpler question involving http_user_agent
153354 by: Brian J. Celenza
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
It would be best to read the manual pages on superglobals
and retrieving external variables as the manual explains
these topics in detail:
http://www.php.net/reserved.variables
http://www.php.net/variables.external
Regards,
Philip
On Sun, 29 Jun 2003, esctoday.com | Wouter van Vliet wrote:
> Let's explain this thing with the superglobals now once again .. so that
> everybody knows it ...
>
> In newer versions of PHP some superglobal arrays are available...
>
> $_GET[] - For any variable passed through the query string (in the URL,
> or address bar in a http://www.domain.com/page.php?foo=bar&foo2=bar2 syntax)
> but also fields submitted through a form with a tag like <FORM method="GET">
> $_POST[] - For any field submitted from a form with tag like <FORM
> method="POST">
> $_COOKIE[] - For any cookie set and available for the script you're
> running.
> ---------------
> $_REQUEST[] - Merges the above three together. I think I mentioned them in
> the default order of importance. Post overriding cookie, get overriding
> post.
>
> $_FILES[] - Also for information send by a form, but now only the <INPUT
> type="FILE" name="fieldname"> entries are listed. Remember to use this kind
> of form tag: <form enctype="multipart/form-data" action="_URL_"
> method="post"> .. espeically "method=post" and "enctype=multipart/form-data"
> are essential. Prior to PHP4.3 the $_FILES superglobal was also included in
> $_REQUEST, but don't rely on that to happen since it will make your scripts
> fail in a newer version and have you look for a bug which is almost
> impossible to find.
>
> $_SESSION[] - Session vars set. When using $_SESSION, you should not use
> session_start() of functions like that. A session usually exists untill a
> user closes his/her browser window. Or 30 minutes has expired, whatever
> comes first. (The 30 minutes is a setting in php.ini and can be overriden,
> if i'm right about that)
>
> $_ENV[] - info about the user's default shell, homedir and stuff like
> that. The user as which your PHP script is running on the server, that is.
> NOT the user visiting your page.
>
> $_SERVER[] - info about the server and the script which is running.. For
> example $_SERVER['php_self'] gives you the filename of the script,
> $_SERVER['PHP_AUTH_USER'] for the apache basic authentication username..
>
> -----
>
> So, now I hope this has been cleared out for everybody.. And that I'll still
> be in time to see my fav bands play at ParkPop, one of the biggest free open
> air pop festivals I think in Europe.. just around the corner of my house
> here in The Hague.
>
> Salutes,
> Wouter
>
> -----Oorspronkelijk bericht-----
> Van: Jason Wong [mailto:[EMAIL PROTECTED]
> Verzonden: vrijdag 27 juni 2003 22:46
> Aan: [EMAIL PROTECTED]
> Onderwerp: Re: [PHP] $_POST problem
>
>
> On Saturday 28 June 2003 04:32, Sparky Kopetzky wrote:
>
> > I've got my script kinda running but am unable to retrieve any values with
> > $_POST. I turned on register_globals in the php.ini and am using this url:
>
> If you're going to be using $_POST (which you should) then you should
> *disable* register_globals.
>
> > http://www.fttta.com/auction.php?action=reg. (Sorry, it's local for
> now...)
> >
> > I'm using this kind of line to check for values:
> > elseif ('reg' == $_POST['action'])
> > {
> > do something;
> > }
>
> Does print_r($_POST) show your variables?
>
> If not are you using the POST method in your form?
>
> If so what version of PHP are you using?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> Even the best of friends cannot attend each other's funeral.
> -- Kehlog Albran, "The Profit"
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Be aware that wherever you store the settings folder, your php.ini should
have that path in it's include_directories setting, and the webserver
must
have read permissions for that file.
I don't have access to php.ini on my ISP's web server. Is there a way for
a user to make their own set ow include_directories?
--
anders thoresson
--- End Message ---
--- Begin Message ---
basically you need to append to your include_path and you can probably
create a local .htaccess file and set an include path in there (look up
php_value syntax for .htaccess)
otherwise start your script with a customised version of the following:
ini_set("include_path",ini_get("include_path").":". "/your/path/here/");
then include/require as normal
-- frank
----- Original Message -----
From: "anders thoresson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 29, 2003 4:33 PM
Subject: Re: [PHP] web site security: how to hide login info for
mysql-connection
> > Be aware that wherever you store the settings folder, your php.ini
should
> > have that path in it's include_directories setting, and the webserver
> > must
> > have read permissions for that file.
>
> I don't have access to php.ini on my ISP's web server. Is there a way for
> a user to make their own set ow include_directories?
>
> --
> anders thoresson
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
At 2003-06-29 17:21 +0100, Avvio - Frank wrote:
>basically you need to append to your include_path and you can probably
>create a local .htaccess file and set an include path in there (look up
>php_value syntax for .htaccess)
>
>otherwise start your script with a customised version of the following:
>
>ini_set("include_path",ini_get("include_path").":". "/your/path/here/");
>
>then include/require as normal
I think you can also use an include statement
like this:
include "../../php/include/file.inc";
The same mechanism can also be used for data
files that also shouldn't be in the WWW accessible
directory tree, I think. (But I'm not an expert.)
I always try to write my programs very portable
and I have found that using "../application_data/file.txt"
isn't a problem, but using "../../xxx/application_data/file.txt"
is usually a problem, because you don't want to
hardcode the name of the directory above the current
directory (in this case 'xxx'). Sometimes however
you have to go two levels up to go out of the
WWW-acessable directory three.
By the way, I think it's unwise to keep the MySQL
login data uncoded on the Unix system, because
other users or the system managers could read it.
Generally these files have to be readable by Apache
and therefore other users on the system can often
also read them.
Greetings,
Jaap
>----- Original Message -----
>From: "anders thoresson" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, June 29, 2003 4:33 PM
>Subject: Re: [PHP] web site security: how to hide login info for
>mysql-connection
>
>
>> > Be aware that wherever you store the settings folder, your php.ini
>should
>> > have that path in it's include_directories setting, and the webserver
>> > must
>> > have read permissions for that file.
>>
>> I don't have access to php.ini on my ISP's web server. Is there a way for
>> a user to make their own set ow include_directories?
>>
>> --
>> anders thoresson
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Sunday 29 June 2003 20:40, Tom Rogers wrote:
> Maybe you have to wind up the post_max_size in php.ini and then control
> with MAX_FILE_SIZE in the form for the error to show up in the $_FILES
> array....
"MAX_FILE_SIZE in the form" is client-side, for the benefit of the browser.
*IF* the browser supports it then IT would stop the upload of files larger
than MAX_FILE_SIZE.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The early bird gets the coffee left over from the night before.
*/
--- End Message ---
--- Begin Message ---
Hi,
I used MAX_FILE_SIZE too in the form which
uploads the file (the input field is before the file field)
and I am using IE6 for testing and still the file pass through to
the server.
Cheers,
Catalin
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sunday 29 June 2003 20:40, Tom Rogers wrote:
>
> > Maybe you have to wind up the post_max_size in php.ini and then control
> > with MAX_FILE_SIZE in the form for the error to show up in the $_FILES
> > array....
>
> "MAX_FILE_SIZE in the form" is client-side, for the benefit of the
browser.
> *IF* the browser supports it then IT would stop the upload of files larger
> than MAX_FILE_SIZE.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> The early bird gets the coffee left over from the night before.
> */
>
--- End Message ---
--- Begin Message ---
I can't seem to figure out how to get PHP5 working with MySQL support. I just
downloaded the latest PHP5 from snaps (which seems to be yesterday's build)
and it's installed fine, but I can't seem to get MySQL support.
The php.ini file still says
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
However, MySQL support is no longer there. There doesn't seem to by any dll
for mysql in the extensions subdirectory.
There's a libmySQL.dll in dlls, but copying that into my system directory and
adding an extension line for it in the php.ini file doesn't work. I get an
error that says invalid library. Besides, it obviously has a different name
that the other extension dlls.
I am using Windows 2000. I am running MySQL 3.23.54.
I can find nothing about this on the PHP web site. Everything I find still
says that MySQL support is built-in. Can someone tell me what I need to do to
use MySQL.
Janet
--- End Message ---
--- Begin Message ---
Hello Janet-
Currently you have two choices:
a) Compile PHP 5 on Windows yourself, with MySQL support
b) Wait for a DLL to exist
There isn't a DLL right now, nor do I know when one will
exist. But, you can be pretty sure that one will
eventually exist, especially before PHP 5 is officially
released.
PHP 5 beta 1 was released today, there isn't a MySQL DLL
in there either.
In PHP 4, MySQL is of course built in. That all changed
in PHP 5 where it's no longer built in to the Windows
binaries, nor is it bundled or enabled by default in *nix.
Regards,
Philip
On Sun, 29 Jun 2003 [EMAIL PROTECTED] wrote:
> I can't seem to figure out how to get PHP5 working with MySQL support. I just
> downloaded the latest PHP5 from snaps (which seems to be yesterday's build)
> and it's installed fine, but I can't seem to get MySQL support.
>
> The php.ini file still says
> ;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
>
> However, MySQL support is no longer there. There doesn't seem to by any dll
> for mysql in the extensions subdirectory.
>
> There's a libmySQL.dll in dlls, but copying that into my system directory and
> adding an extension line for it in the php.ini file doesn't work. I get an
> error that says invalid library. Besides, it obviously has a different name
> that the other extension dlls.
>
> I am using Windows 2000. I am running MySQL 3.23.54.
>
> I can find nothing about this on the PHP web site. Everything I find still
> says that MySQL support is built-in. Can someone tell me what I need to do to
> use MySQL.
>
> Janet
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
The PHP development community is proud to announce the release of
PHP 5 Beta 1. Both source packages and a Win32 build are available, you
can find these packages at http://www.php.net/downloads.php. For a
complete list of changes, please refer to
http://www.php.net/ChangeLog-5.php.
Some of the more major changes include:
- PHP5 features the Zend Engine 2. For a list of Zend Engine 2
changes, please visit http://www.php.net/zend-engine-2.php.
- XML support has been completely redone in PHP5, all extensions
are now focused around the excellent libxml2 library
(http://www.xmlsoft.org/).
- SQLite has been bundled with PHP. For more information on SQLite,
please visit their website, http://www.hwaci.com/sw/sqlite/.
- Streams have been greatly improved, including the ability to access
low-level socket operations on streams.
- Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
are no longer bundled with PHP. For more information on these
licensing changes please see the MySQL licensing policy [1]
Note: This is a beta version. It should not be used in production or
even semi-production web sites. There are known bugs in it, and in
addition, some of the features may change (based on feedback). We
encourage you to download and play with it (and report bugs[2] if you
find any!), but please do not replace your production installations of
PHP 4 at this time.
[1] http://www.mysql.com/products/licensing.html
[2] http://bugs.php.net/
--- End Message ---
--- Begin Message ---
On Sun, 2003-06-29 at 14:19, Sterling Hughes wrote:
>
> - Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
> are no longer bundled with PHP. For more information on these
> licensing changes please see the MySQL licensing policy [1]
>
> [1] http://www.mysql.com/products/licensing.html
I read the licensing information in the above link, but I'm curious what
exactly in it necessitated the need to unbundle MySQL? Anyone have a
quick answer?
Cheers,
Rob.
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'
--- End Message ---
--- Begin Message ---
On Sun, 29 Jun 2003, Robert Cummings wrote:
> On Sun, 2003-06-29 at 14:19, Sterling Hughes wrote:
> >
> > - Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
> > are no longer bundled with PHP. For more information on these
> > licensing changes please see the MySQL licensing policy [1]
> >
> > [1] http://www.mysql.com/products/licensing.html
>
> I read the licensing information in the above link, but I'm curious what
> exactly in it necessitated the need to unbundle MySQL? Anyone have a
> quick answer?
It's GPL.
Derick
--
"Interpreting what the GPL actually means is a job best left to those
that read the future by examining animal entrails."
-------------------------------------------------------------------------
Derick Rethans http://derickrethans.nl/
International PHP Magazine http://php-mag.net/
-------------------------------------------------------------------------
--- End Message ---
--- Begin Message ---
Ahhh crap. I read the PHP license a long time ago. I guess time faded my
memory and I began to think of it as GPL.
Thanks,
Rob.
On Sun, 2003-06-29 at 15:02, Derick Rethans wrote:
> On Sun, 29 Jun 2003, Robert Cummings wrote:
>
> > On Sun, 2003-06-29 at 14:19, Sterling Hughes wrote:
> > >
> > > - Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
> > > are no longer bundled with PHP. For more information on these
> > > licensing changes please see the MySQL licensing policy [1]
> > >
> > > [1] http://www.mysql.com/products/licensing.html
> >
> > I read the licensing information in the above link, but I'm curious what
> > exactly in it necessitated the need to unbundle MySQL? Anyone have a
> > quick answer?
>
> It's GPL.
>
> Derick
>
> --
> "Interpreting what the GPL actually means is a job best left to those
> that read the future by examining animal entrails."
> -------------------------------------------------------------------------
> Derick Rethans http://derickrethans.nl/
> International PHP Magazine http://php-mag.net/
> -------------------------------------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'
--- End Message ---
--- Begin Message ---
> On Sun, 29 Jun 2003, Robert Cummings wrote:
>
> > On Sun, 2003-06-29 at 14:19, Sterling Hughes wrote:
> > >
> > > - Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
> > > are no longer bundled with PHP. For more information on these
> > > licensing changes please see the MySQL licensing policy [1]
> > >
> > > [1] http://www.mysql.com/products/licensing.html
> >
> > I read the licensing information in the above link, but I'm curious what
> > exactly in it necessitated the need to unbundle MySQL? Anyone have a
> > quick answer?
Note that the bundled library code was removed due to being
unmaintained. The old bundled library code was in the public
domain and thus not subject to the GPL. Only the MySQL 4
library is GPLed; the MySQL 3 library is not.
It is unfortunate that some people try to confuse the public
about this topic.
- Sascha
--- End Message ---
--- Begin Message ---
Hello,
On 06/29/2003 04:16 PM, Sascha Schumann wrote:
- Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
are no longer bundled with PHP. For more information on these
licensing changes please see the MySQL licensing policy [1]
[1] http://www.mysql.com/products/licensing.html
I read the licensing information in the above link, but I'm curious what
exactly in it necessitated the need to unbundle MySQL? Anyone have a
quick answer?
Note that the bundled library code was removed due to being
unmaintained. The old bundled library code was in the public
domain and thus not subject to the GPL. Only the MySQL 4
library is GPLed; the MySQL 3 library is not.
It is unfortunate that some people try to confuse the public
about this topic.
Many people think that all Open Source software has a GPL license. I
guess it is that old Lenine say, if you repeat the same lie many times,
it becomes the truth, that today is known as propaganda. Credits for
this "Open Source lie" should go to RMS.
Anyway, MySQL 3 library seems to work perfectly to connect to MySQL 4
servers. What are MySQL 4 client library advantages?
Anyone thought of keep the bundle of MySQL 3 library? Was there a
problem, or is this unbundling initiative a sort of protest to make
MySQL AB reconsider MySQL 4 client library licensing?
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
Hello,
I am trying to get a time calculation using:
$tot_time = ($data['end_time'] - $data['start_time']);
The end_time & start_time are stored in a db as column type of time.
I want to output the difference as a difference expressed in time
format: 10:05:23 - 09:45:32 = 00:39:51
Do I need to break the stored time values apart and do calcs on each
segment? I am not storing the calculated time.
Larry R. Sieting
--- End Message ---
--- Begin Message ---
On Monday 30 June 2003 03:19, Larry R. Sieting wrote:
> I am trying to get a time calculation using:
>
> $tot_time = ($data['end_time'] - $data['start_time']);
>
> The end_time & start_time are stored in a db as column type of time.
>
> I want to output the difference as a difference expressed in time
> format: 10:05:23 - 09:45:32 = 00:39:51
>
> Do I need to break the stored time values apart and do calcs on each
> segment? I am not storing the calculated time.
Your DBMS may very well have time date/time functions built-in that can do
this for you.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Include me out.
*/
--- End Message ---
--- Begin Message ---
I can click links and they work but when I enter data in a form and try to send it to
the next php script to process the data, nothing happens. Is there a simple way I can
see what is returning from the browser to see if what I expect is actually getting
there?? I think $_SERVER['QUERY_STRING'] should do it but I get nothing with that
one...
Any help is GREATLY appreciated.
Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net
--- End Message ---
--- Begin Message ---
On Monday 30 June 2003 04:38, Sparky Kopetzky wrote:
> I can click links and they work but when I enter data in a form and try to
> send it to the next php script to process the data, nothing happens. Is
> there a simple way I can see what is returning from the browser to see if
> what I expect is actually getting there?? I think $_SERVER['QUERY_STRING']
> should do it but I get nothing with that one...
Stick in phpinfo() at the top of your script.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
A real person has two reasons for doing anything ... a good reason and
the real reason.
*/
--- End Message ---
--- Begin Message ---
OK, I see that I have to use $_POST['user_name'] or can I just use the
variable passed back $user_name which would be a heck of a lot simpler??
Sparky
----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 29, 2003 14:56
Subject: Re: [PHP] ARGHHH!!! POST variable problem
> On Monday 30 June 2003 04:38, Sparky Kopetzky wrote:
> > I can click links and they work but when I enter data in a form and try
to
> > send it to the next php script to process the data, nothing happens. Is
> > there a simple way I can see what is returning from the browser to see
if
> > what I expect is actually getting there?? I think
$_SERVER['QUERY_STRING']
> > should do it but I get nothing with that one...
>
> Stick in phpinfo() at the top of your script.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> A real person has two reasons for doing anything ... a good reason and
> the real reason.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
On Sunday 29 June 2003 05:07 pm, Sparky Kopetzky wrote:
> OK, I see that I have to use $_POST['user_name'] or can I just use the
> variable passed back $user_name which would be a heck of a lot simpler??
If you have register_globals set to "on" in php.ini, then yes, you can use
$user_name. Otherwise, no.
Default is register_globals= Off for PHP >= 4.2.0
http://us2.php.net/register_globals
RDB
> Sparky
> ----- Original Message -----
> From: "Jason Wong" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, June 29, 2003 14:56
> Subject: Re: [PHP] ARGHHH!!! POST variable problem
>
> > On Monday 30 June 2003 04:38, Sparky Kopetzky wrote:
> > > I can click links and they work but when I enter data in a form and try
>
> to
>
> > > send it to the next php script to process the data, nothing happens. Is
> > > there a simple way I can see what is returning from the browser to see
>
> if
>
> > > what I expect is actually getting there?? I think
>
> $_SERVER['QUERY_STRING']
>
> > > should do it but I get nothing with that one...
> >
> > Stick in phpinfo() at the top of your script.
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.biz
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> > ------------------------------------------
> > Search the list archives before you post
> > http://marc.theaimsgroup.com/?l=php-general
> > ------------------------------------------
> > /*
> > A real person has two reasons for doing anything ... a good reason and
> > the real reason.
> > */
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
--
-------------------------------------------------
/"\ ASCII Ribbon Campaign against HTML
\ / email and proprietary format
X attachments.
/ \
-------------------------------------------------
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-------------------------------------------------
--- End Message ---
--- Begin Message ---
At 22:38 29-6-2003, you wrote:
I can click links and they work but when I enter data in a form and try to
send it to the next php script to process the data, nothing happens. Is
there a simple way I can see what is returning from the browser to see if
what I expect is actually getting there?? I think $_SERVER['QUERY_STRING']
should do it but I get nothing with that one...
Any help is GREATLY appreciated.
Robin E. Kopetzky
Black Mesa Computers/Internet Services
please check the PHP4.1.0 release notes, paragraph 'new input mechanism'.
http://www.php.net/release_4_1_0.php
most existing scripts and manuals expect 'register_globals' in php.ini to
be 'on'.
--- End Message ---
--- Begin Message ---
Jason:
THANK YOU!!! phpinfo is helping out big time. I never thought of using
it for debugging but I finally got it working. Have a cold brewski on me for
the save!!
Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net
----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 29, 2003 14:56
Subject: Re: [PHP] ARGHHH!!! POST variable problem
> On Monday 30 June 2003 04:38, Sparky Kopetzky wrote:
> > I can click links and they work but when I enter data in a form and try
to
> > send it to the next php script to process the data, nothing happens. Is
> > there a simple way I can see what is returning from the browser to see
if
> > what I expect is actually getting there?? I think
$_SERVER['QUERY_STRING']
> > should do it but I get nothing with that one...
>
> Stick in phpinfo() at the top of your script.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> A real person has two reasons for doing anything ... a good reason and
> the real reason.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi,
is it possible to close the connection to the client/browser without calling
exit?
I have an input-script for a chat-system, wich gives a Status 204 No Content
to the client after submit, wich works great. The problem is, that sometimes
the script needs some time to finish after sending the 204 and keeps the
connection over this time, wich couses Internet Explorer and sometimes even
Mozilla to crash if too much connections to the script are active.
Thanks,
Thomas 'Neo' Weber
---
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
On Sun, 29 Jun 2003 23:41:09 +0200, you wrote:
>is it possible to close the connection to the client/browser without calling
>exit?
>I have an input-script for a chat-system, wich gives a Status 204 No Content
>to the client after submit, wich works great. The problem is, that sometimes
>the script needs some time to finish after sending the 204 and keeps the
>connection over this time, wich couses Internet Explorer and sometimes even
>Mozilla to crash if too much connections to the script are active.
You want to finish up the connection but keep the script around. Hmm... how
about putting your logic into a seperate function, and registering it to be
run on exit with register_shutdown_function()? ("registered shutdown
functions are called after the request has been completed (including sending
any output buffers)")
Or you could move your code into an external script and call it.
--- End Message ---
--- Begin Message ---
on 25/06/03 12:19 PM, Ow Mun Heng ([EMAIL PROTECTED]) wrote:
> Can someone help explain how I can perform a benchmark on the queries or
> whatever?
Write some code, run it many many times, time it with something like Example
1 on http://au.php.net/microtime, then write alternate code, run it many
times, and compare the results.
One will be faster than the other, and you can now make an informed decision
about which is the smarter way to go. If the difference is tiny, then you
could ask yourself which method is easier for you to code and maintain...
My bet is sessions will win both problems (performance and coding
simplicity), but learning how to benchmark your scripts is a vital learning
step...
Justin French
--- End Message ---
--- Begin Message ---
On Sat, 2003-06-28 at 13:10, Jay Fitzgerald wrote:
> I have been writing PHP for almost a year now and someone on phpfreaks told
> me the other day that my code was very sloppy.
>
> Since I want to more more into programming than design, can anyone
> recommend where to learn how to make sure your code is clean, optimized and
> as error-free as it can get? Even if it is the style of how to write the
> code, please let me know....I know noone can be the perfect programmer, but
> I would at least like to be a decent programmer :)
>
> Jay
I would suggest reading some coding standards from, say, the Linux
kernel source, PEAR, and whatever else you can find. They'll disagree
with one another, but you'll get an idea of what kinds of things people
find important.
One book that is simply excellent is 'Code Complete: A Practical
Handbook of Software Construction', by Steve McConnell (Microsoft
Press). It's pretty big but it's well written, easy to read, and
usually presents a few different methods along with discussions and
comparisons.
Some simple tricks with PHP include using a template engine to keep
your code and your output separated (i.e. don't put your PHP code
directly into the HTML or vice versa--even though that's perfectly fine
for small jobs, small jobs always seem to turn into bigger ones); turn
on error_reporting(E_ALL) and ini_set('display_errors', true) when
you're testing (you can turn them off for production) so you can make
sure your script runs with no errors, notices, or warnings; writing
your functions and class methods to rely on globals as little as
possible so they are more easily transferable to new situations; and so
on.
However, the topic is pretty huge, everyone has an opinion, and I'm
sure that for every suggestion I or anyone else makes there are good
arguments against.
Good luck,
Torben
--
Torben Wilson <[EMAIL PROTECTED]> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
--- End Message ---
--- Begin Message ---
on 26/06/03 5:23 PM, Bibhas Kumar Samanta ([EMAIL PROTECTED])
wrote:
> my problem is that when I use sessions in the restricted pages
> the session_start() seem to reset the form ( when other filled in data
> is lost) when go back to the form using
> Back in the browser.
> So I wanted to avoid session_start
This seems like more of a limitation of WHERE you're starting the session,
or a limitation of how your browser deals with forms.
I'm unsure of your exact problem (since you haven't posted a URL for us to
see what's wrong, and you haven't shown us any code), but I can guarantee
that all the large PHP sites use sessions -- your problem is not a problem
with PHP's sessions exactly -- more like a quirk/problem with HOW you've
implemented it I *think*.
Justin
--- End Message ---
--- Begin Message ---
On 25 Jun 2003 at 16:42, Dan Joseph wrote:
> Store that file outside the docroot. That way there is no chance
> they can
> get it from the web site. I myself use an ini file that is no where
> near the docroot, and use parse_ini_file() to load the DB
> information in, and then I connect to it. This method passed our
> security audit with flying colors.
>
> A sample of what my ini file resembles is:
>
> [mysql_info]
> host = 192.168.1.1
> uid = username
> pwd = password
> dbn = database
>
> They end up in a $INI array, and the fields are $INI['host'],
> $INI['uid'],
> etc.. You can read more about that function @ www.php.net.
I am just beginning to use php and mysql together (I'm new to both).
I am having trouble getting this to work in what I think is a very
simple test.
I have created mysql.ini, and put it outside the docroot:
/myhome/mysql.ini. This file, in its entirety, is:
[mysql_info}
host=spore.org
uid=myuserid
passwd=mypassword
Then I created a webpage with nothing more than the following:
<?php
parse_ini_file("/home/revref/mysql.ini");
echo $INI;
?>
When I point my browser to that page, I am getting the following
error message:
Warning: Error parsing /home/revref/mysql.ini on line 4 in Unknown on
line 0
Help is greatly needed.
Doug
--- End Message ---
--- Begin Message ---
Hello,
"Doug Essinger-Hileman" <[EMAIL PROTECTED]> wrote:
> On 25 Jun 2003 at 16:42, Dan Joseph wrote:
>
> > Store that file outside the docroot. That way there is no chance
> > they can
> > get it from the web site. I myself use an ini file that is no where
> > near the docroot, and use parse_ini_file() to load the DB
> > information in, and then I connect to it. This method passed our
> > security audit with flying colors.
> >
> > A sample of what my ini file resembles is:
> >
> > [mysql_info]
> > host = 192.168.1.1
> > uid = username
> > pwd = password
> > dbn = database
> >
> > They end up in a $INI array, and the fields are $INI['host'],
> > $INI['uid'],
> > etc.. You can read more about that function @ www.php.net.
>
> I am just beginning to use php and mysql together (I'm new to both).
> I am having trouble getting this to work in what I think is a very
> simple test.
>
> I have created mysql.ini, and put it outside the docroot:
> /myhome/mysql.ini. This file, in its entirety, is:
>
> [mysql_info}
I think you meant [mysql_info]? (Check the closing bracket.)
> host=spore.org
> uid=myuserid
> passwd=mypassword
>
> Then I created a webpage with nothing more than the following:
>
> <?php
> parse_ini_file("/home/revref/mysql.ini");
> echo $INI;
> ?>
>
There's a good example in the manual:
http://www.php.net/manual/en/function.parse-ini-file.php
Notice that you need to do something like this: (based on your example)
<?php
$INI = parse_ini_file("/home/revref/mysql.ini");
print_r($INI);
?>
- E -
PS
Please check the difference between print_r() and echo() as well...
...[snip]...
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/
--- End Message ---
--- Begin Message ---
For some people, putting information outside the docroot isn't possible,
especially when your site is hosted.
On thing you can also try (which is nowhere near the security of outside
the docroot) is to put ocnfig data (user, pass, etc...) inside it's own
php file that is included in outfiles. For example (assuming that php
parser doesn't fail):
------ configstuff.php ----------
<?php
$user = "myname";
$pass = "mypass";
$db = "mydb";
?>
------ end ----------------------
- Edwin - wrote:
Hello,
"Doug Essinger-Hileman" <[EMAIL PROTECTED]> wrote:
On 25 Jun 2003 at 16:42, Dan Joseph wrote:
Store that file outside the docroot. That way there is no chance
they can
get it from the web site. I myself use an ini file that is no where
near the docroot, and use parse_ini_file() to load the DB
information in, and then I connect to it. This method passed our
security audit with flying colors.
A sample of what my ini file resembles is:
[mysql_info]
host = 192.168.1.1
uid = username
pwd = password
dbn = database
They end up in a $INI array, and the fields are $INI['host'],
$INI['uid'],
etc.. You can read more about that function @ www.php.net.
I am just beginning to use php and mysql together (I'm new to both).
I am having trouble getting this to work in what I think is a very
simple test.
I have created mysql.ini, and put it outside the docroot:
/myhome/mysql.ini. This file, in its entirety, is:
[mysql_info}
I think you meant [mysql_info]? (Check the closing bracket.)
host=spore.org
uid=myuserid
passwd=mypassword
Then I created a webpage with nothing more than the following:
<?php
parse_ini_file("/home/revref/mysql.ini");
echo $INI;
?>
There's a good example in the manual:
http://www.php.net/manual/en/function.parse-ini-file.php
Notice that you need to do something like this: (based on your example)
<?php
$INI = parse_ini_file("/home/revref/mysql.ini");
print_r($INI);
?>
- E -
PS
Please check the difference between print_r() and echo() as well...
...[snip]...
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/
--- End Message ---
--- Begin Message ---
On 30 Jun 2003 at 10:25, - Edwin - wrote:
> > [mysql_info}
>
> I think you meant [mysql_info]? (Check the closing bracket.)
It is correct on the server. My fingers didn't type what my brain
told
them to for this email.
> Notice that you need to do something like this: (based on your
> example)
>
> <?php
>
> $INI = parse_ini_file("/home/revref/mysql.ini");
> print_r($INI);
>
> ?>
This leads to the following output:
Warning: Error parsing /mydirectory/mysql.ini on line 4 in Unknown on
line 0 Array ( [host] => spore.org [uid] => myuserid [passwd] =>
mypassword)
The error message still remains, though now the test confirms that
mysql.ini is being parsed.
> PS
> Please check the difference between print_r() and echo() as well...
Thanks for the tip. I have read the manual for both of these.
Doug
--- End Message ---
--- Begin Message ---
The INI file should be:
[mysql_info]
host=spore.org
uid=myuserid
passwd=mypassword
Also, you'll probably want to do:
$INI = parse_ini_file("/home/revref/mysql.ini");
Doug Essinger-Hileman wrote:
I am just beginning to use php and mysql together (I'm new to both).
I am having trouble getting this to work in what I think is a very
simple test.
I have created mysql.ini, and put it outside the docroot:
/myhome/mysql.ini. This file, in its entirety, is:
[mysql_info}
host=spore.org
uid=myuserid
passwd=mypassword
Then I created a webpage with nothing more than the following:
<?php
parse_ini_file("/home/revref/mysql.ini");
echo $INI;
?>
When I point my browser to that page, I am getting the following
error message:
Warning: Error parsing /home/revref/mysql.ini on line 4 in Unknown on
line 0
Help is greatly needed.
Doug
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt
to decrypt it will be prosecuted to the full extent of the law.
--- End Message ---
--- Begin Message ---
"Doug Essinger-Hileman" <[EMAIL PROTECTED]> wrote:
[snip]
>
> This leads to the following output:
>
> Warning: Error parsing /mydirectory/mysql.ini on line 4 in Unknown on
> line 0 Array ( [host] => spore.org [uid] => myuserid [passwd] =>
> mypassword)
>
> The error message still remains, though now the test confirms that
> mysql.ini is being parsed.
>
[/snip]
Hmm... it could be that the (real) passwords you're using contains non-alphanumeric
characters. Try using double-quotes like:
passwd="mypassword"
- E -
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/
--- End Message ---
--- Begin Message ---
On 30 Jun 2003 at 11:20, - Edwin - wrote:
> > Warning: Error parsing /mydirectory/mysql.ini on line 4 in Unknown
> > on line 0 Array ( [host] => spore.org [uid] => myuserid [passwd] =>
> > mypassword)
> >
> > The error message still remains, though now the test confirms that
> > mysql.ini is being parsed.
> >
> [/snip]
>
> Hmm... it could be that the (real) passwords you're using contains
> non-alphanumeric characters. Try using double-quotes like:
>
> passwd="mypassword"
Bingo. Thanks.
Doug
--- End Message ---
--- Begin Message ---
I'm having a problem with the value that isset returns on $_SESSION
variables. For some reason, even if $_SESSION['uid'] is set, isset
returns FALSE. Here is the code:
------ file1.php -----------
include "file2.php";
if (!isset($_SESSION["uid"])) {
// This first time $_SESSION["uid"] is check, we should
// end up in here. However, ValidAdminLogin (next test)
// will set $_SESSION["uid"] so next time we will not
// get here.
if ( !ValidAdminLogin($_POST["adminid"],$_POST["adminpass"]))
forceadminlogin();
} elseif ( !ValidAdminSession() )
forceadminlogin();
// this is done to show that $_SESSION["uid"] is being set
// but isset still returns false
echo $_SESSION["uid"];
------ file2.php -----------
function ValidAdminLogin($user, $pass){
global $_SESSION;
if (The_MYSQL_Stuff_Is_NOT_OK) return false;
else
{
session_start();
$_SESSION["logged"] = true;
$_SESSION["username"] = $user;
$_SESSION["adminlogin"] = true;
$_SESSION["fname"] = $fname;
$_SESSION["lname"] = $lname;
$_SESSION["email"] = $email;
$_SESSION["uid"] = session_id();
return true;
}
mysql_close();
}
--- End Message ---
--- Begin Message ---
Hi all,
I used to have a bookmark for how php.net's custom 404/redirect/search
script worked, but I can't find it now, and can't see it on php.net... has
anyone got a link?
Not sure if it was on zend.com or php.net.
TIA
Justin
--- End Message ---
--- Begin Message ---
Would anyone happen to know what http_user_agent would be if the user is
visitng from an internet enabled cell phone (e.g. sprint pcs phone or
similar)?
Thank you
--- End Message ---