OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 15 Jun 2003 19:06:36 -0000 Issue 2119

php-general-digest-helplists.php.net
Date: Sun Jun 15 2003 - 14:06:36 CDT


php-general Digest 15 Jun 2003 19:06:36 -0000 Issue 2119

Topics (messages 151541 through 151600):

Re: php editor?
        151541 by: ORLANDO POZO
        151570 by: Brian V Bonini

Re: PHP installation on RedHat
        151542 by: Yann Larrivee

Re: is my server working
        151543 by: DvDmanDT
        151544 by: Alex Ciurea
        151545 by: Khoo Merry
        151546 by: Lars Torben Wilson
        151547 by: Khoo Merry
        151548 by: Alex Ciurea
        151549 by: DvDmanDT
        151550 by: Khoo Merry

interact with .htaccess
        151551 by: Peter Berglund
        151552 by: Peter Berglund
        151553 by: Ernest E Vogelsinger
        151554 by: Adrian
        151555 by: Ernest E Vogelsinger
        151580 by: Peter Berglund
        151583 by: James Hicks
        151590 by: Ernest E Vogelsinger

more information about the php-/zend-api
        151556 by: Thomas Seifert

opening msword files outside the browser
        151557 by: Maris Kalnins
        151558 by: Adrian
        151559 by: Maris Kalnins
        151560 by: Adrian
        151561 by: Maris Kalnins
        151563 by: DvDmanDT

Retrieving x number of words from text field?
        151562 by: Murray Wells

Re: Zend Optimizer not active?
        151564 by: Manuel Lemos

Please help.
        151565 by: Ben Houlton
        151567 by: Thomas Seifert

Re: PHP Priter Functions
        151566 by: Manuel Lemos

Re: Setting Return-Path header for mail() on Linux
        151568 by: Manuel Lemos

Re: slow mail()
        151569 by: Manuel Lemos

Re: Minimalistic BBcode script
        151571 by: Manuel Lemos
        151582 by: DvDmanDT

Capturing the input of dynamic form fields
        151572 by: Frank Keessen

PHPFI? How to build on Win32?
        151573 by: DvDmanDT

Capturing the input of dynamic form fields (part II)
        151574 by: Frank Keessen
        151578 by: James Hicks
        151600 by: Frank Keessen

When putting " or ' in text field, \' or \" is returned
        151575 by: Ben Houlton
        151588 by: John W. Holmes

Very Weird Problem Continued
        151576 by: James Hicks
        151584 by: John W. Holmes

multiple count (*) from php?
        151577 by: Ryan A

multiple count (*) from php? (last one got sent in error, this is the correct one)
        151579 by: Ryan A

Re: reverse DNS lookup with PHP
        151581 by: John W. Holmes

need working php.ini under apache 1.3.27 and redhat 7.2
        151585 by: Kwgoins1.aol.com
        151587 by: John W. Holmes

Re: Zend encoding and security
        151586 by: Zeev Suraski
        151593 by: Manuel Lemos

Re: Creating Images
        151589 by: Don Read

Why SID changes each time I refresh the page??
        151591 by: MH_Hong

need help on coding
        151592 by: Shien Hang Low
        151595 by: Thomas Seifert
        151596 by: Hugh Bothwell

Re: fetch then put record?
        151594 by: Don Read

Upgrading PHP 4.1.2 to Current
        151597 by: Davy Campano

Re: Sendmail Problem
        151598 by: Don Read

[Newman] When i send an email it ...
        151599 by: Jason Marks

Administrivia:

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

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

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

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

attached mail follows:


Try to these PHP development environment:

* Nusphere Studio
* Zend Studio
* Maguma Studio

hello all people in the PHP mailing list, bye.

attached mail follows:


For Linux: Bluefish...

On Sat, 2003-06-14 at 07:15, Ryan A wrote:
> I have tested quite a few editors since i came to php as notepad started to
> p1ss me off after some time...
> I have never really touched vi so cant say much about that but I think Zend
> is pretty good (ill even dare say better) compared to the others(homesite,
> phpedit,editplus etc)
> you DO get only a 21 day trial...but you can make it a free version if you
> want ;-p
> Its a very good product and if you can afford it i think you should buy it
> as a lot of work has gone into it and the developers deserve the $$.
>
> Please note: I have NOTHING at all to do with ZEND (the company,site and its
> software) dont bug me with arguements, this is just my opinion...my 2 cents.
>
> HTH
>
> Cheers,
> -Ryan
>
>
>
> ----- Original Message -----
> From: "Gerard Samuel" <gsamtrini0.org>
> To: "electroteque" <danielelectroteque.org>
> Cc: "Jeff Harris" <jharrisrallycentral.us>; "M-Ali Mahmoodi"
> <ma-mahmoodiqom.ac.ir>; <php-generallists.php.net>
> Sent: Saturday, June 14, 2003 9:54 PM
> Subject: Re: [PHP] php editor?
>
>
> > Because some of us, work directly on the server, instead of modifying
> > files, then uploading to the server to test.... :)
> >
> > electroteque wrote:
> >
> > >boy how painfully dweebish is vi why make it harder for yourself :O
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >

attached mail follows:


Oups sorry with a link it always works better ;)

http://protonicdesign.com/tutorial/sablot_and_php.php

Yann Larrivee
www.phpquebec.org
www.protonicdesign.com

Sorry the tutorial is not in french yet.
I will translate it soone.

On Sun, 2003-06-15 at 08:02, Tim Best wrote:
> Bonsoir Yann,
>
> Je suis intriguer de votre 'tutorial'! Mais je ne
> peux pas le trouver... Ou est-it exactement?
>
> Merci beaucoup pour votre assistance! (et ecriver en
> français, merci de votre patience avec moi. ;-)
>
> /Tim Best
> Best IT
> cell: 504-231-1084
> fax: 206-338-6162
> timbest-it.biz
> http://www.best-it.biz
>
> PS: I am sorry for emailing to you from this different
> address. I am having problems with my email account.
>
>
>
>
> on 6/11/03 10:56, Yann Larrivee at
> yannprotonicdesign.com wrote:
>
> Hi i made a tutorial on how to compile php, expath,
> libxml, sablotron
>
> It works well for me. I ran into many probleme so i
> made an faq page
> where all errors are listed with an explanation,
> solution.
> If anybody encounter other errors i will put them
> there too.
>
> I compile on Suse 8.2 but i dont think it should make
> a difference.
>
> Yann Larrivee
> www.phpquebec.org
> www.protonicdesign.com
>
>
> On Sat, 2003-06-14 at 19:24, Info Best-IT wrote:
> > Anyone know where I can get a better step by step
> how to for installation of PHP with DOM,
> > XSLT, and XPATh support on Red Hat? PHP.NET is not
> so hot...
> >
> > /T
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>

attached mail follows:


