php-general Digest 4 Feb 2001 15:14:52 -0000 Issue 492

Topics (messages 38021 through 38108):

IIS & ISAPI
        38021 by: Shane McBride
        38025 by: Chris Fry
        38028 by: Shane McBride

Re: Re:What version of Linux?
        38022 by: John Hinsley
        38100 by: Christian Reiniger

Compile error w/ libextra.a (ranlib)
        38023 by: Doug Taylor

php_imap4r2.dll not loaded ?!?!  (win2k)
        38024 by: Eelco de Vries

Session With Cookies
        38026 by: phpLover
        38030 by: Shane McBride
        38084 by: Eelco de Vries
        38085 by: Julie Meloni
        38087 by: Eelco de Vries
        38093 by: Lux

Replacing A Word in HTML page
        38027 by: phpLover
        38081 by: Steve Werby

HTTP Authentication w/IIS
        38029 by: Shane McBride

Multi-Dimensional Array Problems
        38031 by: Toby Miller

Re: Stringing sql queries?
        38032 by: Randy Johnson
        38092 by: PHPBeginner.com

Re: Oracle Function list
        38033 by: Richard Lynch

Re: trouble with reading session variables: BUG?
        38034 by: Richard Lynch

Re: disabling page caching, yes or no
        38035 by: Richard Lynch

Re: About function Include
        38036 by: Richard Lynch

Re: check email exists under Windows NT!
        38037 by: Richard Lynch

Re: Bcc email does not work
        38038 by: Richard Lynch

Re: REGULAR EXPRESSION
        38039 by: Richard Lynch

Re: php changing passwd from unixusers?
        38040 by: Richard Lynch

Re: Oracle8 OciLogon !
        38041 by: Richard Lynch

Re: Pricing for PHP programming???
        38042 by: Richard Lynch
        38045 by: Richard Lynch

Re: imap (nntp) message tracking
        38043 by: Richard Lynch

Re: Program execution
        38044 by: Richard Lynch

Re: Loading Files & Writing...
        38046 by: Richard Lynch

Re: new mail() function
        38047 by: Richard Lynch

Re: Win2K/PHP4.0.4pl1 - include_path mess (won't include from the current directory)
        38048 by: Richard Lynch

Re: Inappropriate ioctl for device
        38049 by: Richard Lynch

Re: Image
        38050 by: Richard Lynch

Re: How does memory limit work?
        38051 by: Richard Lynch

Re: Odd problem
        38052 by: Richard Lynch

Re: Performance hit with certain apache configs?
        38053 by: Richard Lynch

Re: Java variables - PHP varialbles
        38054 by: Richard Lynch

Re: Email Attachment
        38055 by: Richard Lynch

Re: Transitioning from php3 to php4
        38056 by: Richard Lynch

Re: errors when included functions call functions
        38057 by: Richard Lynch

Re: rephrasing: start session in frame-index, continue in pages
        38058 by: Richard Lynch

Re: Dnloading FDF docs / acrobat integration
        38059 by: Richard Lynch

Re: PHP a lightweight language?
        38060 by: Richard Lynch

Re: Php Database
        38061 by: Richard Lynch

Re: Mysql Question
        38062 by: Richard Lynch

Re: Zend Debug Server
        38063 by: Richard Lynch

Re: pg_Exec:  Warning: 1 is not a valid PostgreSQL link resource.
        38064 by: Richard Lynch

Re: duplicate entries in mysql column
        38065 by: Richard Lynch

Re: Probem with headers. HELP ME!!!
        38066 by: Richard Lynch

Re: Data Entry From Listbox
        38067 by: Richard Lynch

Re: fucntion if not working bug error
        38068 by: Richard Lynch

Re: exec() won't start SAS job
        38069 by: Richard Lynch

Re: i want permanently connect in imap_open()
        38070 by: Richard Lynch

Re: Immediately write me!! Row size in mysql
        38071 by: Richard Lynch

Re: apache/SUexec/PHP
        38072 by: Richard Lynch

Re: Select list with PHP
        38073 by: Richard Lynch
        38101 by: Gerry

Re: sessions without cookies
        38074 by: Richard Lynch

Re: php-nuke?
        38075 by: Richard Lynch
        38091 by: PHPBeginner.com

Re: Oracle sessions
        38076 by: Richard Lynch

Re: my bugaboo.
        38077 by: Richard Lynch
        38086 by: Matt

Re: Bah, XML
        38078 by: Andrew Golovin

Is this a missing feature?
        38079 by: John Luxford
        38099 by: Christian Reiniger

Sydney Australia PHP meet talk brag See phpsydney.com for details
        38080 by: PHP Sydney

% operator
        38082 by: Dhaval Desai
        38083 by: Eelco de Vries

Re: getimagesize question
        38088 by: PHPBeginner.com

Re: Undefined variable
        38089 by: PHPBeginner.com

Re: PHP hosting - the final frontier.
        38090 by: PHPBeginner.com

Working with email piped to PHP
        38094 by: Roy Wilson, Jr.
        38095 by: James Moore

Re: CGI vs PHP
        38096 by: Christian Reiniger

Re: Problem compiling PHP4 Nr. 2
        38097 by: Christian Reiniger

PHP code beautifier?
        38098 by: Maciek Uhlig

Re: Select list with PHP/oops!
        38102 by: Gerry

HTTP compression
        38103 by: Alain Fontaine
        38104 by: Rasmus Lerdorf
        38107 by: Alain Fontaine

Re: XML - XSL with PHP
        38105 by: Rasmus Lerdorf

Arrays from forms
        38106 by: Jamie

Re: Future plans (4.1) ?
        38108 by: Robert Mena

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]


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


I have loaded PHP according to the install file but I can not see any .php file in a 
browser.

When I look under the ISAPI properties in IIS is appears that the dll is not loading. 
It has a red arrow pointing down.

Any ideas?

shane




Shane,

Had the same problem - move the dll into the php directory - doesn't seem to work in 
the sapi dir.

Also you need to set the root dir in php.ini

Chris

Shane McBride wrote:

> I have loaded PHP according to the install file but I can not see any .php file in a 
>browser.
>
> When I look under the ISAPI properties in IIS is appears that the dll is not 
>loading. It has a red arrow pointing down.
>
> Any ideas?
>
> shane

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.





Yea I had to move the php4ts.dll dile to the winnt directory. Thanks.

Have you every tried to get authentication to work using PHP as isapi?

----- Original Message -----
From: "Chris Fry" <[EMAIL PROTECTED]>
To: "Shane McBride" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, February 03, 2001 11:24 PM
Subject: Re: [PHP] IIS & ISAPI


> Shane,
>
> Had the same problem - move the dll into the php directory - doesn't seem
to work in the sapi dir.
>
> Also you need to set the root dir in php.ini
>
> Chris
>
> Shane McBride wrote:
>
> > I have loaded PHP according to the install file but I can not see any
.php file in a browser.
> >
> > When I look under the ISAPI properties in IIS is appears that the dll is
not loading. It has a red arrow pointing down.
> >
> > Any ideas?
> >
> > shane
>
> --
> Chris Fry
> Quillsoft Pty Ltd
> Specialists in Secure Internet Services and E-Commerce Solutions
> 10 Gray Street
> Kogarah
> NSW  2217
> Australia
>
> Phone: +61 2 9553 1691
> Fax: +61 2 9553 1692
> Mobile: 0419 414 323
> eMail: [EMAIL PROTECTED]
> http://www.quillsoft.com.au
>
> You can download our Public CA Certificate from:-
> https://ca.secureanywhere.com/htdocs/cacert.crt
>
> **********************************************************************
>
> This information contains confidential information intended only for
> the use of the authorised recipient.  If you are not an authorised
> recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> e-mail.
> In this case, you should not read, print, re-transmit, store or act
> in reliance on this e-mail or any attachments, and should destroy all
> copies of them.
> This e-mail and any attachments may also contain copyright material
> belonging to Quillsoft Pty Ltd.
> The views expressed in this e-mail or attachments are the views of
> the author and not the views of Quillsoft Pty Ltd.
> You should only deal with the material contained in this e-mail if
> you are authorised to do so.
>
> This notice should not be removed.
>
>






        Christian Reiniger <[EMAIL PROTECTED]> wrote:

> Well, my home server is a wimpy P90 with 48MB RAM. It serves as web 
> server (all my technical docs, php website testing, more), web cache 
> (WWWoffle), web filter (junkbuster), file server (nfs and samba), 
> masquerading internet gateway, firewall, mail server (also processing my 
> pretty big .procmailrc), print server and propably also something else :)
> Ah, yes. MySQL for my php stuff also runs on it.

That's pretty impressive!

 
> The only problem I have with its performance is that it's only connected 
> to my other machines via 10 MBit ethernet (well, and the ram is a bit on 
> the low side). The processor's limits aren't reached by a long shot.

It'd be interesting to do some benchmarking on it. My guess (nothing
more) is that the limitations are RAM, disk read/write speed and network
speed in that order.

 
> > The 486 could be used as a Windows box connected to the server and/or
> > as an X client (in which case 32Mb of RAM would be just fine).
> 
> I'd say a combination of good text editor + browser requires more 
> resources than a apache+PHP+mysql in such a scenario. And don't forget 
> that you have to sit in front of the development (client) box all day and 
> getting a decent graphics card for a 486 is *hard*

Yes, I must admit that while I find an VGA display on Windows just about
acceptable, it's not something I would like to live with permanently.
But I think that Win 98 + 32Mb + Xclient (maybe with the Windows version
of Gvim as editor) should be workable.

Of course, the reason that 486s are being abandoned (apart from hype)
are mainly down to the lack of decent video cards and the
price/compatability issues surrounding memory. (Which gives Penguin
heads the chance to snap them up for next to nothing and turn them into
print servers, firewalls, and routers!)

-- 
******************************************************************************
Marx: "Why do Anarchists only drink herbal tea?"
Proudhon: "Because all proper tea is theft."
******************************************************************************




On Sunday 04 February 2001 05:03, John Hinsley wrote:

> > Well, my home server is a wimpy P90 with 48MB RAM. It serves as web
> > server (all my technical docs, php website testing, more), web cache
[...]
> > else :) Ah, yes. MySQL for my php stuff also runs on it.
>
> That's pretty impressive!

Well, Linux makes it possible *cough* :)

> > The only problem I have with its performance is that it's only
> > connected to my other machines via 10 MBit ethernet (well, and the
> > ram is a bit on the low side). The processor's limits aren't reached
> > by a long shot.
>
> It'd be interesting to do some benchmarking on it. My guess (nothing
> more) is that the limitations are RAM, disk read/write speed and
> network speed in that order.

disk r/w speed isn't really an issue. If it is, it's because the machine 
doesn't have enough RAM to buffer the stuff. Network speed should be at 
the top of that list for fileserving, but for PHP stuff 10MBit is 
completely sufficient.
Processor performance *is* somehow a point for PHP - on my more complex 
pages I have script parsing times of 0.5-0.7 seconds, plus 1-1.5s for DB 
queries, output generation etc (yes, I do cache such heavy pages. just 
took that as example)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead




Hello,

I am attempting to take over development and maintenance of a very neglected
website (and with your donation of only 50¢ per day...).  The site contained
code which was originally thought to be some proprietary, modified version
of PHP (which really pissed me off!)... but eventually it was discovered
that this was merely the somewhat out of date and rarely seen _PHP2_ (phew,
I guess...).

So I need to get hosting support for this site up ASAP. I will need support
for both PHP2 and PHP4 (which I will be converting the code to) and both
msql and mysql (again, converting from the former to the latter).  Seeing as
how there are several hundred pages on the site, in various states of decay
and coded by various individuals, batch replacements and regular expressions
will not readily handle the conversion, thus necessitating the PHP2 and
msql.  I have one and only one server available for this site (including for
my conversion development), thus necessitating the PHP4 and mysql.

So I'm trying to compile apache w/ the following command (oh, did I mention
I'm adding SSL too?):

[root@machine apache_1.3.14]# SSL_BASE=../openssl-0.9.6
RSA_BASE=/rsaref-2.0/local ./configure --enable-module=ssl
--activate-module=src/modules/php4/libphp4.a --enable-module=php4
--activate-module=src/modules/extra/libphp.a --enable-module=php
--prefix=/usr/local/apache --enable-shared=ssl

...
configuration output... blah blah blah
...

[root@machine apache_1.3.14]# make

it goes through several directories compiling successfully, including
/modules/php4 and modules/extra (which is where PHP2 is).

Then I get the following error:

gcc -c  -I./os/unix -I./include   -DLINUX=2 -DMOD_SSL=207101
-I/usr/local/source/php-4.0.3pl1 -I/usr/local/source/php-4.0.3pl1/main
-I/usr/local/source/php-4.0.3pl1/main -I/usr/local/source/php-4.0.3pl1/Zend
-I/usr/local/source/php-4.0.3pl1/Zend -I/usr/local/source/php-4.0.3pl1/TSRM
-I/usr/local/source/php-4.0.3pl1/TSRM -I/usr/local/source/php-4.0.3pl1
-DEAPI -DUSE_EXPAT -I./lib/expat-lite `./apaci` buildmark.c
gcc  -DLINUX=2 -DMOD_SSL=207101 -I/usr/local/source/php-4.0.3pl1
-I/usr/local/source/php-4.0.3pl1/main -I/usr/local/source/php-4.0.3pl1/main
-I/usr/local/source/php-4.0.3pl1/Zend -I/usr/local/source/php-4.0.3pl1/Zend
-I/usr/local/source/php-4.0.3pl1/TSRM -I/usr/local/source/php-4.0.3pl1/TSRM
-I/usr/local/source/php-4.0.3pl1 -DEAPI -DUSE_EXPAT -I./lib/expat-lite
`./apaci`   -rdynamic \
     -o httpd buildmark.o modules.o modules/standard/libstandard.a
modules/php4/libphp4.a modules/extra/libextra.a main/libmain.a
./os/unix/libos.a ap/libap.a  lib/expat-lite/libexpat.a
-Wl,-rpath,/usr/local/Hughes/lib -Wl,-rpath,/usr/local/mysql/lib/mysql
-rdynamic -L/usr/local/Hughes/lib -L/usr/local/mysql/lib/mysql
-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4  -lpam  -
ldl -lmysqlclient -lz -lmsql -lgd -lresolv -lm -ldl -lcrypt -lnsl  -lresolv
-lm -lcrypt -ldl

modules/extra/libextra.a: could not read symbols: Archive has no index; run
ranlib to add one
collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/usr/local/source/apache_1.3.14/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/local/source/apache_1.3.14'
make: *** [build] Error 2
[root@machine apache_1.3.14]#


Now, I've searched the archives and found references to the
"modules/extra/libextra.a: could not read symbols: Archive has no index; run
ranlib to add one" error... but no solution.  The one exception was someone
who was screwing up because they were trying to use libextra.a as part of a
PHP3 install, not a PHP2 install.  Duh.  Unfortunately that's not the case
here.

Any assistance would be appreciated, and yes, I have tried the obvious:
ranlib /path/to/modules/extra/libextra.a

FWIW, this is ranlib version "GNU ranlib 2.9.5"

Any assistance appreciated, TIA...

-- 
Doug Taylor
Lead Web Developer
Enabled Sites
331 Soquel Ave, Suite 205
Santa Cruz, CA 95062 





Hello,

I'm trying to use some POP3 functions and the manual states I would need to
use the IMAP functions.
So I uncommented the ";extension=php_imap4r2.dll" line in my
"c:\winnt\php.ini" file. But it gave me the following error:

"Unable to load dynamic library './php_imap4r2.dll' - The specified module
could not be found".


I read I needed the download install the "imap-4.5.tar" module. The README
file has only instructions how to "make" it for UNIX. The default "MakeFile"
is for UNIX. So I tried to clown around and rename "MakeFile.nt" to
"MakeFile" and make it. But I only get errors:

Could Not Find D:\temp\imap-4.5\c-client\LINKAGE.*
NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return code '0x2'
Stop.


I also tried this with the "MakeFile.ntk" (don't know what ntk stands for),
but no fix.
Can anybody help me with this problem?

Regards;
Eelco.





How can I maintain a user session using cookies?

Thanks






Try this:

// Set Cookie if not already set
 if (!isset($user_id)) {
  $token = md5(uniqid(rand()));
  setcookie("user_id", $token, time()+3600,"/",".yourdomain.com");
 }

look at the setcookie function on php.net to figure out all the parameters:
http://www.php.net/manual/en/function.setcookie.php

-Shane

----- Original Message ----- 
From: "phpLover" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 03, 2001 11:25 PM
Subject: [PHP] Session With Cookies


> How can I maintain a user session using cookies?
> 
> Thanks
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]






This will store a cookie with a userid and an unique number ($token) as
session-id (??).
If I'm not mistaken, this session-id is not checked here. Thus serves no
purose. Anybody who retrieve the cookie from the cookie file on the system
can use it to resume the session (if done within the set 3600sec.). Even if
the browser has been closed.

In case of login/password required sites, I use the login and password as
cookie values and have _no_ expiredate set. Every time a request is made
_both_ cookie values (login and password) are checked with that on the
server. When the browser is closed, the cookie is gone.
It works but I think it's quite an unconventional way ... any
suggestions/comments on this method?

Cheers;
Eelco.


> Try this:
>
> // Set Cookie if not already set
>  if (!isset($user_id)) {
>   $token = md5(uniqid(rand()));
>   setcookie("user_id", $token, time()+3600,"/",".yourdomain.com");
>  }
>
> look at the setcookie function on php.net to figure out all the
> parameters:
> http://www.php.net/manual/en/function.setcookie.php
>
> -Shane
>
> ----- Original Message -----
> From: "phpLover" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, February 03, 2001 11:25 PM
> Subject: [PHP] Session With Cookies
>
>
> > How can I maintain a user session using cookies?
> >
> > Thanks
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





Eelco de Vries wrote:

> This will store a cookie with a userid and an unique number ($token) as
> session-id (??).
> If I'm not mistaken, this session-id is not checked here. Thus serves no
> purose. Anybody who retrieve the cookie from the cookie file on the system
> can use it to resume the session (if done within the set 3600sec.). Even if
> the browser has been closed.

>> 
>> // Set Cookie if not already set
>>  if (!isset($user_id)) {
>>   $token = md5(uniqid(rand()));
>>   setcookie("user_id", $token, time()+3600,"/",".yourdomain.com");
>>  }

The example here has nothing to do with sessions, you are correct.  The 
person who replied to you simply gave you a code snippet from one of my 
books that assigns a unique id via a cookie.  It does not map to a PHP 
session.

As to your case:

> In case of login/password required sites, I use the login and password as
> cookie values and have _no_ expiredate set. Every time a request is made
> _both_ cookie values (login and password) are checked with that on the
> server.

I would hope that you are not storing and matching the user's plaintext 
password...

+----------------------------------------+
| Julie Meloni ([EMAIL PROTECTED])     |
|                                        |
| "PHP Essentials" and "PHP Fast & Easy" |
|       http://www.thickbook.com         |
+----------------------------------------+





> > In case of login/password required sites, I use the login and
> password as
> > cookie values and have _no_ expiredate set. Every time a request is made
> > _both_ cookie values (login and password) are checked with that on the
> > server.
>
> I would hope that you are not storing and matching the user's plaintext
> password...
>

Well .. I am ... nobody but the user itself can see the login and password
in the cookie. Unless it's on non-SSL connection and somebody is
packet-shiffing around. Otherwise there would be no leak for somebody else
to get this information, is there?
And if the user doesn't logout, the cookie is still destroyed when the
browser is closed anyway.

Eelco.





It's unlikely I suppose, but there's a must-have book you should look at 
if you want info on hacks, including browser hacks (Hacking Exposed: 
Network Security Secrets and Solutions, 2nd Edition).  The cookie hack 
that comes to mind only works in IE or MS products (but that's only 
what, 90% of the web), but all it is is a line or so of html code that 
somebody places on their site (say in an iframe...) that sends them all 
your cookie data (if the user uses outlook, they can also just place it 
in an email).  from there, they use the cookie data to pose as that 
person on various sites trying to gain sensitive info.  but if you're 
already giving them the password, how much more sensitive can you get?

so really, if they don't close their browser for a while, this 
possibility increases.  and it may be a slim possibility, but it's 
better to be safe than sorry.

later

lux

> Well .. I am ... nobody but the user itself can see the login and password
> 
> in the cookie. Unless it's on non-SSL connection and somebody is
> 
> packet-shiffing around. Otherwise there would be no leak for somebody else
> 
> to get this information, is there?
> 
> And if the user doesn't logout, the cookie is still destroyed when the
> 
> browser is closed anyway.
> 
> 
> 
> Eelco.


-- 

John Luxford
Simian Systems

w: www.simian.ca
e: [EMAIL PROTECTED]
p: 204.946.5955

--





I want to read an HTML page from another site and replace certain characters
with capital letters and show them in another dynamically generated web page
on my site. I know this is possible in Perl, but can this be done in PHP? If
yes, then how?

Thanks






"phpLover" <[EMAIL PROTECTED]> wrote:
> I want to read an HTML page from another site and replace certain
characters
> with capital letters and show them in another dynamically generated web
page
> on my site. I know this is possible in Perl, but can this be done in PHP?
If
> yes, then how?

It's definitely possible in PHP.  I've done it.  You probably want to use a
combination of fopen() and other file handling functions, eregi_replace()
and str_replace().

--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/





OK, I loaded PHP with the ISAPI filter, but still no luck with authentication..