Check the source of the output (view->source), is the PHP tags there? If so,
your Apache (php accutually) doesn't parse the .php files...
"Khoo Merry" <merry_e_kyahoo.com> skrev i meddelandet
news:20030615050912.42287.qmailweb41708.mail.yahoo.com...
> I'm using windows me, server apache 1.3 for php.
> I had wrote this code and tried it at local host, but the php code didn't
work. The code is like this:
>
> <?
> $Greet = "Hello World"
> $Today = date("l F d, Y");
> ?>
> <html>
> <body>
> Today's date is
> <?
> print("$Today\n");
> print("$Greet");
> ?>
> </body>
> </html>
> Istead of print
> Today's date is Sunday June 14, 2003
> Hello World
> The out put is only "Today's date is". Is my server working with php?
> I am really appreciate if anyone can answer my problem.
> Thank you.
>
> merry
>
>
>
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!

attached mail follows:


try to use echo instead of print() :

>>>>>>
echo $myString;
>>>>>>

or, if u realy want to use the print function, try this:

>>>>>>
print("$myString", %s);
>>>>>>

maybe will work

------------------------
Alex Ciurea Greets You
www.netonwave.com

----- Original Message -----
From: "Khoo Merry" <merry_e_kyahoo.com>
To: <php-generallists.php.net>
Sent: Sunday, June 15, 2003 8:09 AM
Subject: [PHP] is my server working

> I'm using windows me, server apache 1.3 for php.
> I had wrote this code and tried it at local host, but the php code didn't
work. The code is like this:
>
> <?
> $Greet = "Hello World"
> $Today = date("l F d, Y");
> ?>
> <html>
> <body>
> Today's date is
> <?
> print("$Today\n");
> print("$Greet");
> ?>
> </body>
> </html>
> Istead of print
> Today's date is Sunday June 14, 2003
> Hello World
> The out put is only "Today's date is". Is my server working with php?
> I am really appreciate if anyone can answer my problem.
> Thank you.
>
> merry
>
>
>
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!

attached mail follows:


i had configure the php 4 with apache 1.3 in the httpd.conf configuration file. When i tried the single line in the local host.

Note: forwarded message attached.

---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

attached mail follows:


Merry--

No, it's not working.

Does your Apache httpd.conf file load the PHP modules?

Try changing your tags from <? ... ?> to <?php ... ?>

Try a page that contains only this one line:

<?php phpinfo(); ?>

Good luck.

--John

On Sunday 15 June 2003 01:09 am, Khoo Merry wrote:
> I'm using windows me, server apache 1.3 for php.
> I had wrote this code and tried it at local host, but the
> php code didn't work. The code is like this:
>
> <?
> $Greet = "Hello World"
> $Today = date("l F d, Y");
> ?>
> <html>
> <body>
> Today's date is
> <?
> print("$Today\n");
> print("$Greet");
> ?>
> </body>
> </html>
> Istead of print
> Today's date is Sunday June 14, 2003
> Hello World
> The out put is only "Today's date is". Is my server
> working with php? I am really appreciate if anyone can
> answer my problem. Thank you.
>
> merry
>
>
>
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!

attached mail follows:


On Sun, 2003-06-15 at 01:07, Alex Ciurea wrote:
> try to use echo instead of print() :
>
> >>>>>>
> echo $myString;
> >>>>>>
>
> or, if u realy want to use the print function, try this:
>
> >>>>>>
> print("$myString", %s);
> >>>>>>
>
> maybe will work
>
> ------------------------
> Alex Ciurea Greets You
> www.netonwave.com

I think you might be getting confused with printf(). In that case, the
above would be:

  printf("%s", $myString);

In any event, the choice will have no impact here. It simply appears
that the original poster has not got PHP installed properly, or else
the system is not configured to pass that page of through PHP.

  http://www.php.net/print
  http://www.php.net/printf

--
 Torben Wilson <torbenphp.net> +1.604.709.0506
 http://www.thebuttlesschaps.com http://www.inflatableeye.com
 http://www.hybrid17.com http://www.themainonmain.com
 -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----

attached mail follows:


<?php $Today = date("l F d, Y"); ?>

<HTML> <BODY>

Today's Date: <?php print("<H3>$Today</H3>\n"); ?>

</BODY> </HTML>

when i try to test my code at http://localhost/1-5.php4, they ask me if i want to download the file. it come out as document file not html. why?

Note: forwarded message attached.

---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

attached mail follows:


do it like this:

<?
$Greet = "Hello World"
$Today = date("l F d, Y");
?>

Today's date is <? print $Today; ?>

or like this:

<?
$Greet = "Hello World"
$Today = date("l F d, Y");
print $Greet;
print "<br>\n";
print "Today is $Today";
?>

>From: Khoo Merry <merry_e_kyahoo.com>
>To: php-generallists.php.net
>Subject: [PHP] is my server working
>Date: Sat, 14 Jun 2003 22:09:12 -0700 (PDT)
>
>I'm using windows me, server apache 1.3 for php.
>I had wrote this code and tried it at local host, but the php code didn't
>work. The code is like this:
>
><?
>$Greet = "Hello World"
>$Today = date("l F d, Y");
>?>
><html>
><body>
>Today's date is
><?
>print("$Today\n");
>print("$Greet");
>?>
></body>
></html>
>Istead of print
>Today's date is Sunday June 14, 2003
>Hello World
>The out put is only "Today's date is". Is my server working with php?
>I am really appreciate if anyone can answer my problem.
>Thank you.
>
>merry
>
>
>
>---------------------------------
>Do you Yahoo!?
>SBC Yahoo! DSL - Now only $29.95 per month!

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

attached mail follows:


oh, I see. My bad, my mistake...

I also have had problems with apache/php in the past. The apache couldn't
parse the php files. All the php tags were interpreted as normal text and
displayed to the browser.

So, try :
>>>>>>
phpinfo();
>>>>>>
into one of your php files.

it should work if your apache/php server is configured properly.

Good luck!

------------------------
Alex Ciurea Greets You
www.netonwave.com
----- Original Message -----
From: "Lars Torben Wilson" <torbenphp.net>
To: "Alex Ciurea" <alexnetonwave.com>
Cc: "php mailinlist" <php-generallists.php.net>; "Khoo Merry"
<merry_e_kyahoo.com>
Sent: Sunday, June 15, 2003 11:18 AM
Subject: Re: [PHP] is my server working

> On Sun, 2003-06-15 at 01:07, Alex Ciurea wrote:
> > try to use echo instead of print() :
> >
> > >>>>>>
> > echo $myString;
> > >>>>>>
> >
> > or, if u realy want to use the print function, try this:
> >
> > >>>>>>
> > print("$myString", %s);
> > >>>>>>
> >
> > maybe will work
> >
> > ------------------------
> > Alex Ciurea Greets You
> > www.netonwave.com
>
>
> I think you might be getting confused with printf(). In that case, the
> above would be:
>
> printf("%s", $myString);
>
> In any event, the choice will have no impact here. It simply appears
> that the original poster has not got PHP installed properly, or else
> the system is not configured to pass that page of through PHP.
>
>
> http://www.php.net/print
> http://www.php.net/printf
>
>
> --
> Torben Wilson <torbenphp.net> +1.604.709.0506
> http://www.thebuttlesschaps.com http://www.inflatableeye.com
> http://www.hybrid17.com http://www.themainonmain.com
> -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


Allow me to paste the PHP bit of my httpd.conf:

LoadFile C:/PHP/php4ts.dll
Loadmodule php4_module c:\php\sapi\php4apache.dll
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
ScriptAlias /php3/ "c:/php3/"
ScriptAlias /php4/ "c:/php/"
ScriptAlias /php5/ "D:/php5/"
AddType application/x-httpd-php5 .php5
Action application/x-httpd-php5 "/php5/php.exe"
AddType application/x-httpd-php4 .php .phtml
Action application/x-httpd-php4 "/php4/php.exe"
AddType application/x-httpd-php3 .php3
Action application/x-httpd-php3 "/php3/php.exe"

I haven't added PHP 2 as of yet... Just wait... Anyway, this'll enable
.phps, apache module and cgi version of PHP 4, CGI version of 3 and 5...
"Alex Ciurea" <alexnetonwave.com> skrev i meddelandet
news:008d01c33319$0ea81000$4b19a8c0sancho...
> oh, I see. My bad, my mistake...
>
> I also have had problems with apache/php in the past. The apache couldn't
> parse the php files. All the php tags were interpreted as normal text and
> displayed to the browser.
>
> So, try :
> >>>>>>
> phpinfo();
> >>>>>>
> into one of your php files.
>
> it should work if your apache/php server is configured properly.
>
>
> Good luck!
>
> ------------------------
> Alex Ciurea Greets You
> www.netonwave.com
> ----- Original Message -----
> From: "Lars Torben Wilson" <torbenphp.net>
> To: "Alex Ciurea" <alexnetonwave.com>
> Cc: "php mailinlist" <php-generallists.php.net>; "Khoo Merry"
> <merry_e_kyahoo.com>
> Sent: Sunday, June 15, 2003 11:18 AM
> Subject: Re: [PHP] is my server working
>
>
> > On Sun, 2003-06-15 at 01:07, Alex Ciurea wrote:
> > > try to use echo instead of print() :
> > >
> > > >>>>>>
> > > echo $myString;
> > > >>>>>>
> > >
> > > or, if u realy want to use the print function, try this:
> > >
> > > >>>>>>
> > > print("$myString", %s);
> > > >>>>>>
> > >
> > > maybe will work
> > >
> > > ------------------------
> > > Alex Ciurea Greets You
> > > www.netonwave.com
> >
> >
> > I think you might be getting confused with printf(). In that case, the
> > above would be:
> >
> > printf("%s", $myString);
> >
> > In any event, the choice will have no impact here. It simply appears
> > that the original poster has not got PHP installed properly, or else
> > the system is not configured to pass that page of through PHP.
> >
> >
> > http://www.php.net/print
> > http://www.php.net/printf
> >
> >
> > --
> > Torben Wilson <torbenphp.net> +1.604.709.0506
> > http://www.thebuttlesschaps.com http://www.inflatableeye.com
> > http://www.hybrid17.com http://www.themainonmain.com
> > -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
>

attached mail follows:


Note: forwarded message attached.

---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

attached mail follows:


Allow me to paste the PHP bit of my httpd.conf:

LoadFile C:/PHP/php4ts.dll
Loadmodule php4_module c:\php\sapi\php4apache.dll
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
ScriptAlias /php3/ "c:/php3/"
ScriptAlias /php4/ "c:/php/"
ScriptAlias /php5/ "D:/php5/"
AddType application/x-httpd-php5 .php5
Action application/x-httpd-php5 "/php5/php.exe"
AddType application/x-httpd-php4 .php .phtml
Action application/x-httpd-php4 "/php4/php.exe"
AddType application/x-httpd-php3 .php3
Action application/x-httpd-php3 "/php3/php.exe"

I haven't added PHP 2 as of yet... Just wait... Anyway, this'll enable
.phps, apache module and cgi version of PHP 4, CGI version of 3 and 5...
"Alex Ciurea" <alexnetonwave.com> skrev i meddelandet
news:008d01c33319$0ea81000$4b19a8c0sancho...
> oh, I see. My bad, my mistake...
>
> I also have had problems with apache/php in the past. The apache couldn't
> parse the php files. All the php tags were interpreted as normal text and
> displayed to the browser.
>
> So, try :
> >>>>>>
> phpinfo();
> >>>>>>
> into one of your php files.
>
> it should work if your apache/php server is configured properly.
>
>
> Good luck!
>
> ------------------------
> Alex Ciurea Greets You
> www.netonwave.com
> ----- Original Message -----
> From: "Lars Torben Wilson" <torbenphp.net>
> To: "Alex Ciurea" <alexnetonwave.com>
> Cc: "php mailinlist" <php-generallists.php.net>; "Khoo Merry"
> <merry_e_kyahoo.com>
> Sent: Sunday, June 15, 2003 11:18 AM
> Subject: Re: [PHP] is my server working
>
>
> > On Sun, 2003-06-15 at 01:07, Alex Ciurea wrote:
> > > try to use echo instead of print() :
> > >
> > > >>>>>>
> > > echo $myString;
> > > >>>>>>
> > >
> > > or, if u realy want to use the print function, try this:
> > >
> > > >>>>>>
> > > print("$myString", %s);
> > > >>>>>>
> > >
> > > maybe will work
> > >
> > > ------------------------
> > > Alex Ciurea Greets You
> > > www.netonwave.com
> >
> >
> > I think you might be getting confused with printf(). In that case, the
> > above would be:
> >
> > printf("%s", $myString);
> >
> > In any event, the choice will have no impact here. It simply appears
> > that the original poster has not got PHP installed properly, or else
> > the system is not configured to pass that page of through PHP.
> >
> >
> > http://www.php.net/print
> > http://www.php.net/printf
> >
> >
> > --
> > Torben Wilson <torbenphp.net> +1.604.709.0506
> > http://www.thebuttlesschaps.com http://www.inflatableeye.com
> > http://www.hybrid17.com http://www.themainonmain.com
> > -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


I want to send user and password from php to a protected directory.
For example: If I go directly to the directory I get a popup to enter user
and password, the normallt way.

But if I go through a php-script that checks if I'm a valid user from a
database I will get access to the folder.

So i need a way to send user/password from php to the .htaccess file.

attached mail follows:


what I mean is if you can create a form page
in PHP prompting for a username and password and then redirect into
an .htaccess protected directory without having the server pop up another
username/password box?

attached mail follows:


At 12:28 15.06.2003, Peter Berglund said:
--------------------[snip]--------------------
>I want to send user and password from php to a protected directory.
>For example: If I go directly to the directory I get a popup to enter user
>and password, the normallt way.
>
>But if I go through a php-script that checks if I'm a valid user from a
>database I will get access to the folder.
>
>So i need a way to send user/password from php to the .htaccess file.
--------------------[snip]--------------------

I'm afraid this is not possible for the simple reason that the _client_
needs to transmit the auth credentials to the server.

What you can do however is to somehow include the page contents in your PHP
output. In case the .htaccess-protected content is a simple html page you
could e.g. readfile() it, or process it in a similar way.

HTH,

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


you could redirect to http://username:passworddomain/foo

------------------------
> what I mean is if you can create a form page
> in PHP prompting for a username and password and then redirect into
> an .htaccess protected directory without having the server pop up another
> username/password box?

------------------------
--
Adrian
mailto:adrianplanetcoding.net
www: http://www.planetcoding.net
www: http://www.webskyline.de

attached mail follows:


At 13:04 15.06.2003, Adrian said:
--------------------[snip]--------------------
>you could redirect to http://username:passworddomain/foo
--------------------[snip]--------------------

with the drawback that your highly sensitive account information is visible
at the URL and will be stored in anyone's history files. Well... why
protect it anyway?

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


ok, I change my question, how do I protect downloadable files from users
that are not valid?
without the use of htaccess?

"Peter Berglund" <peter_btelia.com> skrev i meddelandet
news:20030615102836.9660.qmailpb1.pair.com...
> I want to send user and password from php to a protected directory.
> For example: If I go directly to the directory I get a popup to enter user
> and password, the normallt way.
>
> But if I go through a php-script that checks if I'm a valid user from a
> database I will get access to the folder.
>
> So i need a way to send user/password from php to the .htaccess file.
>
>

attached mail follows:


I think what you really want to do is place your downloadable files in a
directory that is not in your httpd's document root and use a password
protected PHP script to access these files and send them to the user after
authentication. I think you could accomplish this with the fpassthru()
function and the correct header. htaccess is just going to get in your way.

<?
 include("authentication.php");
 $filename="/path/to/directory/not/in/httpd/doc/root/mysecretpicture.jpg";
 $fp=fopen($filename, "rb");
 header( "Content-type: image/jpeg\nContent-Disposition: inline;
filename=\"mypic.jpg\"\nContent-length: ".(string)(filesize($filename)) );
 fpassthru($fp);
?>
 

You've got to make sure that the user that your httpd runs as has permission
to access /path/to/directory/not/in/httpd/doc/root/

James

On Sunday 15 June 2003 10:32 am, Peter Berglund wrote:
> ok, I change my question, how do I protect downloadable files from users
> that are not valid?
> without the use of htaccess?
>
> "Peter Berglund" <peter_btelia.com> skrev i meddelandet
> news:20030615102836.9660.qmailpb1.pair.com...
>
> > I want to send user and password from php to a protected directory.
> > For example: If I go directly to the directory I get a popup to enter
> > user and password, the normallt way.
> >
> > But if I go through a php-script that checks if I'm a valid user from a
> > database I will get access to the folder.
> >
> > So i need a way to send user/password from php to the .htaccess file.

attached mail follows:


At 16:32 15.06.2003, Peter Berglund said:
--------------------[snip]--------------------
>ok, I change my question, how do I protect downloadable files from users
>that are not valid?
>without the use of htaccess?
--------------------[snip]--------------------

Have a look at an example on my server:
    http://www.vogelsinger.at/protected.html

This should do just what you need, some explanations are within the source
code.

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


Hi folks,

I'm currently trying to work my way through an extension.

Using the tutorials on the php.net/zend.com ... and other sites
it works so far to do some work, return values and getting parameters.

But how can I get access to the variables defined in php or add other
variables without the need to return them and so on.

There must be anywhere more information about such matters or am I just blind?

Thanks in advance,

Thomas

attached mail follows:


Hi!

I am using:

<?php
header('Content-Type: application/msword');
header('Content-Disposition: attachment; filename=test.doc');
readfile("test.doc");
?>

What changes should be made to this code to skip the dialog box
asking Open, Save, Cancel and go right to the opening the MSWord file
outside the browser?

Thanks,
Maris

attached mail follows:


you could try
header('Content-Disposition: inline; filename=test.doc');

attached mail follows:


Adrian, thanks for the clue!