Here's the basic script that works on Apache/Linux:
<?
// File name: admin_menu.php
 // Check to see if $PHP_AUTH_USER already contains info
 if (!isset($PHP_AUTH_USER)) {
  // If empty, send header causing dialog box to appear
  header('WWW-Authenticate: Basic realm="The Back Care Center Admin Area"');
  header('HTTP/1.0 401 Unauthorized');
  echo 'Authorization Required!';
  exit;
 } else if (isset($PHP_AUTH_USER)) {
  if (($PHP_AUTH_USER !="test") || ($PHP_AUTH_PW !="123")) {
   header('WWW-Authenticate: Basic realm="The Back Care Center Admin Area"');
   header('HTTP/1.0 401 Unauthorized');
   echo 'Authorization Required!';
   exit;
  } else {
   // Start echo statement
   echo "hello";
}
}
?>




Hey all,

I've got this user authentication class that grabs a users profile from the database. 
Anyhow, I need to also insert the groups that this user belongs to along with 
permission settings. I'm having trouble figuring out how to store and read back the 
data. I'm using PHP4. Here's the code:

// Grab the list of groups that this user belongs to
$sql = 'select groupname,a,r,w,d from auth_usergroups where username = "' . $u . '"';
$AUTHSQL .= $sql . '<br>';
$query = mysql_query($sql);

if (mysql_error() != "") {
 $AUTHMSG .= mysql_error() . "<br>";
}

if (mysql_num_rows($query) > 0) {
 $counter = 0;
 $this->group = array();
 while ($rs = mysql_fetch_array($query)) {
  $this->group[$counter] = array(
   "name" => $rs[groupname],
   "a" => $rs[a],
   "r" => $rs[r],
   "w" => $rs[w],
   "d" => $rs[d]
  );
  $counter++;
 }
 mysql_free_result($query);
}

I've tried this in a few different ways and everytime I end up with blank values or 
I'm just not calling them correctly. Can anyone give me a few pointers as to how you 
would go about this? By the way, this is inside the classes initialization function so 
there are other properties like $this->username, $this->firstname, etc. That's why I 
need this to be a multidimensional array.

Thanks,
Toby





What about an insert or an update instead of a select?

thanks

randy

-----Original Message-----
From: Thomas Weber [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 03, 2001 8:37 PM
To: Sandeep Hundal
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Stringing sql queries?


Yep, try this:

SELECT a.col1, a.col2, b.col3, c.col4 FROM table1 a, table2 b, table3 c

This should give you an array [col1,col2,col3,col4]


Thomas Weber
---
EMail: [EMAIL PROTECTED]
Homepage: http://www.youngarts.org / http://www.visions-of-future.de

----- Original Message ----- 
From: "Sandeep Hundal" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Sunday, February 04, 2001 1:44 AM
Subject: [PHP] Stringing sql queries?


> All,
> can I string 2 sql queries one after the other? 
> like "select * from $table; select * from $table2;" ???
> 
> If I can, does that mean if I use mysql_fetch_array then it'll
> convert results from both queries into variables?
> 
> TIA
> 
> 
> __________________________________________________
> Get personalized email addresses from Yahoo! Mail - only $35 
> a year!  http://personal.mail.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






So you are talking about two different queris in one call?

No, you can't do this ...


you have to then use some kind of loop or something ... 



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-----Original Message-----
From: Randy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 04, 2001 2:25 PM
To: Thomas Weber; Sandeep Hundal
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Stringing sql queries?


What about an insert or an update instead of a select?

thanks

randy

-----Original Message-----
From: Thomas Weber [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 03, 2001 8:37 PM
To: Sandeep Hundal
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Stringing sql queries?


Yep, try this:

SELECT a.col1, a.col2, b.col3, c.col4 FROM table1 a, table2 b, table3 c

This should give you an array [col1,col2,col3,col4]


Thomas Weber
---
EMail: [EMAIL PROTECTED]
Homepage: http://www.youngarts.org / http://www.visions-of-future.de

----- Original Message ----- 
From: "Sandeep Hundal" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Sunday, February 04, 2001 1:44 AM
Subject: [PHP] Stringing sql queries?


> All,
> can I string 2 sql queries one after the other? 
> like "select * from $table; select * from $table2;" ???
> 
> If I can, does that mean if I use mysql_fetch_array then it'll
> convert results from both queries into variables?
> 
> TIA
> 
> 
> __________________________________________________
> Get personalized email addresses from Yahoo! Mail - only $35 
> a year!  http://personal.mail.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






> I found a list of some of the Oracle Functions at the main PHP site.  Is
> this all there is?

Probably.  Anything in particular you felt was missing?...

-- 
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> When using Cookies for session management everything works fine (the
> authentication part). But not passing the values of the session variables.
> In the example below the existence of '$ident' is verified. But no chance
to
> get its value: no 'echo' prints out anything! Even isset() denies the
> existence of $HTTP_COOKIE_VARS['ident'].
>
> -- example ------------------------------
>
> session_start();
> if (!session_is_registered('ident')) {
> header ("Location: ../index.php");
> }
> // trying to retrieve $ident which is obviously known to the session
> echo $ident;
> echo $HTTP_COOKIE_VARS['ident'];
> echo $HTTP_SESSION_VARS['ident'];

Registering a variable does not store that variable in a cookie.
Only the users's "session" ID is stored in a cookie.
ident could easily be registered, but be set to ''
We'd need to see ../index.php to have any idea what you've stored in $ident.






> I'm trying to build the first page to a database driven website.  The
first
> thing I'm trying to do is detect if cookies are enabled on the users
> browser, and then, via a header(location: mysite.php), redirect the user
to
> either a cookie supported page, or cookie unsupported page.  I will use
> sessions, in some form or another on each.
> My concern is that this first page, or any following page, not be cached.
> In the #php channel,  it was said, or I understood from what was said,
that
> by default, php pages aren't cached.  It was also mentioned that I should
> make each url unique by using time() or uid of some kind.  In the php
> manual, under Header(), it listed four ways to disable caching. they are:
>
> header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
> header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always
> modified
> header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
> header ("Pragma: no-cache"); // HTTP/1.0
>
> Should I be concerned about page caching? If so, should I use one of the
> header() statements, a combination of header() statements? Can I use a
> combination of header() statements?  The first page can't have a unique
> url.  The following one would be unique by use of sessions I would think,
> but that may not keep them from being cached, would it?

You can use as many headers as you like, though some conflict with each
other.  EG:  Location: and SetCookie() don't play well together.

The 4 headers mentioned will convince most browsers not to cache your page,
but there are always some that are going to mess up.

By forcing each URL to be unique with some random nonsensical part in it,
virtually every browser will be fooled into thinking it's a different page
and won't retrieve an old one from the cache.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I've been using the funcion INCLUDE like this:
> <?include"("/header.htm");?> because file header.htm has to be included
> in a lot of files. I want to use "/" because file header.htm is in main
> directory (like E:) and there are files in very directories above E:.
> But when I have a file in a directory above, like E:folder1/index.html
> and I use the include function in the file index.html, there's next
> error massage: Warning: Failed opening '/header.htm' for inclusion
> (include_path='') in /home2/httpd/htdocs/www/index.html on line 21  .
> Line 21 is the line I had put include function.
> We don't want to use <?include("../header");?> because we have  files in
> other directories, and like that, we had to use
> <?include("../header");?> in one file, <?include("../../header");?> in
> another one, etc.What can we do?

You can provide a full path using "/home2/httpd/htdocs/www/header.htm"

Or, you can set your include path to be
"./:/home2/httpd/htdocs/www/:/any/other/directory/you/like";
in php.ini

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Is it posiible to check that an email exists before confirming a form
> under windows NT ?
> Thanks

There are several email verification scripts floating around in PHP
archives.
Most just make sure the email "looks" good for the usual formats.
None, I think, impelement the full 3-page Regular Expression it would take
to correctly validate an email *just* to see if it conforms to the rules for
a valid email.
A few may actually contact the "server" portion of the email address and ask
that server if it's a valid email.  However, some such servers lie, and say
"Yes" rather than check.
There is no way to be 100% sure the email works.  You have to decide how
important it is to check how carefully.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Have u ever tried to send many emails using Bcc?
> It does not work for me !

Yeah, somewhere around 50 addresses you are choking sendmail.

You'll need something designed for a little more heavy-duty work than the
mail() function.

See Manuel Lemos' mail class, or consider integration with a mailing list
software package.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I 'd like to have an input that contains only a to Z and space and
> ëàéêêàäïüöûâç- nothing else like numbers or whatever and also does not
start
> with space !
> till now with ur help i get the following :
>
> (!ereg("[a-zA-Z[:space:]ëàéêêàäïüöûâç-]", $name))

All those weird characters you typed are not ASCII, and are not valid to
just throw into a string like that.

You can maybe use Regex hex representations of them, but they aren't going
to be the same characters on many people's browsers anyway...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Is it possible using a php -based website to change passwords from
> unixusers?
> Php runs at my system under user: www how can I let it execute: passwd
> and change a password?

I think the passwd shell command requires a real TTY rather than just ol'
PHP.

You could *maybe* do it by having PHP modify the password file directly
rather than through the passwd shell command.

WARNING WARNING WARNING
Having your logins altered by web-visitors is inherently risky.  Think
through all the security issues carefully.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> i use oracle and i always get this error:
> call to undefined function ocilogon()!

That usually means you didn't compile in Oracle support with PHP.

-- 
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Isn't it illegal in the US to discuss
> rates in this manner?
>
> It's always been my understanding that
> The U.S. law specifically makes discussion
> of pricing between competitors (all or some)
> a federal offense.
>
> Am I taking this too literally?

I think so.

First of all, this isn't a US-only forum.
Secondly, the point is to avoid price-fixing.  Given the current status of
the web-design industry, there are far, far too many wannabes out there for
any real price-fixing to be effective.
Thirdly, the variance already presented is rather wide.
Fourthly, this is a public forum where consumers are also welcome to
contribute their thoughts on these pricings, rather than a non-public
collusion of only one side of the potential transactions.
Finally, why don't we wait until the DOJ actually complains about it, after
they finished breaking up Microsoft :-)  More seriously, I don't think the
DOJ is going to take a dim view of this thread, even if they noticed.






> So how do you know what to charge when youre independent and just
starting?

Dart board :-)

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






I think each message has a unique ID generated by the machine that posted
it...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Larry Hotchkiss <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Wednesday, January 31, 2001 12:06 PM
Subject: [PHP] imap (nntp) message tracking


> Can anyone recommend a good (eficient) way of tracking downloaded
> (read) messages from a nntp server? I would like to run a script to
> retrieve a couple news groups and archive them, but I am unsure as to
> the best method of tracking which messages I have. I will likely be
> storing messages in mysql databse and I am using php4. I have been
> playing with a little code and can retrieve a list of messages as well
> as the headers/body etc, I am just unsure how to track message status.
> ANyone have any ideas?
>
>
>
> --
> Larry Hotchkiss
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





>This happens only when I use php as a module:
>When I'd like to run a command with exec or system function I got always
this message
>and the program never executes:
>Warning: Unable to fork [the command's name what I'd like to run] in
filename on line XY

Your OS may have placed an upper bound on the number of processes that are
allowed to run at one time, and you are hitting that...

I think maybe "limit" command affects that...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm







> I have a javascript to edit an html page thatI have written and have
> been searching for a way to load a file into a text box and write the
> contents to a file on the server when done in PHP. Is this possible? Any
> direction is appreciated. Thanks in advance.

<HTML><BODY><FORM METHOD=POST>
<?php
#Untested code:
    $path = "/full/path/to/file/php/can/write/to";
    if (isset($submit)){
        $file = fopen($path, 'w') or die("Unable to write to $path.  Check
permissions.");
        fwrite($file, $text, strlen($text));
        fclose($file);
    }
    $file = fopen($path, 'r') or die("Unable to read from $path.  Check
permissions.");
    $text = fread($file, filesize($path));
?>
    <TEXTAREA NAME=text COLS=60 ROWS=20><?php echo $text;?></TEXTAREA><BR>
    <INPUT TYPE=SUBMIT NAME=submit>
</FORM></BODY></HTML>

The tricky part is Security.  You really don't want a file in the middle of
your web-site that any random surfer can write to...

Using the above code as-is would be pretty foolish under virtually all web
sites.






> I recently downloaded the ArGoSoft mail server that
> someone on this list once suggested when trying to use
> the mail command on a window's system running php.

Another option for a low-traffic mail system might be to download the
Pegasus email client, and use its command-line interface for mail() to talk
to...

Or so I've been told.  Never got around to trying it myself.  Just moved to
Linux where SMTP actually exists as part of the deal.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> in my PHP.ini (which stays under c:\WINNT) I have
>
> include_path = "P:\includes; "                  ; UNIX: "/path1:/path2"
> Windows: "\path1;\path2"
> doc_root = ; the root of the php pages, used only if nonempty
>
> under "P:\includes" are PHPLIB and some few scripts that I need to
> auto_prepend under all the roots on my local server.
>
> PHPLIB is being included properly, but, if I try to include a file within
a
> current directory like:
>
> include ("header.inc");
>
> I get the following error:
>
> Warning: Failed opening 'header.inc' for inclusion
> (include_path='P:\includes; ') in p:\phpbeginner\index.html on line 17
>
> (NOTE: include ("$DOCUMENT_ROOT/header.inc"); will work perfectly )
>
> I know that on Linux to fix the problem would be enough to add something
> like this into PHP.INI
>
> include_path = ".: /full/path/to/includes: "                  ; UNIX:
> "/path1:/path2"  Windows: "\path1;\path2"
>
> How do I do this under Win2K ?

Same thing, only use ; as separator, not :

include_path = "./;P:/includes";

Windows uses ./ and .. the same way Un*x does.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






>
$filename="http://195.92.38.87/cgi-win/homeview.dll?details1?src=1050&Proper
> tyCode=1050003/SAPHI/14665/3";

Shouldn't that second ? be a & instead?...

> $file=fopen($filename,"r") or die("cant open $filename");
> while(!feof($file)){
> $line=fgets($file,4096);
> echo $line;
> }
>
> but when i run it i get an error
>
>
fopen("http://195.92.38.87/cgi-win/homeview.dll?details1?src=1050&PropertyCo
> de=1050003/SAPHI/14665/3","r") -
> Inappropriate ioctl for device in /home/httpd/docs/test.php on line 6
>
> So can someone please tell me, what the blazes an ioctl is and why do i
have
> an inappropriate one?

An ioctl is geek for Input/Output Control, I suspect.

As such, it sounds like 195.92.38.87 is complaining that the wrong kind of
software/hardware is trying to open/read that file.

Exactly what it's using to tell that it's not really a web-browser that's
reading it and it's PHP trying to pretend to be a web-browser, I'm not
sure...  Maybe it's looking at USER_AGENT or something.







> I wonder if anyone can tell me how I can use an another image as an
> background in a new image?

You'll need the GD library (http://boutell.com) and use --with-gd when
compiling.

Once you've installed those, it's a matter of reading the functions at
http://php.net/ in the GD section.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I am trying to prevent my Linux machine from crashing by the use of
> memory_limit, but is does not seem to work as I expect it to: When a
> php-script includes itself recursively by accident it grabbes all memory
> available in a matter of seconds, although I set max_execution_time=30
> and memory_limit=8388608. After 30 seconds of execution the apache
> terminates the request, but the script keeps on running and allocating
> memory (far more than 8 MB). Do I misunderstand the memory_limit option?
> Is there an other way to limit memory usage besides system wide memory
> quotas?

The granularity of the PHP memory limit is rather coarse -- It only checks
for available RAM at specific times.

It's not really designed to stop somebody from doing something quite that,
err, well, silly.  (Or perhaps malicioius?)  It's more of a convenience for
beginning scripters to not kill themselves with infinite loops.

Also, the memory quota was broken in some not-too-old versions of PHP.
Check your version and search http://bugs.php.net

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Apache on Solaris 2.6, suEXEC, PHP 3.0.15 as a CGI (not mod_php).
> I'm seeing this sort of thing in my Apache error logs.
>
> failed to open log file
> fopen: Permission denied
> [Thu Feb  1 04:28:33 2001] [error] [client 192.168.1.15] Premature end of
script headers: /usr/local/mailman/cgi-bin/test.php3
>
> test.php3 contains only:
>
>   <?php header("Content-type: text/plain"); print "foo\n"; ?>

Check what settings you have in httpd.conf and php.ini for logging errors --
It may be that PHP is trying to log an error (or just open a log in case
there is an error) in a file that PHP doesn't have write access to...

suExec may also be affecting it.  If PHP is running as 'Joe' because of
suExec, but you've become accustomed to telling PHP to log errors to a file
'Joe' can't write to, well, PHP is not going to be able to start once you
throw suExec into the mix...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I'm wondering if anyone has any info regarding any performance hits
> taken as a result of changing the default type to application/x-httpd-php
> in Apache's httpd.conf, or if there are any _other_ implications of doing
> this.
>
> Any info would be appreciated, as would a cc: cuz I'm not subbed
> at my work address. Thanks.

Anecdotal metering has pegged this as a 5-10% performance hit.  Compared to
the Tech Support calls to say, "No, the URL is supposed to end in .php, not
.htm" that's pretty cheap. :-)

There aren't really any other non-obvious implications I can think of...

If some random hacker has inserted <?php xxx ?> into one of your .htm files,
and you alter the AddType, it will obviously fire off for the first time
now, instead of being swallowed by the browser as an unknown tag.

People who have actually gotten used to .php meaning "the cool database
pages" might be confused by how the ".htm" pages are cool now too. :-)

The PHP group doesn't get quite as much wide-spread recognition as they
deserve, but they're okay with that compared to your need for .htm as a
known entity for end users :-)

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Can someone tell me how we can assign the content of a PHP
> variable to a Java variables in a script (and vice versa).

PHP -> JavaScript is easy:

<?php
    echo "\n<SCRIPT LANGUAGE=JavaScript>\n";
    echo "    document.foo = $foo;\n";
    echo "\n</SCRIPT>\n";
?>

The other way around is a bit tougher...

You see, PHP runs on the server and spits out your web-page to your browser.
Then, the page is done, so the server/browser close the connection and
aren't really talking to each other.
Then, your JavaScript starts executing.
Now, if you want your JavaScript to interact with PHP, your JavaScript has
to open up a whole new connection to some other page, or the same page, but
it has to pass in any values and start over.  It's a whole new run of a PHP
script either way, and makes for a rather slow web-site except in certain
specialized cases.






> I know how to send a standard email, but I`m having a bit of trouble
adding
> an attachment, can anyone put me right?
>
> this is my code which works fine...
>
> $subject="Hi";
> $email="[EMAIL PROTECTED]";
> $from="[EMAIL PROTECTED]";
> $message="Hi this is me testing my PHP mail script";
>
> mail($email, $subject, $message, $from);

Email attachments are quite a bit more convoluted than just adding a From
header...

You may want to use Manuel Lemos email class or some other pre-written
user-contributed function to do it.

Otherwise, you get the joy of figuring out MIME-encoding and making up
unique boundary lines to segment the mime-parts and other gnarly stuff I've
managed to not have to figure out...

Even if you want to roll your own, read their source as well as the RFCs
they used to figure all this out.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I have several sites that need to be upgraded from php3 to php4. In order
> to test compliance of the php3 code on php4, I need to know exactly which
> functions have different usage / results on php4.
>
> I know that include() and rand() work differently, any others?
>
> Does anyone know of an article / page in docs that explains this? There
was
> a page like this on php.net when php4 was first released, but I can't find
> it anymore. The faq on this does not have any useful info.

I know the page you mean, and I can't find it either :-(

If you have { or } embedded in a string as regular output to the user, that
will need to be escaped now.

The other functions were all real "weird" ones that I never used, so didn't
worry about :-^

What you might want to consider doing is installing *both* PHP3 and PHP4 at
one time, and leaving pages as PHP3 until you can verify what does or
doesn't work in some testing.

There really were very, very, very few changes from PHP3 to PHP4,
considering it was a complete re-write of the engine.

Your upgrade will almost certainly be surprisingly uneventful :-)

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Can someone explain to me why this does not work...
>
> All pages on my site <?require?> header and footer files...
> the header file calls an <?include?> to config.inc and functions.inc
>
> I have a function to connect to the db in functions.inc, that many other
> functions and includes use.
>
> All works fine....
>
> but, I have a login page similar to all other pages with <?require?>
calls..
> this page is entirely written from a function...
> Now, calls to functions from .inc files included in the login page (with
me
> so far) do not work...
> My connect function will not connect...
>
> writing this out I realize that it is seems quite complex, but my question
> is...
> can I not call functions from scripts that are included in a page that is
> itself written out from a function?

You mean?...

Your PHP writes out PHP, and you want that PHP to be evaluated?

You would need to not write it out and use http://php.net/eval instead.

It might be easier to just redesign your functions a little bit though...
Calling eval() to do include() sounds like you just didn't plan things quite
right for the way PHP works...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> index.php:
> <?
> session_start
> read in $array from csv file
> ?>
>
> <frameset...
> menu
> content
>
>
> and now: how can i continue the session in the content pages?

In each content page, add:
<?php
    session_start();
?>

You may wish to session_register('array'); in your index.php page if you're
trying to do what I think you're trying to do...  You want that array in
both content pages?

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> The problem is:  When a user clicks on the link, the fdf document either
1)
> is displayed in plain text (despite the proper header being sent) or 2)
> acrobat reader opens but displays an error saying the file can not be
found.
>
> I can right click on the link, and choose to save to disk.  Once I have
the
> fdf document on disk, opening it will propely open its associated pdf and
> fill in the fields.
>
> Has any one had this type of problem before? could web cacheing be causing
> this?  could php sessions be influencing this?

I think people were having trouble with this where the fdf-generating page
was not sending a Content-length: header, since the on-the-fly generation
was not able to predict how big the PDF would be.

I don't know of a resolution, other than creating a temporary PDF for them
to surf to...


--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I'm interested in the proposition made recently on this list that PHP is
> somehow a 'lightweight' language that some people don't take seriously. I

'lightweight' is good :-)

PHP has less "clutter" than, say, Perl, where there are so many functions
and overloaded symbols that no two Perl hackers can read each other's code.

The PHP Dev team has religiously and unapologetically rejected many a
"Feature Request" (like, a bazillion of them) for esoteric functions that
would be really "cool" and about 5% of us would actually find useful.

Thus, PHP is a relatively concise and lightweight language,
comparatively-speaking.

The relative merits of such a design philosophy are a rather long-winded and
subjective discussion, to say the least, that has occurred in this list
quite a few times.  You may want to examine threads comparing PHP and Perl
or possibly PHP and Java for the more on-target explanations.

At a certain point, though, the discussion is not very productive -- If
you've tried XXX and PHP and you like XXX better, well, use XXX.

It's kind of like arguing whether it's better to use a Swiss Army knife,
safety scissors, or a butcher knife to chop vegetables:  It kinda depends on
the situation and who's doing the chopping.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Hi everyone!
> To use de DBA database format, first i had to configurate php with
> --with-db2 option. All works (configure, make and make install). But the
> php script still not works. The line of the script that has a problem
> is:
>
> $id = dba_open ("/home/httpd/html/testes/test.db", "n", "db2");
>
> Fatal error: Call to undefined function: dba_open() in
> /home/httpd/html/testes/teste.php on line 5

That means the --with-db2 didn't take effect somehow.

Check the config.log (?) and config.status (?) files and see if you can find
out why configure ignored your --with-db2
[Basically, dig around in every config.xxx file you can find in the PHP
source directory, and search for db2]

Sometimes it does that and doesn't complain about it for some reason...

Also, double-check that the library (the libphp.so thingie) in your
.../apache/modules/ directory actually has the date you would expect on it.

And, stop your Apache and restart it to get it to load the new PHP library.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






>Can i know the date of the last table update in a Mysql database?

You can add a field named 'modified' that is of type 'timestamp' and use:

select max(modified) from blah;

I don't know of any documented way to check the last modified time for a
whole table.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm







>Does anybody know how should I recognise if Zend Debug Server is running
???

Either <?php phpinfo();?> says something like "...with Zend DebugServer..."
or it doesn't.  It's in the Zend engine section next to the Zend logo.

If it's not running, check your httpd logs to see why.



--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> We have a host (host A) with PostgreSQL 7.0.3. and PHP 4.0.4 under Red Hat
>
> We have another host (host B) with PHP 4.0.3pl1  under Debian
>
> We are having an incomprehensible error with this code when the content of
$sql is
>
> and "update"
>
> ...
>
> $resultado=pg_Exec($conexion,$sql);
>
> ...
>
> 1) The php code from host A works ok.
>
> 2) The same php code from host B accessing postgresql database on host A
>
>    does not work with "update", but it works with "select", "insert", and
"delete".
>
> 3) If I try from host B:   psql -h hostA -d database -u
>
>     update fam set nom='xxxxxx' where id='23'
>
>    it works ok.
>
> 4) So, where is the problem?  php4 libraries under Debian distribution?

Any chance the user permissions are disallowing an update from host B?...
Or are you actually using the same username/password when you do it in the
psql monitor?  [I tend to use my 'real' Postgres account in the monitor and
the 'restricted' one in my PHP pages...  But maybe that's just my own folly.
:-) ]

pg_exec() usually sends an error when something goes wrong...  Is your
error_reporting() set to 15?  Better yet, use pg_errormessage() to see if
maybe you can dig something out of that.

If all that fails, I'd suggest searching http://bugs.php.net and posting
there if it's not a known bug.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> My problem is that I need to find a way to check all the candidate_name
> before printing them on the screen and add a flag to the ones which
> occure more than once.

If you can live with listing the names in alphabetical order, you can do
something like this:

$query = "select name, id from candidates order by name";
$candidates = mysql_query($query) or die(mysql_error());
$previous_name = 'An extremely unlikely name for a candidate to have';
$row = 0;
while (list($name, $id) = mysql_fetch_row($candidates)){
    echo $name;
    #Check if this candidate has same name as *next* candidate:
    if (strtolower($name) == mysql_result($candidates, $row + 1, 0)){
        echo " ($id)";
    }
    #Check if this candidate has same name as *last* candidate:
    elseif (strtolower($name) == $previous_name){
        echo " ($id)";
    }
    echo "<BR>\n";
    $previous_name = $name;
}

This snippet will dump out the ID for any two (or more) candidates who have
the same name, thus ensuring a unique but "humane" output.  If you have two
"Bob Jones" candidates, you'll have to remember which one is number 47 and
which one is number 53, but otherwise you can just go by names.

You may not need to go so far as to use a numeric ID:  I use a similar
technique on a back-end interface [you can't see it, sorry] to
http://chatmusic.com/venues.htm where musicians can post their gigs to the
calendar.  When I have two venues named "Elbow Room", I dump out their city
and state as well as their name.  But, if I have two "Borders Books & Music"
in the same city, I'll also dump out the street address as well as
city/state.  This provides the most "natural" interface for the musicians,
yet "unique" enough for them to accurately pick the venue they are actually
gigging at.

Well, usually...  Sometimes a musician *still* manages to pick the wrong
venue.  But having ID numbers spewed at the people who can't get it right
from city/state and street address doesn't really seem like it's going to
help :-)

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I want to make a php script that outputs a file in a secure dir (outside
of
> web root), this scripts checks the permisions of the user to download the
> file, i use phplib, and my probmem is when i call it from a browser the
> filename to save is set always to test.php, can i send a header to specify
> the name of file to save, or other form to make this.

You can send a Content-disposition: header that will make some browsers do
the right thing, and for some versions of some browsers you have to make
your download URL look like:

http://yoursite.com/test.php/whatever.doc?filename=whatever.doc

I know that extra whatever.doc in the middle looks real goofy, but the
web-server just ignores it, once it finds test.php, and PHP just ignores it,
since it just gets $filename, and the browser sees it in front of "?" and
says "Oh, this must be a whatever.doc file I need to save."

This is, like, a total hack that has nothing to do with specifications, but
Microsoft and Netscape are not known for actually following specifications.

There may be another header to send for other browsers to get it right.

Check around in the PHP code archvies linked from http://php.net/links.php
and you'll find some sample code.






> I have a little problem. I have a listbox (multiline combo box) on my web
> page. When I sellect multiple items from the list box and submit the form
to
> enter the values of the listbox items in the database, then only last
> selected item of the listbox is entered in the MySQL database.
>
> Does anyone know what to do?

Use NAME=whatever[] in your SELECT tag.  Since this is:

http://www.php.net/FAQ.php#7.14

I suggest you re-read the FAQ to see if there's some other stuff there you
missed.

PS  Don't feel too bad.  I asked the same damn question 6 months after
reading the FAQ myself.  I hadn't even understood the question, much less
the answer, when I first read it :-)  Thankfully, Rasmus Lerdorf, the
original author of PHP was kind enough to answer my question politely, and,
well, that pretty much explains why I'm here right now. :-)

NOTE to newbies.  Re-reading the FAQ once you think you know what you are
doing is a really Good Idea :-)  Honest.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I think I found a bug with the pdf_open_image_file() function. I am
running
> php4.0.4 pl1 with pdflib 3.03.
> I cannot open any .gif or .tif files.

Tell more about the potential bug and your setup and/or search in
http://bugs.php.net for similar bugs.

As it is, nobody can help you too much...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






>I'm unable to get exec() to start a small SAS job on my RH 6.2 box.
>(I've got file permissions set correctly)  The code:

File permissions of what for whom?


>      $command="sas -noterminal -log $SASProgDir$JobName.log ".
>        " -print $SASProgDir$JobName.lst $SASProgDir$JobName.sas";
>     print("Spawning '$command'<BR>\n");   // DEBUG STUFF!!!!
>      $ret=exec($command, $reply);
>      print("ret is '$ret'<BR>\n");   // DEBUG STUFF !!!
>      if($ret) {

Not critical yet, but $ret is going to be the first line of output when SAS
*does* work, not an error code.

If you want an error code, use the *THIRD* optional argument to exec().

The $reply has all the lines, and $ret has only the first line.  This seems
kinda silly, but I guess the goal was for quick easy hacks that expect only
one line of output to be able to get it easily, and to provide the full
output when you have more than one line.  It works. [shrug]

>          print("<BR>Ouch.  There was a system error spawning the
program.");
>          print("<BR><B>   '$prog'</B><BR>\n");
>          //print("$ret<BR>\n");
>          print("<pre>\n");
>          for ($i=0; $reply[$i]; $i++) {
>              print("$reply[$i]\n");
>          }
>          print("\n</pre>\n");
>          niceErrorMessage();
>          exit();
>      }
>
>Results in the following SAS error:
>
>   ERROR: User does not have appropriate authorization level for library
>   SASUSER.

So, not only does sas need to be executable by the PHP user (see below) but
this SASUSER library thingie, whatever it is, needs to be cleared for access
by the PHP user.

>   FATAL: Unable to initialize the options subsystem.
>   (SASXKINI): PHASE 3 KERNEL INITIALIZATION FAILED.
>   UNABLE TO INITIALIZE THE SAS KERNEL
>
>The command above:
>  'sas -noterminal -log /usr/local/bin/apache/cgi-bin/sas/remotejob.log
>   -print /usr/local/bin/apache/cgi-bin/sas/remotejob.lst
>  /usr/local/bin/apache/cgi-bin/sas/remotejob.sas'
>
>Can be executed without error in a command shell.  Any clues as to why
>PHP is choking my SAS job would be appreciated.

Because PHP is not you.

You log in as you.  A web-surfer visiting your site does not.  That's good,
because if they did, they'd have a lot more access to your machine than you
really want to give them.

PHP runs as a part of Apache (or not, if it's CGI) and runs as a particular
user, usually 'nobody', but sometimes folks set up another special user
called 'www' or 'wwwuser' or whatever they find meaningful, and give that
user even less (or at least different) access rights than 'nobody'...
Anyway, PHP runs as some user other than the one you login as, and that's
good.

You'll have to check httpd.conf and find the "User" line to see who PHP runs
as, or look at <?php phpinfo();?> or if you are using suExec (see
http://apache.org) you'll have to, errr, figure out how that works and read
httpd.conf even more carefully.

Bottom line is, the user PHP is running as does *not* have permission for
that SASUSER library thingie.

Hope that helps clarify things -- It's a tough one to wrap your brain around
(gave me a headache the first time, I know that) but it makes perfect sense
once you "get it".

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> i open mailbox with imap_open
> when i move next page, mailbox close.
> and i must open mailbox again.
> i want connection contiue, even if i move next page

Don't think you can.

HTTP is inherently stateless...

Even if you could, when would the mailbox close?  You can't rely on your
web-surfers to always hit a close button.

There *might* be an imap_popen() that would reduce the overhead of
subsequent mailbox openings, because PHP and IMAP would agree in advance to
keep the connection around for awhile in case it needs to be re-used...  (I
say this only cuz I know there's a mysql_pconnect().  I have no clue how to
work IMAP)

But you still need to call imap_popen() on each page then, it will just work
faster.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Write me immediately how I find a row size in mysql table if i create a
> table in this manner
> create table size(f1 int,f2 date ,f3 varchar(25),f4 varchar(100), f5 text
,
> f6 int, f7 tinyint(1), f8 tinyint(1) ,f9 tinyint(3), f10 varchar(25))

You read the MySQL manual and add up the numbers?...
http://mysql.org
At a guess, I'd say it's:
f1 int 4
f2 date 4
f3 25
f4 100
f5 4
f6 4
f7 1
f9 3
f10 25
=====
total 170, if I added correctly.

Of course, that f5 field with text means that any given record could incur a
*much* larger size in the database.

Given that, and the size of the records, if I'm off by 4 or even 8 bytes, it
shouldn't make that much difference.  There's always some overhead anyway,
so be generous in your planned disk space.

PostgreSQL will show you this stuff (not the total, I don't think) if you do
\d xxx in the psql monitor, and MySQL commands such as mysqlshow or
mysqladmin might also.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I noticed today that PHP apps run as the WWW user, not the User/Group
> specified in httpd.conf for virtualhosts.
>
> (Module version of PHP running in Apache 1.3.17).
>
> Is there any way to get the PHP module to assume the identity
> similar to the SUexec module will do for CGI?

Not in Apache 1.3.x

User/Group inside Virtual is just ignored, I think.

Apache 2.0 was rumored to have had that on its desired feature list.
Whether it made it into reality, I dunno.  (Anybody wants to clue me in
direct email 'twould be welcome.)

fhttpd (a "competitor" to Apache) has that capability if you need it bad
enough to switch to a not-so-well-known but pretty cool software package.

Another option is to run suExec-wrapped PHP as CGI using a different
mime-type for a critical few pages that need User/Group settings.  Those
particular pages take the CGI performance hit, but may be not horrible for
your overall server needs.  It would not even be terribly difficult to
script the changes to httpd.conf and set this up for a moderately sized
Virtual hosting environment, I should think...  The added value of being
able to run PHP as a specific user for certain pages could be quite a "deal"
for some power-users.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> while ($row = mysql_fetch_array($sql_result)) {
> echo"<tr><td>";
> echo $row["paint"];
> echo"</td><td>";
> echo $row["bucket"];
> echo"</td><td>";
> echo"<form action=\"http://www.\" method=\"POST\">";
> $Color  = $row["Color"];
> if ($Color == $Color) {

Here is one problem:  You can't use $Color for the current color you are
printing *AND* the color they previously selected.

$Color == $Color will *always* turn out to be TRUE.  It's a "truism", like
asking if ("Blue" == "Blue")

You need a separate variable name for the selected color, like,
$SelectedColor, or you could use $Col for the $row["Color"], but you can't
use $Color for both the selected color and the current possible option.

> $option .= "<OPTION value=\"$Color\" selected>$Color</OPTION>";
> } else {
> $option .= "<OPTION value=\"$Color\">$Color</OPTION>";
> }
> echo"<select name=\"Colors\">";
> echo "$option";
> echo"</select>";
>
> as you can see I end up with a select menu with this "green, blue, red"
> as the only option.
>
> is there a way I can tell php3 to break it down at "," so I can actually
> have a drop down menu

Something like this inside your loop might be what you want:

$Colors = $row["Color"];
$options = explode(",", $Colors);
while (list(,$Color) = each($options)){
    $option .= "<OPTION>$Color</OPTION>\n";
}

I'm not real sure that you should have Red, Green, Blue in your database in
the first place though...

It's usually a better idea to store this as a "relation":

Colors:
ColorID Color
---------------
1 Red
2 Green
3 Yellow
4 Blue

Buckets:
BucketID Paint Bucket Weight
----------------------
1 Good Good 100kg
2 Okay Good 120kg

BucketColors
--------------
BucketID ColorID
1 1
1 2
1 4
2 1
2 3

This last table says, that bucket # 1 is "related to" Color 1 (Red), Color 2
(Green) and Color 4 (Blue)
Bucket #2, on the other hand, is "related to" Color 1 (Red) and Color 3
(Yellow)

But, if all you are doing is saying that the only choices for a Bucket ever
are Red/Green/Blue, ignore all that... :-)

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






This worked!
But, I get this color selection increment on each subsequent menu where
the colors from the row above mix with the ones below and so on. Assume
that the numbers are the actual colors:

Select a color:
----------------------------
first menu1 next menu->  1 next menu-> even longer
                2                       2
                3                       3
                4                       4
                5                5
                                         1
                                         2
                                         3
                                         4
                                         5

mysql_connect();
while ($row = mysql_fetch_array($sql_result)) {
echo"<tr><td>";
echo $row["paint"];
echo"</td><td>";
echo $row["bucket"];
echo"</td><td>";
echo"<form action=\"http://www.\" method=\"POST\">";
$Colors = $row["Color"];
$options = explode(",", $Colors);
while (list(,$Color) = each($options)){
$option .= "<OPTION>$Color</OPTION>\n";
}
echo"<select name=\"Colors\">";
echo "$option";
echo"</select>";
echo"</td></tr>";
echo"</form>

> It's usually a better idea to store this as a "relation":

I'm afraid so.

Thanks:
Gerry Figueroa

-----------------
Modern Confucious:
Man who run behind car get exhausted.




> How can you get something like:
>
> header ("Location: $PHP_SELF?");
>
> to redirect with the sessid in the url? In my tests, it redirects, but
> does not append the sessid.
>
> I have compiled with --enable-trans-sid. Transparent sid is working, I
> can use it on links like:
>
> <A HREF="<?php echo "$PHP_SELF?"; ?>">
>
> and it works. I have put this on the links on my page, so that the
> session will be kept even if the user has cookies disabled. But if the
> user (who has cookies disabled) clicks on the browser back button, they
> go back to the first page and start a new session.
>
> Is there a way to redirect this first page back to itself quickly, with
> the sessid in the url, so that even a user with cookies disabled will
> not lose the session if they use the browser back or reload buttons?

*maybe* you can use header("Location: $PHP_SELF?$PHP_SESSID"); (or whatever
variable is holding the session id...

But you might just be testing with a broken browser that is doing caching in
a bad/weird way...

Test with some other browsers before you get too carried away, and be sure
you know what's happening.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> What is php-nuke?

It's a "Template" system written in PHP where you kinda click-and-drag to
build a PHP page.

> How could I make a php-page execute something (itself?) without entering
the
> site... it starts evry hour?!

The most resource-friendly way is to compile PHP as a CGI, and then use
"cron" to have that PHP binary run your page every hour.

Second choice (distant second) is to use "wget" to surf to a page every
hour.

Third choice (distant third) is to use "lynx -d" to surf to a page every
hour.

If you are on Windows NT, you're mostly on your own, but you've got that
Scheduler thingie to play with, and php.exe, and you can make a shortcut to
php.exe and alter the path it uses to be more like "php.exe -q yourpage.php"
instead of just plain ol' "php.exe"

Now, back to a real OS :-)

To compile PHP as a CGI, you need to go back to the PHP source directory and
copy that config.nice file (config.status?) and name it, like,
"config.ascgi" or something.

Or, if you didn't compile from source in the first place, try viewing a page
with <?php phpinfo();?> on it and copy&paste that stuff about
"configure --with-mysql --with-apxs --with-kitchen-sink" into a file
somewhere.  Download the PHP source code, and mostly follow the instructions
in there, *except* ignore all that stuff about configuring Apache and
using --with-apxs or --with-apache.  Instead, you'll use the configure stuff
you just copied as your guide.

Anyway, whichever way you end up doing it, you'll want to end up with a file
you can execute or a command you  can paste that starts off with
"configure", has all the same "--with-xxx" in it, *except* not --with-apxs
and not --with-apache.

So, you finally get that to go, then do "make" like the directions say.
You'll end up with this file named "php" in your directory there, and you
can copy that to /usr/bin or /usr/sbin or whatever location you feel is
convenient and makes sense.  Just be sure you know where the heck you put
it, cuz you'll need it in a bit.

Assuming "cron" is as much as mystery to you as it once was to me, you'll
want to read "man 5 crontab"

Okay, now you'll have to read it a few more times, cuz it ain't the most
light reading.  But the examples are pretty instructive.  Focus on them.

You'll also want to be sure to set your environment variable DISPLAY to an
editor you know how to use instead of the default, which, Murphy's Law, will
be one you won't...

Now that opens up a whole new can of worms, since you may not know how to
set an environment variable.  Easiest thing to do is to do "cd" to get back
to your home directory.  Then to "ls -als".  There's gonna be a whole mess
of files that you maybe never even saw before that start off with a "."
character.  Peek into each one of them, and see if you can find anything
like:
setenv xxx=yyy
or
xxx=yyy
export xxx
If you do, edit that file that has that stuff, and do kinda the same thing,
only you want to set DISPLAY (or maybe editor, depending on which
Un*x/shell) you are using to your favorite editor, like "vi" or "joe" or
"pico" or "emacs" or...  If you have no idea which editor you like, use
"pico" because it's the one most like Notepad, only the menus are things you
type, not things you click, and they're at the bottom...

Anyway, once you got your DISPLAY set up, you can do:

crontab -e

The -e means to "edit" your crontab file.

You want to add a line that looks something like those examples from "man 5
crontab" but that point to your "php" binary you copied into /usr/bin and
makes it fire up your script, every hour.  Something not unlike this:

[EMAIL PROTECTED]
5 * * * * /usr/bin/php -q /full/path/to/your/script.php

Now if you couldn't get PHP to compile, just use "wget" there instead of
/usr/bin/php.
And if you couldn't get PHP to compile, and you can't get "wget" installed,
just use "lynx -d"

But someday, you want to get PHP as a CGI compiled, cuz "wget" and "lynx"
tie up an HTTP connection when you do this, so that's one less person that
can surf to your web-site when it gets busy.

Save and quit your editor.

Because there is a "5" in that first column, this is going to fire off the
php program in /usr/bin at 5 minutes after the hour, every hour (the first
*) every day (the second *) every month (the third *), no matter whether
it's a Monday, Sunday, Weekday, Weekend, or whatever (the last *), and it's
going to feed yourscript.php to PHP to run it.

The -q just tells PHP not to bother printing out that Content-type:
text/html stuff, since it ain't going to a browser anyway.

The email line means it will email you whatever output PHP makes, or an
error message if you screwed up.  (Only maybe I got the email= part wrong...
That's why you read "man 5 crontab")

PS  You can find pretty much this same answer in the mailing list
archives...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






Use cron ...

Search archives for something like "running PHP with cron"

Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


-----Original Message-----
From: FredrikAT [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 04, 2001 9:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php-nuke?


What is php-nuke?
How could I make a php-page execute something (itself?) without entering the
site... it starts evry hour?!

---------------------------------
Fredrik A. Takle
[EMAIL PROTECTED]




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






>Hi,
>
>My oracle sessions are getting full all the time...
>
>I use a OCILogoff at the end of my script...
>
>What could be the problem. I don¹t use a persistent logon.

Wild Guess:

You have transactions that are not getting committed nor rolled back?

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm







> I have a routine where we input text to fields. When there is an
apostrophe it
> handles it correctly.  When the form is brought back for editing, the
field
> values show up in the input fields, with all apostrophes intact, just as
it
> should be.
>
> When I upload this script to my isp, it doesn't work..  The apostrophes
truncate
> the rest of the text.   'Don't cry over spilled milk', in a field, turns
into
> 'Don'...
>
> I have php4 mod in my win32 devbox.  The isp is php3.  Is this the
problem?
> What is the best way out of it please?

You have magic quotes on.
Your ISP doesn't.

Edit .htaccess file in your root web directory on your ISP host, and add:
php_flag magic_quotes_gpc On

(If I remember the directive correctly...  See php.ini to be sure.)

Your ISP may also not be allowing you to use .htaccess files for performance
reasons.  Alternative:

Write a function not unlike this:

function maybe_addslashes($text){
    if (magic_quotes_gpc()){
        return $text;
    }
    else{
        return addslashes($text);
    }
}

And, everywhere you move data from input to the database, you'll need to
call this function on your text.

The bonus here is that you can move from server to server without caring
which ones have Magic Quotes on/off or whether they have enabled .htaccess

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






I had a problem similar to this myself a while ago...
I don't believe the issue is with the differing versions of PHP, but rather 
with the improper escaping of the quote characters.

There are two PHP functions:
addslashes() and stripslashes()

Call the former when you submit the information to properly escape the 
characters that need it, something like:

$new_data = addslashes($old_data);

should work... then when you go to display the information, call 
stripslashes to de-escape everything:

$display_str = stripslashes($new_data);

I hope this helps.

-Matt


At 06:42 PM 2/3/2001, you wrote:

>Hi..
>
>I have a routine where we input text to fields. When there is an apostrophe it
>handles it correctly.  When the form is brought back for editing, the field
>values show up in the input fields, with all apostrophes intact, just as it
>should be.
>
>When I upload this script to my isp, it doesn't work..  The apostrophes 
>truncate
>the rest of the text.   'Don't cry over spilled milk', in a field, turns into
>'Don'...
>
>I have php4 mod in my win32 devbox.  The isp is php3.  Is this the problem?
>What is the best way out of it please?
>
>Thanks in advance.
>
>Floyd






Hello, szii!

Sunday, February 04, 2001, 04:48:52, you wrote:

ssc> Why is this failing....?
ssc> If I comment out the  xml_set_element_handler() call, it's okay...
ssc> If I comment out the xml_parse() call, it's okay...
ssc> If I leave both of them in...it core dumps.

i meet same problem with freeBSD and php 4.0.4 installed. porblem
solved when i upgrade to php 4.0.4pl1

Best regards!
Andrew Golovin
PGP Fingertip 24FD A0CD 667C 1FC7 C2F7  A2EA 9742 D484 FD3C 598D
http://exper.ural.ru/ 






Here's what I'm trying to do: I'd like to pass a hash to a
function as a reference, but I don't want to predeclare that
hash (I'd like to specify it in the function call).
Here's a code example:

<?php

    function foo (&$hash) {
       while (list ($k, $v) = each ($hash)) {
          echo "$k :: $v<br />\n";
       }
    }

    // works this way

    $bar = array (
       "one" => "value",
       "two" => "value"
    );
    foo ($bar);

    // but what I want to say is something like this

    foo (["one" => "value", "two" => "value"]);

    // what also doesn't work

    foo ( array ("one" => "value", "two" => "value") );
    foo ( list ("one" => "value", "two" => "value") );

?>

Am I missing something?

Lux





On Sunday 04 February 2001 07:31, John Luxford wrote:

>     function foo (&$hash) {
>        while (list ($k, $v) = each ($hash)) {
>           echo "$k :: $v<br />\n";
>        }
>     }

>     // but what I want to say is something like this
>
>     foo (["one" => "value", "two" => "value"]);

foo () is declared to take a reference to a variable. This only works 
with "real" variables, not the temporary ones returned from array() etc.
Modify it to
     function foo ($hash) {

and it will work

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead




What more could you want. Sydney's glorious weather.
PHP's magnificent scripting language.
The keenest PHP users.
All at one meeting. February 20. Willoughby.

Talk about your experience. Feb 20 will feature PHP3 to PHP4 and
e-commerce.

Brag about your successes. Brag about your failures, Brag about
surviving Sydney's traffic.

Register your interest at http://phpsydney.com/

Peter
-- PHP Sydney, [EMAIL PROTECTED] on 02/04/2001





Hi!

what is the use of %
Is it called modulo..what is it's use in PHP.?


Thanx!
Dhaval Desai

__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/




It doesn't have a use in only PHP but in all programming languages.
It's a math thing .. u can get a remainder of a division.
10%8 = 2
12%8 = 4
10%5 = 0
12%5 = 2

Simple application:
$ppl = 23;
$grpsize = 7;
echo ("when $ppl people are divided over groups of $grpsize, ".
$ppl%$grpsize  ." people are ungrouped.");

This operator can be used for more complex situations.

Cheers;
Eelco.


> Hi!
>
> what is the use of %
> Is it called modulo..what is it's use in PHP.?
>
>
> Thanx!
> Dhaval Desai
>
> __________________________________________________
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





$size = getimagesize($Frame."top.gif");

I think you should read this :
http://www.zend.com/zend/tut/using-strings.php


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 04, 2001 5:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] getimagesize question


Hi,

I`m using the following to get the image size...

$size = getimagesize("$Frame");

My problem is $Frame can`t contain the full name of the image for various
reasons, so what I need to do is somehow add the rest, something along the
lines of this...

$size = getimagesize("$Frame'top.gif'");

If $Frame = Hello then the getimagesize would perform on Hellotop.gif but as
yet it isn`t working anyone have a suggestion? I have tried a few variations
such as

("$Frame" + "top.gif")
("$Frame\"top.gif\"")
($Frame"top.gif")

Thanks
Ade

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






try setting error_reporting(0) in PHP.ini



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


-----Original Message-----
From: Dundee (Roland) [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 04, 2001 5:35 AM
To: Php_List
Subject: [PHP] Undefined variable


Hello

When creating a page(php) on Win2000 I get alot of 'Undefined variable'
error messages, but there are no errors at all running the same page on a
apache server.

How come?


Thanks for some hints.

Roland


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






Well, I'll contribute to the discussion whether you like or not...

For a year I was running a website on Canaca.com (former Nortel.no) ...
They've been nice, I though ...

Then I once tried one weird thing:
<?='<PRE>'.show_code('/usr/local/apache/conf/httpd.conf').'</PRE>'?> from a
simple PHP page ...

hmm ...  Not only I broke to the hell their security, but I also found 342
matches under a simple search for </virtual ..

I then quickly understood that I wasn't the only *unhappy* customer on the
server ...  there were 341 MORE!!!

I stayed with them until my contract ended and then added my friend to my
business and rented a dedicated server on insidecrew.net for something like
$200 a month ...

Too much you'll say? But we have a root access now on an extremely cute
FreeBSD machine... We are now reselling some of our space to *these who we
know* and the price drops dramatically, we can add more projects AND WE ARE
THE ROOTS not the rats...

So my advice : if you run more then one project, preferably not alone, and
know others who is willing to do the same : add them in and get yourself a
real server!

Of course it only works for these who know the systems ... not for small
businesses... these need some help...

My point is simple: Yes it is better to be hosted by a smaller company, but,
only if they are responsible enough not to put too many others up there ...
and it all have to cost less then a big company, otherwise I myself will
become a company.

Can you do it?

Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-----Original Message-----
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 04, 2001 6:27 AM
To: 'Robert Covell'; 'Boaz Yahav'; 'Ben Peter'; 'Chris Mason'
Cc: 'Php-General'
Subject: RE: [PHP] PHP hosting - the final frontier.


Actually, there is nothing wrong with a one-manned hosting service. I agree
with Robert in this, there are a lot of big hosting companies that don't
really have a personal hold of their business to really care about their
clients. To them everything is automated and all they do is hire customer
service people who are only taught to, well, "serve customers" with answers
to questions they don't know in the first place. They just read from the
script and have basic step-by-step trouble shooting instructions in front of
them to solve a client's problems/requests. If you need an updated software
package, like PHP4, froman old PHP3 engine, you'de have to beg for it and
you might have to go through several layers of support just for that request
to go through. Let me remind you that the software is free of charge. If the
request is accepted, then more power to you. If it's not then you'll have to
deal with it until you decide to find another host.

I have one question for you Robert. XML has been in the market for a long
time (since 1998), and the recommendations are now set to a true standard.
Why do most hosting services not have support for XML based languages yet?
Thanks...

Navid Yar



-----Original Message-----
From: Robert Covell [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 03, 2001 2:40 PM
To: Boaz Yahav; Ben Peter; Chris Mason
Cc: Php-General
Subject: RE: [PHP] PHP hosting - the final frontier.


I shouldn't even reply to this...

Yes I would host with me.

Have you ever heard of a backup plan.  People that would step in if
something happens to me?  People that I trust to keep the company going if
it fails.

With all due respect, how do people host with a company that doesn't give a
rats ass about them or their business.  How many big companies redirect your
call, or brush you away when problems occur.  I been over backwards for my
clients.  Providing better service then many of the bigger companies out
there.  That is why people do and will continue to host with me.  Like I
said, I plan on hiring people in the near future.  Things take time to
evolve.

I am not saying that my company is for everyone.  If you don't like a one
man shop then don't go there.  People have taken a chance with me and have
not been disappointed like so many times before.

Sincerely,

Robert T. Covell
President / Owner
Rolet Internet Services, LLC
Web: www.rolet.com
Email: [EMAIL PROTECTED]
Phone: 816.210.7145
Fax: 816.753.1952

-----Original Message-----
From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 03, 2001 1:38 PM
To: 'Robert Covell'; Ben Peter; Chris Mason
Cc: Php-General
Subject: RE: [PHP] PHP hosting - the final frontier.


And if, God forbid, something was to happen to you...
120 People / Companies would be left with a server
that no one knows the root password too?

With all due respect, how can someone in his
right mind host with a one man gang company?

For all I know you can be a hosting genius and
give the best service around  but you are still one
man.

Would you host with you ? :)

Sincerely

      berber

Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Robert Covell [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 03, 2001 9:16 PM
To: Ben Peter; Chris Mason
Cc: Php-General
Subject: RE: [PHP] PHP hosting - the final frontier.


I am going to have to disagree on this one.

I run a successful (and profitable) hosting company(http://www.rolet.com).
My employees total 1 (me, myself and I).  The number of clients hosted is
roughly 120.  I provide a wide variety of services on Linux, FreeBSD, NT,
and W2K.  Yes it is hard to believe that 1 person can be available 24x7, or
not take vacations, but this is what I do and LOVE every second of it.  I
value customer satisfaction and strive to provide that best Internet
services possible.  For me this is a career for life, not just a job.  So I
do believe that 1 person can be available 24x7 and not take vacations.
Don't get me wrong, some days it is tough.  I would like to have other
employees in the future, but don't mind the sacrifices taken to get there.

Sincerely,

Robert T. Covell
President / Owner
Rolet Internet Services, LLC
Web: www.rolet.com
Email: [EMAIL PROTECTED]
Phone: 816.210.7145
Fax: 816.753.1952



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ben Peter
Sent: Saturday, February 03, 2001 11:59 AM
To: Chris Mason
Cc: Php-General
Subject: Re: [PHP] PHP hosting - the final frontier.


Chris,

This all sounds good but for one thing: I firmly believe that one man
with a root password is not enogh to look after even one client. I have
hosted with 3 one-man-companies, and it always came to the point where I
couldn't reach someone for a week, or I waited for 3 months, only to be
granted connect privileges to the mysql database - no offense meant! I
think it's just too much for one man, you cannot be available 24/7, and
you will want holidays.

Still, a PHP-specialized hosting environment would be worth much.

Cheers,
Ben

Chris Mason wrote:
>
> I see a lot of traffic regarding php hosting. From experience I know that
> the general hosting companies provide a minimal PHP environment which is
> often insufficient for PHP developers.
> With this in mind, I'm considering offering specialized hosting for PHP
> projects.
>
> The server will be tuned to the needs of PHP projects, and will have the
> latest PHP4 and mySQL versions, up to date XML libraries, IMAP and POP,
and
> will run php as a apache module for performance. The server will have a
low
> user count and I will offer migration alternatives as user's needs grow.
The
> machines will be hosted at a major data center with multiple large
internet
> feeds, and all the other essential requirements.
>
> I plan to be available to users to assist in configuration problems and
will
> stay abreast of developments in PHP to make our projects run faster and
> better.
>
> I'd like to hear from people interested in participating or with
> configuration suggestions. I'm not looking to start a large hosting
company
> but to be a specialized service provider on a small scale.
>
> Let me know what you think, guys.
>
> Chris Mason
> Box 340, The Valley, Anguilla, British West Indies
> Tel: 264 497 5670 Fax: 264 497 8463
> USA Fax (561) 382-7771
> Take a virtual tour of the island
> http://net.ai/ The Anguilla Guide
> Find out more about NetConcepts
> www.netconcepts.ai
> Talk to me in real time with Instant Messenger: [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






Ok,

I've got an email address setup to pipe to a PHP script setup to handle the 
request and do whatever I need to. (In my specific situation, it's a help 
email address, and will create a ticket in a database.)

As a test, I'm opening the STDIN data stream and writing it to a file to 
make sure the email looks correct.

<?

# This is the standard input script.

$fp = fopen("php://stdin","r");
$writer_file = fopen("test.txt","w");
fwrite($writer_file,"$fp");
fclose($writer_file);
fclose($fp);

?>

As stated, it does create the test.txt in the specified location, however, 
upon inspection of the file, it only shows the following text: "Resource id 
#1" on the first line, and that's it.

I'm using PHP compiled as an apache module. Is there something I'm doing wrong?

Thanks,
Roy Wilson, Jr.
Director, Administration/Information Services
Aosdic Realm






> # This is the standard input script.
>
> $fp = fopen("php://stdin","r");
> $writer_file = fopen("test.txt","w");
> fwrite($writer_file,"$fp");
> fclose($writer_file);
> fclose($fp);
>
> ?>
>
> As stated, it does create the test.txt in the specified location,
> however,
> upon inspection of the file, it only shows the following text:
> "Resource id
> #1" on the first line, and that's it.

This is what would be expected, your writing a file pointer to file not the
coentents of the stdin, you need to do somthing along the lines of the
following

// Untested Code

/* -*- Open stdin for reading -*- */
$fp = fopen("php://stdin","r");

/* -*- Open test.txt for writing -*- */
$writer_file = fopen("test.txt","w");

/* -*- Check both were opened -*- */
if($fp && $writer_file) {

    /* -*- Read in stdin -*- */
    while(!feof($fp)) {
        $stdin .= fread($fp, 4096);
    }

    /* -*- Write to test.txt -*- */
    if (sizeof($stdin) != fwrite($writer_file, $stdin, sizeof($stdin))) {
        //Not all of stdin was written to file
    }
    else {
        /* -*- Close Files -*- */
        fclose($writer_file);
        fclose($fp);
    }
}
else {
        //files were not opened
}

James





On Saturday 03 February 2001 22:03, phpLover wrote:
> I am sorry if my question is confusing. What I mean is that CGI is
> excellent in handling flat file data base, reading and writing files
> line by line, word by wor. So is PHP equally strong?

That's exactly what he meant - CGI is an interface specification, PHP is 
a programming language. You can use PHP via CGI :)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead




On Saturday 03 February 2001 22:03, Thomas Weber wrote:
> I have solved the problem. But now i have another problem:
>
> Look at this screenshot: http://electic.hn.org/tunix.gif

The webserver doesn't send a proper Content-Type: Header.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead




Yes, I know it should be written correctly from the beginning. But, in case
it isn't: what do you use to format ugly looking scripts?

Maciek





Well I messed up... I forgot to add the final ";} at the bottom of my
sample code but here it is. sorry!

Gerry wrote:
> 
> This worked!
> But, I get this color selection increment on each subsequent menu where
> the colors from the row above mix with the ones below and so on. Assume
> that the numbers are the actual colors:
> 
> Select a color:
> ----------------------------
> first menu1 next menu->  1 next menu-> even longer
>                 2                       2
>                 3                       3
>                 4                       4
>                 5                         5
>                                          1
>                                          2
>                                          3
>                                          4
>                                          5
> 
-----------------------------------------------
> mysql_connect();
> while ($row = mysql_fetch_array($sql_result)) {
> echo"<tr><td>";
> echo $row["paint"];
> echo"</td><td>";
> echo $row["bucket"];
> echo"</td><td>";
> echo"<form action=\"http://www.\" method=\"POST\">";
> $Colors = $row["Color"];
> $options = explode(",", $Colors);
> while (list(,$Color) = each($options)){
> $option .= "<OPTION>$Color</OPTION>\n";
> }
> echo"<select name=\"Colors\">";
> echo "$option";
> echo"</select>";
> echo"</td></tr>";
> echo"</form>";
}
--------------------------------------
> 
> > It's usually a better idea to store this as a "relation":
> 
> I'm afraid so.
> 
> Thanks:
> Gerry Figueroa
> 
> -----------------
> Modern Confucious:
> Man who run behind car get exhausted.




Hi,

I've just started experimenting with ob_start("ob_gzhandler") a bit, and I
have found that if any output is generated before ob_start() is called,
nothing at all gets compressed; if ob_start() is called before any output,
everything is compressed.

Is this the case, I mean, is this "by design" ?






> I've just started experimenting with ob_start("ob_gzhandler") a bit, and I
> have found that if any output is generated before ob_start() is called,
> nothing at all gets compressed; if ob_start() is called before any output,
> everything is compressed.
>
> Is this the case, I mean, is this "by design" ?

Yes, it wouldn't really work any other way.  You can't mix non-compressed
and compressed in the same request.

-Rasmus





Rasmus,

Thanks for the clarification; it seems obvious, too, that mixing compressed
and non compressed content would be quite difficult to implement; at least
it would partially compromise the speed/size gain because of added protocol
overhead.

Now, imagining that we have enabled compression by calling
ob_start("ob_gzhandler"), what happens for a document that contains
something along these lines:

<!-- snip -->
...
<?
// Enable HTTP compression
ob_start("ob_gzhandler");

// PHP content
$content = "This is some content.";
?>

<div>This is a normal HTML section</div>

<?
// PHP content continues
$content .= "And the rest of it.";
echo $content;
?>
...
<!-- snip -->

In this particular case, what would be compressed ? As far as I have
understood, nothing at all, because some part of the output is not "passing
through" PHP, right ?

> -----Message d'origine-----
> De : Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Envoye : dimanche 4 fevrier 2001 14:34
> A : Alain Fontaine
> Cc : [EMAIL PROTECTED]
> Objet : Re: [PHP] HTTP compression
>
>
> > I've just started experimenting with ob_start("ob_gzhandler") a
> bit, and I
> > have found that if any output is generated before ob_start() is called,
> > nothing at all gets compressed; if ob_start() is called before
> any output,
> > everything is compressed.
> >
> > Is this the case, I mean, is this "by design" ?
>
> Yes, it wouldn't really work any other way.  You can't mix non-compressed
> and compressed in the same request.
>
> -Rasmus
>
>






> Is there any way of to use PHP3 with XSL?
> can anyone help me?

Unless someone back-ports the sablotron stuff to PHP 3 you are pretty much
out of luck.  Upgrade.

-Rasmus





Can someone please help me with this code I'm having major problems with
arrays. This code is part of a function I'm writing to deal with an array
returned from a HTML form of check boxes so if anyone has an example of this
sort of thing I'd appreciate a look at it. Anyway Code follows :

//Reading from a data base
$db = mysql_connect("$DB_Server", "$DB_Login, $DB_Password");
 mysql_select_db("$DB_Name",$db);
 $results = mysql_query("SELECT option_type, code FROM options WHERE
code='000' ORDER BY option_type",$db);
 mysql_fetch_array($results);
// From what  understand I should have an array some thig like this:
// ("Size"=>"A4" , "Size" => "A3", "Size"=>"A5", "Colour"=>"Red", etc..);
 $types = array_values($results);
// OK so now I think I have an array like this:
// ("A4" , "A3", "A5", "Red", etc..);
  while ($type =array_pop($types)){
   echo $type."<br>";
 }
// Now I'm expecting this list to be printed to be outputted
A4
A5
A3
Red
etc...

I'm figureing that this would be a good way to retreive a listing from the
web site arrays and test and insert them one by one.

/// The table options

option_type || code || option_preferences
Size || 000 || A4
Size || 000 || A3
Size || 000 || A5
Colour || 000 || Red
Colour || 000 || Blue
Colour || 000 || Green




Hi Rasmus,

        thanks for you reply.  As some of the phpers already
stated I also disagree about the visibility issue. But
it's IMHO anyway (besides I do not have technical
skills enough to try to implement it).

        I'll check the template you mentioned but I was
wondering if a "built-in" one would not give a better
integration and give php users a "standard" way...

        So what's in the TODO list for a 4.1 release ?

        Thanks again

--- Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> 
> For a fast templating system, see Smarty.
> http://www.phpinsider.com/php/code/Smarty/
> 
> As for better OO.  I think many of the things people
> ask for, like
> visibility (public,private,protected) class
> properties, aren't actually
> features that add functionality, but more just
> convenience features that
> could be implemented in user space.
> 
> For example, you could establish a convention that
> said that any class
> property that starts with an _underscore should be
> considered a private
> property, and one would hope that your UML tool
> could be configured to
> understand that.


__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/


Reply via email to