.. but this is opening word document inside the web browser which is not
acceptable in my case :(

"Adrian" <adrianplanetcoding.net> wrote in message
news:11528812209.20030615133026planetcoding.net...
> you could try
> header('Content-Disposition: inline; filename=test.doc');
>
>

attached mail follows:


oops, i thougt you wanted it opening in the browser.
i don't think there is a way to open it directly outside the browser,
because if this would be possible someone could do so with a virus
.exe, too.

> .. but this is opening word document inside the web browser which is not
> acceptable in my case :(

attached mail follows:


yeah, i guess you're right!
then there's no such possibility :(

"Adrian" <adrianplanetcoding.net> wrote in message
news:13429138118.20030615133552planetcoding.net...
> oops, i thougt you wanted it opening in the browser.
> i don't think there is a way to open it directly outside the browser,
> because if this would be possible someone could do so with a virus
> .exe, too.
>
> > .. but this is opening word document inside the web browser which is not
> > acceptable in my case :(
>
>

attached mail follows:


You could go for like javascript maybe.. but nah, that seems kinda
impossible... But maybe not... VBS...
"Maris Kalnins" <proximuse-teliamtc.lv> skrev i meddelandet
news:20030615113804.56010.qmailpb1.pair.com...
> yeah, i guess you're right!
> then there's no such possibility :(
>
> "Adrian" <adrianplanetcoding.net> wrote in message
> news:13429138118.20030615133552planetcoding.net...
> > oops, i thougt you wanted it opening in the browser.
> > i don't think there is a way to open it directly outside the browser,
> > because if this would be possible someone could do so with a virus
> > .exe, too.
> >
> > > .. but this is opening word document inside the web browser which is
not
> > > acceptable in my case :(
> >
> >
>
>

attached mail follows:


Hello All,

I have a page that displays a summary of records available for view.

As part of that summary I'd like to be able to retrieve and display x
number of words (perhaps 15 or 20?) excluding punctuation (as in, I want
the punctuation to be present, but not to count towards the word total,
so "this ... that" would be 2 words, not 3) as an intro to the text in
that record.

The tricky thing is (at least, it seems tricky to me) is that I would
like all content within an "<a href="" class=""></a>" tag to be treated
as a word. So, if I set the retrieval number to be 10 words, the
following would hopefully be retrieved:

"one two three <a href="http://www.awebsite.com" class="link">some text
describing the site</a> five six seven eight nine ten"

I think I could probably achieve this using a fairly brutish technique
of working through the string of the text for each record character by
character and keeping a word count, but I wondered if anyone could think
of a more graceful / efficient approach?

Any help very appreciated!

Much warmth,

Murray
http://www.planetthoughtful.org
Building a thoughtful planet,
one snide comment at a time...

attached mail follows:


Hello,

On 06/12/2003 10:16 PM, Steve Yates wrote:
> Starting with a working site (FreeBSD 4.7, Apache 1.3.27) using PHP 4.3.0
> and the latest Zend Optimizer, I upraded to PHP 4.3.2. Afterwards, phpinfo
> () did not show the Optimizer as loaded. Reinstalling Optimizer did not
> change this, nor did uninstalling and reinstalling Optimizer. There were
> no errors during the Optimizer install, and everything looks like it's
> correct to me...the two lines are in php.ini, and they point to the right
> ZendOptimizer.so file. There is only one php.ini on the system. Any
> hints?

I think this is a simple version mismatch or maybe you are using also
another extension that is not compatible with Zend Optimizer.

Anyway, on a completely unrelated subject, you may want to know that
using an optimizer extension alone may make your scripts run slower.

What happens is that if you use just the optimizer, PHP will compiler
and optimize your scripts. Often the speedup gains of optimizing are
nortworth the extra time and CPU the optimizer takes to scan and redo
your PHP compiled code in memory. This means that often, not using any
optimizer is better than using one.

To avoid that problem you should use an optimizing extension always in
conjunction with a compatible caching extension, as it will save the
optimizer results in shared memory and it won't spend anymore time
recompiling and optimizing the same scripts in every access.

You need to use a compatible cache extension, probably Zend Cache. If
you can't afford a commercial cache extension, using a free caching
extension is much faster than using just Zend Optimizer.

You may want to try Turck that is an Open Source extension that does
simultaneously: optimizing, code caching, content caching and even
encoding. The performance practically matches Zend commercial products.

You may learn all about it here:

http://www.turcksoft.com/en/e_mmc.htm

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

attached mail follows:


How do I get a DB table open easily?
So far, I've been using a metod that sometimes works and some times doesn't,
I just want to know the easy way to do it.
My code of what I'm doing now is below:

  $db = mysql_connect("localhost","root");

  mysql_select_db("misc",$db);

  $result = mysql_query("SELECT * FROM replace");

  $row = mysql_fetch_array($result);

Thank you for your time.

attached mail follows:


That doesn't tell much.
The way you'r using should work.
What happens if it doesn't work?

Thomas

On Sun, 15 Jun 2003 21:46:54 +1000 kaoru_cuthotmail.com (Ben Houlton) wrote:

> How do I get a DB table open easily?
> So far, I've been using a metod that sometimes works and some times doesn't,
> I just want to know the easy way to do it.
> My code of what I'm doing now is below:
>
> $db = mysql_connect("localhost","root");
>
> mysql_select_db("misc",$db);
>
> $result = mysql_query("SELECT * FROM replace");
>
> $row = mysql_fetch_array($result);
>
> Thank you for your time.
>

attached mail follows:


Hello,

On 06/13/2003 06:41 AM, Stephen Goddard wrote:
> Has anyone managed to get the php printer functions to work on a network
> printer. My code is connecting to the printer but .....

You may want to try this class:

Class: APrint
http://www.phpclasses.org/aprint

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

attached mail follows:


Hello,

On 06/13/2003 09:09 AM, Tom Woody wrote:
> Is it possible to change the Return-Path header in PHP on linux? I have
> seen all the posts about setting it in the php.ini with the -f switch to
> sendmail. But I need to set it based on the person logged into the
> page? Right now the Return-Path is set to a default that gets sent to
> me (the administrator).
>
> I have a group of about 20 users who log into the webpage, and send
> email messages. If any of the messages bounce, those users don't know
> about it until I sift through the postmaster mailbox and let them know
> (that is unless the remote mail server is nice and send the bounce to
> the From: or Reply-To:). Changing the Return-Path would solve this for
> everyone. Any thoughts ideas, or am i just out of luck?

Yes, under Linux you just use the -f switch. You may want to take a look
at this class that comes with an abstraction of the Return-Path header:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

attached mail follows:


Hello,

On 06/13/2003 10:19 AM, Marko wrote:
> Sending multiple emails using PHP - as BCC or multiple mail() commands -
> takes quite long; usually over 50 seconds for 10 addresses.
> While sending these messages the browser won't show anything else but a
> blank page, which is not a very exciting internetexperience for people using
> my mailing-application.
>
> I've been using exactly the same code on some other boxes without any
> extreme delays.
>
> The box is running Sendmail 8.12.9, PHP 4.3.1 on FreeBSD 4.8.

You would better switch to qmail or something similar.

With sendmail you need to pass additional switches to just queue the
message for delivery instead of trying to send it immediately, which is
what it stalling your scripts.

You may want to take a look at this class that comes with a sub-class
specialized in delivering with sendmail. That sub class provides options
that map to sendmail switches to change the delivery mode to just queue
the messages:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

attached mail follows:


Hello,

On 06/14/2003 10:53 AM, Dz wrote:
> I found one minimalistic BBcode script, but it doesnt work.

You may want to try these classes that are ready to do what you want:

Class: BBCode Class
http://www.phpclasses.org/bbcode

Class: UBBCode
http://www.phpclasses.org/ubb

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

attached mail follows:


$text=preg_replace("#\[([bisu])\](.*?)\[/\\1\]#i","<\\1>\\2</\\1>",$text);
"Dz" <dontzpamhot.ee> skrev i meddelandet
news:php.general-151476news.php.net...
> Hello,
>
> I found one minimalistic BBcode script, but it doesnt work.
>
> Warning: Unknown modifier '1' in f:\_php\_f\bb-code\test.php on line 32
>
> line 32 is such:
>
> $t = preg_replace_callback( '/[('.$atag.')(=(.*))?](.*)[/1]/isU', 'nc',
$s);
>
> How to get work it?
>
>
>
> Source is only 40 lines:
>
> <?php
>
> $tagid = array(
> 'b' => '<b>%s</b>',
> 'u' => '<u>%s</u>',
> 'i' => '<i>%s</i>',
> 'tsitaat' =>
'<blockquote><small><b>Tsitaat</b>:<hr>%s<hr></small></blockquote>',
> 'url' => '<a href="%s">%s</a>',
> 'mail' => '<a href="mailto:%s">%s</a>',
> 'img' => '<img src="%s" alt="%s">',
> 'code' => '<font color="green">%s</font>',
> 'kood' => '<font color="green">%s</font>',
> 'color' => '<font color="%s">%s</font>',
> 'size' => '<font size="%s">%s</font>'
> );
> $atag = join( '|', array_keys( $tagid));
>
> /*
> print '<p>allowed tags:</p>';
> foreach( $tagid as $key => $value) {
> echo "<b>$key</b><br>n";
> }
> */
>
> function nc( $s){
> if ( $s[1] ) $s[4] = nk( $s[4]);
> global $tagid;
> return
$s[1]?sprintf($tagid[$s[1]],(!empty($s[3])?$s[3]:$s[4]),$s[4]):$s[0];
> }
> function nk( $s){
> global $atag;
> $t = preg_replace_callback( '/[('.$atag.')(=(.*))?](.*)[/1]/isU', 'nc',
$s);
> return $t;
> }
>
> $text = "[b]bold text [i]mixed with[/b] italic[/i]";
> echo nl2br( nk( htmlspecialchars( $text, ENT_NOQUOTES)));
>
> ?>

attached mail follows:


Dear all,

Can you help me with the following or point me to the right direction;

I'm receiving value's of two fields called test1 and test2. Both fields can have multivalue's. The first field called test1 is going o.k. with the following code;

if(is_array($_POST['test1'])) {
foreach($_POST['test1'] as $Key => $Value) {
$query = "INSERT INTO testx(name) values ('$Value')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
} else {
$query = "INSERT INTO testx(name) values ('$test1')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
 }
}

How can i put the test2 value's in the above construction so that the value's of test1 and test2 are seamlessley written in the database?

Thanks in advance for helping me out!

Regards,

Frank

attached mail follows:


Hello... Today I downloaded 'phpfi' from CVS and I was wondering how to
build it? It included no dsw/dsp files so I tried cygwin
./configure
make
cd src
make

but it doesn't work... Says like no rules or something... Or that it doesn't
know how to build... So, how?

Thanks in advance // DvDmanDT

attached mail follows:


Dear all,

Refering to my first e-mail with the same subject; I've reworked the code to this:

But the only problem is; Nothing is written into the mysql database! And there are no error displayed..

Can someone have a look at my code?

<?
$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
if($_REQUEST['submit']!="")
{
for($i=0;$i<count($_POST['test1[]']);$i++) {
$query="INSERT INTO test (test1, test2) VALUES ('$_POST['test1']','$_POST['test2']')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
}
}
?>
<form name="form1" method=post id=form1 enctype=multipart/form-data action="<? $_SERVER['PHP_SELF']?>">
<?
 for ($i=1; $i<=2; $i++)
    {
        echo "# $i<input type=\"text\" name=\"test1[]\"><br>";
  echo "# $i<input type=\"text\" name=\"test2[]\"><br>";
  
    }

?>
<input type=submit name=submit value=submit>
</form>

Thanks very much,

Frank

attached mail follows:


Whenever I am having problems with SQL queries I always display the query on
the page with all the replaced variables so I can make sure that the query
makes sense. If it passes the MySQL parser in my brain and still doesn't
work, I will copy the displayed query into the command line mysql monitor (or
phpmyadmin) and try the command manually to see what happens.

I also found it easier to solve my SQL problems by not using "or die " and
just displaying some information about the problem query. This way I know
something is wrong if the third line of the echo is not at least 1.

$query="INSERT INTO test (test1, test2) VALUES
                    ('$_POST['test1']','$_POST['test2']')";
$result = mysql_query($query);
echo(mysql_error()."<BR>$query<BR>".mysql_affected_rows($result));

James

On Sunday 15 June 2003 09:39 am, Frank Keessen wrote:
> Dear all,
>
> Refering to my first e-mail with the same subject; I've reworked the code
> to this:
>
> But the only problem is; Nothing is written into the mysql database! And
> there are no error displayed..
>
> Can someone have a look at my code?
>
> <?
> $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> if($_REQUEST['submit']!="")
> {
> for($i=0;$i<count($_POST['test1[]']);$i++) {
> $query="INSERT INTO test (test1, test2) VALUES
> ('$_POST['test1']','$_POST['test2']')"; $result = mysql_query($query) or
> die ("Error in query: $query. " . mysql_error()); }
> }
> ?>
> <form name="form1" method=post id=form1 enctype=multipart/form-data
> action="<? $_SERVER['PHP_SELF']?>"> <?
> for ($i=1; $i<=2; $i++)
> {
> echo "# $i<input type=\"text\" name=\"test1[]\"><br>";
> echo "# $i<input type=\"text\" name=\"test2[]\"><br>";
>
> }
>
> ?>
> <input type=submit name=submit value=submit>
> </form>
>
> Thanks very much,
>
> Frank

attached mail follows:


Hi James,

Sorry to say; I've put your code in it but there are no error message's
displaying and there is no value inserted in the database... Any clue???

Regards,

Frank
----- Original Message -----
From: "James Hicks" <freedomadvocatecox.net>
To: "Frank Keessen" <fkeessenplanet.nl>
Cc: <php-generallists.php.net>
Sent: Sunday, June 15, 2003 4:14 PM
Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)

> Whenever I am having problems with SQL queries I always display the query
on
> the page with all the replaced variables so I can make sure that the query
> makes sense. If it passes the MySQL parser in my brain and still doesn't
> work, I will copy the displayed query into the command line mysql monitor
(or
> phpmyadmin) and try the command manually to see what happens.
>
> I also found it easier to solve my SQL problems by not using "or die " and
> just displaying some information about the problem query. This way I know
> something is wrong if the third line of the echo is not at least 1.
>
> $query="INSERT INTO test (test1, test2) VALUES
> ('$_POST['test1']','$_POST['test2']')";
> $result = mysql_query($query);
> echo(mysql_error()."<BR>$query<BR>".mysql_affected_rows($result));
>
>
> James
>
> On Sunday 15 June 2003 09:39 am, Frank Keessen wrote:
> > Dear all,
> >
> > Refering to my first e-mail with the same subject; I've reworked the
code
> > to this:
> >
> > But the only problem is; Nothing is written into the mysql database! And
> > there are no error displayed..
> >
> > Can someone have a look at my code?
> >
> > <?
> > $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> > if($_REQUEST['submit']!="")
> > {
> > for($i=0;$i<count($_POST['test1[]']);$i++) {
> > $query="INSERT INTO test (test1, test2) VALUES
> > ('$_POST['test1']','$_POST['test2']')"; $result = mysql_query($query) or
> > die ("Error in query: $query. " . mysql_error()); }
> > }
> > ?>
> > <form name="form1" method=post id=form1 enctype=multipart/form-data
> > action="<? $_SERVER['PHP_SELF']?>"> <?
> > for ($i=1; $i<=2; $i++)
> > {
> > echo "# $i<input type=\"text\" name=\"test1[]\"><br>";
> > echo "# $i<input type=\"text\" name=\"test2[]\"><br>";
> >
> > }
> >
> > ?>
> > <input type=submit name=submit value=submit>
> > </form>
> >
> > Thanks very much,
> >
> > Frank
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


As the subject say, when putting " or ' in text field, \' or \" is returned.
I'm not sure why, but it only happerns when it is returned in a input ->
text field box.
Could you tell me how to fix this.
Thank you.

Code Snip:

    $nl = " ";

    $ascii = "$ascii";

    $text_form = ereg_replace (" ", " ", $ascii);

    $preview = ereg_replace (" ", "&nbsp;&nbsp;&nbsp;", $ascii);

    $nlbr = nl2br($text_form);

    $nlbr2 = nl2br($preview);

    include('includes\replace.php');

    printf("<INPUT type=\"text\" name=\"msn\"
value=\"$nl$newline\"><br>\n\n");

    $printout = "<FONT color=\"#000000\" face=\"MS Sans
Serif\">$nlbr2</FONT>\n\n";

attached mail follows:


Ben Houlton wrote:

> As the subject say, when putting " or ' in text field, \' or \" is returned.
> I'm not sure why, but it only happerns when it is returned in a input ->
> text field box.
> Could you tell me how to fix this.

If you have magic_quotes_gpc enabled (which it is by default), then
quotes will be escaped in incoming GET, POST, and COOKIE data. If you
want to get rid of the escape characters, use stripslashes() or disable
magic_quotes_gpc.

--
---John Holmes...

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com

attached mail follows:


The following variable needs to be escaped before it can be submitted as an
MySQL query. It seems that the \0 in this string is causing me the problem. I
have tried several functions in an attempt to escape this variable. Anybody
got any other suggestions. The resulting string should look like this:

EBCO\\030774-006\\BUBBLER VALVE

$variable = "EBCO\030774-006\BUBBLER VALVE";

Things I have tried so far that do not work. Every one of the following
functions results in \030 being replaced with a weird character.

echo addslashes($variable);

echo str_replace("\","\\",$variable);

echo mysql_escape_string($variable);

Here is the result of all of the above functions ( notice weird character
after EBCO and that all the functions successfully escape the second \
character in between the 6 and the B in BUBBLER):

EBCOâ–’774-006\\BUBBLER VALVE

James

attached mail follows:


James Hicks wrote:

> The following variable needs to be escaped before it can be submitted as an
> MySQL query. It seems that the \0 in this string is causing me the problem. I
> have tried several functions in an attempt to escape this variable. Anybody
> got any other suggestions. The resulting string should look like this:
>
> EBCO\\030774-006\\BUBBLER VALVE
>
> $variable = "EBCO\030774-006\BUBBLER VALVE";
>
> Things I have tried so far that do not work. Every one of the following
> functions results in \030 being replaced with a weird character.
>
> echo addslashes($variable);
>
> echo str_replace("\","\\",$variable);
>
> echo mysql_escape_string($variable);
>
>
> Here is the result of all of the above functions ( notice weird character
> after EBCO and that all the functions successfully escape the second \
> character in between the 6 and the B in BUBBLER):
>
> EBCOâ–’774-006\\BUBBLER VALVE

This works in all cases:

$variable = 'EBCO\030774-006\BUBBLER VALVE';

echo addslashes($variable);

echo str_replace('\\','\\\\',$variable);

echo mysql_escape_string($variable);

Where is this data actually coming from? Is it something you enter into
a form and then need to put into a database and display on the page?
Running any of those three options on your data entered into a form gave
me the correct value, also.

FYI: \0 is the NULL character.

--
---John Holmes...

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com

attached mail follows:


Hi,
I have 5 tables which keep th details for 5 packages for a company...
a company may add how every many packages they wish.

When a company logs in I want to be able to tell them:

you have $numberOfPackages entered:
package1 $one
package1 $one
package1 $one
package1 $one
package1 $one

attached mail follows:


Hi,
I have 5 tables which keep th details for 5 packages for a company...
a company may add however many packages they wish.

When a company logs in I want to be able to tell them:

you have $numberOfPackages entered:
package1 $one
package2 $two
package3 $three
package4 $four
package5 $five

instead of running 5 "$result = "SELECT count(*) FROM mylist_slave WHERE
ptype =$inn and user='".$my_user."' and cno='".$my_ccno."'";

is there any any way to select all 5 differient tables in one select
count(*) statement?

Thanks,
-Ryan

attached mail follows:


Tim Thorburn wrote:
> I'm setting up a simple tracking program for a website I'm working on.
> Currently it records a visitors IP address, but I would like to be able
> to do a DNS lookup of these IP addresses. Is this possible with PHP and
> if so, how is it done? I've been looking through Google, and the very
> few real results I've come across are large perl programs which make
> little to no sense to me.

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

---John Holmes...

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com

attached mail follows:


doe anyone quickly have a working
4.3.1 "php.ini" file, under apache 1.3.27 and redhat 7.2

that I could take a look at...for reference...
you see, I think ours is missing some lines...
of commands or something...it just doesn't look right
something is missing...I think.

so I need a good one that works for comparing.

attached mail follows:


Kwgoins1aol.com wrote:

> doe anyone quickly have a working
> 4.3.1 "php.ini" file, under apache 1.3.27 and redhat 7.2
>
> that I could take a look at...for reference...
> you see, I think ours is missing some lines...
> of commands or something...it just doesn't look right
> something is missing...I think.
>
> so I need a good one that works for comparing.

http://cvs.php.net/co.php/php4/php.ini-dist

---John Holmes...

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com

attached mail follows:


At 13:59 11/06/2003, Manuel Lemos wrote:
>I guess they can't compare with what they can't afford to buy.

It's therefore nice that it's available for free 21-day evaluation on
zend.com, isn't it? :)

>Anyway, it does not seem to make much sense to compare code acceleration
>based on plain caching/optimization like Turck and Zend Cache do, with
>acceleration plus content caching and compressing like ZPS do, because in
>that case you probably want to consider a solution of:

I agree, which is why I pointed out that comparing the Zend Performance
Suite with Turck (or any other compiled code cache) simply doesn't make sense.

>mod_gzip for content compressions
>http://i4net.tv/marticle/mod_gzip/
>
>And one of many dynamic content caching solutions like this one:
>http://www.phpclasses.org/filecacheclass

If you learned the product, you'd see that it offers many things that
cannot be offered by mod_gzip nor any dynamic content caching class
available in PHP (not to mention it's a heck of a lot easier to use). Of
course, low end solutions can also take advantage of the solutions you
mentioned.

Zeev

attached mail follows:


Hello,

On 06/15/2003 12:39 PM, Zeev Suraski wrote:
> At 13:59 11/06/2003, Manuel Lemos wrote:
>
>> I guess they can't compare with what they can't afford to buy.
>
>
> It's therefore nice that it's available for free 21-day evaluation on
> zend.com, isn't it? :)

I suppose that was not available when they started making those
benchmarks. I don't know. Ask them.

Anyway, that does not matter because of what I said below regarding that
they would not be comparing comparable things.

>> Anyway, it does not seem to make much sense to compare code
>> acceleration based on plain caching/optimization like Turck and Zend
>> Cache do, with acceleration plus content caching and compressing like
>> ZPS do, because in that case you probably want to consider a solution of:
>
>
> I agree, which is why I pointed out that comparing the Zend Performance
> Suite with Turck (or any other compiled code cache) simply doesn't make
> sense.

It makes sense comparing the performance the same features. They compare
code caching + optimizing. Turck also does content caching. It is just
not reflected in those charts because it is a recent feature.

>> mod_gzip for content compressions
>> http://i4net.tv/marticle/mod_gzip/
>>
>> And one of many dynamic content caching solutions like this one:
>> http://www.phpclasses.org/filecacheclass
>
>
> If you learned the product, you'd see that it offers many things that
> cannot be offered by mod_gzip nor any dynamic content caching class
> available in PHP (not to mention it's a heck of a lot easier to use).

I would not be that sure. Anyway, since I am not interested in paying
for ZPS I have not studied your products in depth to comment. So, I
can't guess what you are implying with those "many things that cannot be
offered by mod_gzip nor any dynamic content caching class".

Personally I can only comment on the caching class solution that I
mentioned because I developed it to offload significantly one very busy
site.

Unless you care to be more specific on whatever you mean by what is not
offered by that class that your content caching solution offers, it will
just sound like marketing hype.

> Of course, low end solutions can also take advantage of the solutions
> you mentioned.

Such as?

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

attached mail follows:


On 09-Jun-2003 Chris Blake wrote:
<snip>

>
> Any ideas on how to make it so that the error I specified comes up and
> not the "The image "http://xxxxxxx.xxx.xxx.xxx.x blah blah" part.....
>
> Here`s the code :
> -------
> <?php
> Header('Content-type: image/png');
>

A little too early for that. Wait 'til the image is properly created ...

<snip>

>

//here:
        
        Header('Content-type: image/png');

> ImagePng($image);
> }
> ImageDestroy($image);
> ?>

Regards,
--
Don Read dreadtexas.net
-- It's always darkest before the dawn. So if you are going to
   steal the neighbor's newspaper, that's the time to do it.

attached mail follows:


I have a very simple php code as below, but may i know why my SID changes
every time i refresh the page?
Do i need to change anything in PHP.ini?? thanks
<?php
session_start();
?>
<?php echo SID?>

MH Hong

attached mail follows:


From: Gabor Hojtsy <gaborhojtsy.hu>
To: Shien Hang Low <shienhanghotmail.com>
CC: webmasterphp.net
Subject: Re: need help on coding
Date: Sun, 15 Jun 2003 12:26:53 +0200

Please ask support questions at php-generallists.php.net

Goba

Shien Hang Low :
>hi there,
>i am very sorry, previously i have send you an email but it is the email
>wich code is wrong, so this is the correct one. thank you
>i am a php code user and i have below questions and problems
>wish you could help me out and i think it is very easy for you.
>thank you .
>
>problem :
>
>code :
><?
>$data= "message";
>echo $data;
>?>
>
>output :
>message
>-----------------------------------
>if i want the output to be :
>"message"
>
>i try to used the below code but fail:
><?
>$data = ""message"";
>echo $data;
>?>
>
>so i wonder if i want to get the output that with the
>'quatation' mark how can i do it, your help means alot to me
>thank you for your time and patient .
>
>best regards,
>shienhang
>
>_________________________________________________________________
>Are you in love? Find a date on MSN Personals http://match.msn.com.my/
>
>

_________________________________________________________________
Download ringtones, logos and picture messages from MSN Malaysia
http://www.msn.com.my/mobile/ringtones/default.asp

attached mail follows:


you need to quote " in your code.

Thomas

On Sun, 15 Jun 2003 17:01:03 +0000 shienhanghotmail.com (Shien Hang Low) wrote:

>
>
>
> From: Gabor Hojtsy <gaborhojtsy.hu>
> To: Shien Hang Low <shienhanghotmail.com>
> CC: webmasterphp.net
> Subject: Re: need help on coding
> Date: Sun, 15 Jun 2003 12:26:53 +0200
>
> Please ask support questions at php-generallists.php.net
>
> Goba
>
> Shien Hang Low :
> >hi there,
> >i am very sorry, previously i have send you an email but it is the email
> >wich code is wrong, so this is the correct one. thank you
> >i am a php code user and i have below questions and problems
> >wish you could help me out and i think it is very easy for you.
> >thank you .
> >
> >problem :
> >
> >code :
> ><?
> >$data= "message";
> >echo $data;
> >?>
> >
> >output :
> >message
> >-----------------------------------
> >if i want the output to be :
> >"message"
> >
> >i try to used the below code but fail:
> ><?
> >$data = ""message"";
> >echo $data;
> >?>
> >
> >so i wonder if i want to get the output that with the
> >'quatation' mark how can i do it, your help means alot to me
> >thank you for your time and patient .
> >
> >best regards,
> >shienhang
> >
> >_________________________________________________________________
> >Are you in love? Find a date on MSN Personals http://match.msn.com.my/
> >
> >
>
> _________________________________________________________________
> Download ringtones, logos and picture messages from MSN Malaysia
> http://www.msn.com.my/mobile/ringtones/default.asp
>

attached mail follows:


"Shien Hang Low" <shienhanghotmail.com> wrote in message
news:Law8-F80EF0HG0anlzm00029a6chotmail.com...
>
> >problem :
> >
> >code :
> ><?
> >$data= "message";
> >echo $data;
> >?>
> >
> >output :
> >message
> >-----------------------------------
> >if i want the output to be :
> >"message"
> >
> >i try to used the below code but fail:
> ><?
> >$data = ""message"";
> >echo $data;
> >?>
> >
> >so i wonder if i want to get the output that with the
> >'quatation' mark how can i do it, your help means alot to me
> >thank you for your time and patient .

There are two ways of doing this:

First, you could use a literal string (using single-
quote marks ie ' )

$data = ' "message" ';

Secondly, you could escape the quotation marks
inside the string, ie

$data = " \"message\" ";

I find the first method is a little easier to
read; however, single-quoted strings are
not evaluated for variable substitution, ie

$insert = 'test';

// $data = ' "$insert" '; // will not work!
$data = ' "' . $insert . '" ';
$data = " \"$insert\" ";

Hope this helps.

--
Hugh Bothwell hugh_bothwellhotmail.com Kingston ON Canada
v3.1 GCS/E/AT d- s+: a- C+++ L++>+++$ P+ E- W+++$ N++ K? w++ M PS+
PE++ Y+ PGP+ t-- 5++ !X R+ tv b++++ DI+++ D-(++) G+ e(++) h-- r- y+

attached mail follows:


On 10-Jun-2003 Jean-Christian Imbeault wrote:
> [reply to a personal email posted here for the benefit of all :)]
>

<snip>

> > This bugs me because my db has 125 fields and it will be a very long
> sql string!
>
> I bet!
>
> > The form page generates form contents by using a while loop.
> >
> > How would you build the sql string from the form page?
>
> Use a while loop ;) Name the GET or POST vars the same as the field
> names in the DB. Then you could use something like (I say like b/c this
> won't work, it's just an idea):
>
> $sql = "update table A SET ";
> while (list($fieldName, $value) == each($_POST)) {
> $sql .= " $fieldName='$value', ";
> }
>
> This won't work because there will be POST values passes in that are not
> part of your form data. Oh, and there will be a trailing "," you need to
> trim off ...
>
> Just a quick idea.

You can make it a little smarter:

//refetch the old row ...

$qry="SELECT * FROM tbl WHERE id=" .$_POST['id'];
$r=mysql_query($qry);
$row=mysql_fetch_array($r);

unset($chgflds);
foreach($row as $fld => $val) {
   if (isset($_POST[$fld]) && ($_POST[$fld] != $val)) {
      $chgflds[] = "$fld='" .$_POST[$fld] ."'";
   }
}

$update='UPDATE tbl SET ' .implode(', ', $chgflds)
.'WHERE id=' .$_POST['id'];

mysql_query($update);

Regards,
--
Don Read dreadtexas.net
-- It's always darkest before the dawn. So if you are going to
   steal the neighbor's newspaper, that's the time to do it.

attached mail follows:


I am pretty new to Linux and I was wondering if someone can point me in the right direction on upgrading packages. Right now, I am looking to upgrade PHP but actually I would just like to understand how to do any upgrades. Do I have to recompile??? If so, how do I do this? Thanks for any help!

attached mail follows:


On 10-Jun-2003 Uma Shankari T. wrote:
>
> Hello,
>
> I am having some problem in sendmail using this code.
>
> $MP = "/usr/sbin/sendmail -t -f \mainservername";
>

<snip>

> by main server id name..because of this outside mails are bouncing back..
>
> Can any one pls tell me where is the problem ??
>

What does the bounce say ?

> Is there any configuration need to do for this ??
>

Probably. The -f option sets the envelope 'From:' and can be restricted to
only 'trusted' users. I don't think this has ever been used to specify a
gateway.

The following is *wrong* -but one of them might get you out:

To: mainservername:<somebodyoutside.com>
 -- or --
To: <somebodyoutside.com>mainservername

 ... and the sysadmin will probably whack your pee-pee for doing that.

So let him/her know beforehand so they don't TOS you.

And the last resort is fsockopen(mainservername, 25)

Regards,
--
Don Read dreadtexas.net
-- It's always darkest before the dawn. So if you are going to
   steal the neighbor's newspaper, that's the time to do it.

attached mail follows:


When i send an email i get the following error.

 Warning: mail() [function.mail]: SMTP server response: 550 , Sender unknown in D:\Hosting\Crushme\includes\inc_register.php on line 138

Is this a server or a PHP error?

/ Philip