php-general Digest 23 Jan 2001 06:33:22 -0000 Issue 471

Topics (messages 36044 through 36143):

Re: PHP conventions or classes
        36044 by: Paulson, Joseph V. \"Jay\"

Re: Netscape caching problem
        36045 by: Ernest E Vogelsinger
        36062 by: Larry Jaques
        36070 by: Larry Jaques

$HTTP_SERVER_VARS has only 1 value
        36046 by: Todd Cary
        36047 by: Rasmus Lerdorf
        36056 by: Romulo Roberto Pereira
        36057 by: Todd Cary
        36072 by: Todd Cary
        36073 by: Teodor Cimpoesu
        36074 by: Todd Cary
        36076 by: Teodor Cimpoesu
        36080 by: Todd Cary

Re: Search Engines and PHP
        36048 by: Sam Leibowitz

upload files from the local PC/UNIX to the web sever
        36049 by: david klein
        36055 by: Brian Clark

Re: XML dillema
        36050 by: Thierry Coopman
        36075 by: Teodor Cimpoesu

Re: imap_createmailbox
        36051 by: Ignacio Vazquez-Abrams

Re: Newbie: array help....
        36052 by: Louis Simpson
        36053 by: Louis Simpson
        36054 by: Louis Simpson

Outputting specific HTML for <table> tag.
        36058 by: James, Yz
        36108 by: Richard Lynch

append info to pdf using cpdf functions
        36059 by: Leonard T. Harris

Re: file storage/downloader...
        36060 by: Parker, John (Snorkel)

ASP+COM+MTS VS PHP+??
        36061 by: kenji chan
        36071 by: Joey Garcia

Windows : php : executing a command line program
        36063 by: Mike Chambers

Re: url hide
        36064 by: Vahan Yerkanian

Stack trace function would be really useful!
        36065 by: Dylan McNamee
        36109 by: Richard Lynch

Re: convert ASP to be PHP
        36066 by: Michael A. Peters
        36078 by: The Doctor

How can I make a PHP script run as a background process ????
        36067 by: Benny Nissen
        36111 by: Richard Lynch
        36143 by: Benny Nissen

picture quality question
        36068 by: Pat Hanna
        36077 by: Robert V. Zwink
        36081 by: Alex Black

tengo un problema
        36069 by: oswaldo Aldrete
        36091 by: Matt
        36094 by: Matt
        36096 by: Iván Sánchez Ortega \"MR\"

Downloading images through the use of code
        36079 by: Liam Gibbs
        36112 by: Richard Lynch

quick PHP question on unset()
        36082 by: indrek siitan
        36083 by: indrek siitan
        36084 by: Romulo Roberto Pereira

Re: 404 handler
        36085 by: Alex Black

Selecting max(id) of a table
        36086 by: Chakravarthy K Sannedhi
        36087 by: Liam Gibbs
        36088 by: Sam Masiello
        36099 by: Louis Simpson

PHP && UltraEidt
        36089 by: Steve Haemelinck
        36101 by: Kees Hoekzema

Re: mailTo
        36090 by: Richard Lynch

MSSQL field  type money bring a string not a number back
        36092 by: Romulo Roberto Pereira
        36095 by: Romulo Roberto Pereira

downloading
        36093 by: PeterOblivion.aol.com
        36113 by: Richard Lynch

Quick Shipping
        36097 by: Dave M.
        36100 by: Toby Miller
        36142 by: David Pieper

Performance: register_globals on or off?
        36098 by: Carsten Gehling
        36114 by: Richard Lynch

Re: mysql question?
        36102 by: Richard Lynch

Re: Zip file
        36103 by: Richard Lynch

Re: How to count time in php
        36104 by: Richard Lynch
        36120 by: Stephan Ahonen

Re: Need key() equivalent for string variable
        36105 by: Richard Lynch
        36136 by: CC Zona

Re: selected = true
        36106 by: Richard Lynch

Re: Apache and $HTTP_SERVER_VARS[]
        36107 by: Richard Lynch

Re: HELP! REVOKE COMMAND!!!!
        36110 by: Richard Lynch

What "PHP" Stands For....
        36115 by: Brian White
        36116 by: Alexander Wagner
        36117 by: Josh G
        36118 by: jeremy brand
        36119 by: Toby Butzon
        36121 by: Brian White
        36122 by: Rasmus Lerdorf
        36123 by: Rasmus Lerdorf
        36124 by: jeremy brand
        36129 by: Maxim Maletsky
        36134 by: Fraser MacKenzie
        36135 by: Kurth Bemis
        36138 by: Michael Kimsal

Re: PHP Editors
        36125 by: Randy

I dont know what to do here?
        36126 by: Sefton
        36127 by: Joe Stump

Turning off PHP for one directory with apache
        36128 by: Nold, Mark
        36133 by: Nold, Mark
        36139 by: Dan Lowe
        36140 by: Nold, Mark
        36141 by: Josh G

Function with True / False return
        36130 by: Jamie
        36132 by: Maxim Maletsky

Re: HTTP_USER_AGENT and preg_match
        36131 by: John Hinsley

Re: Help!!!  MY ODBC!!!!
        36137 by: Matt Stone

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]


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


Thanks for the info.  And you are right it would be very useful if there was
some kind of web page which list all of the conventions and classes etc.
Wonder how one would start that?
Jay

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 11:37 AM
To: Paulson, Joseph V. "Jay"
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP conventions or classes


> Does anyone know where I can find information about training classes for
php
> or conventions that are taking place?  I'd like to know so I can start
> attending these functions.

We probably should have a page for this information.  Here are the
upcoming ones I am doing:

Linuxworld (www.linuxworldexpo.com)
New York, Javits Center
Tuesday Jan.30 9am-noon  Introduction to PHP
Tuesday Jan.30 1pm-4pm   Advanced PHP
Wednesday Jan.31 6pm-7:30pm  BOF

Open Source Developers' European Meeting (www.raphinou.com)
Brussels, Belgium
Sunday Feb.4 3:30pm-5:00pm  Technical talk
Sunday Feb.4 5:00pm-6:30pm  BOF

NordU 2001 (www.nordu.org/NordU2001)
Stockholm, Sweden
Tuesday, Feb.13  9am-5pm  PHP Tutorial
Thursday, Feb.15 5pm-7pm  BOF

After that I will be at the following:

March 4-6     Bangalore Bang!inux
April 4-6     ApacheCon Santa Clara
April 8-12    San Jose SD 2001 West
May 28-30     Porto Alegre (Brazil) http://www.softwarelivre.rs.gov.br/
July 23-26    San Diego - O'Reilly PHP Conference
Aug.12-16     Vancouver/Alaska  GeekCruises Script'Scape

There are many other people speaking at many other conferences, so find
the closest conference and check the program.  Chances are there is a PHP
talk.

-Rasmus




At 19:14 22.01.2001, Larry Jaques said:
--------------------[snip]--------------------
>I used this, the sample from "Core PHP Programming" and it gives me a parse
>error
>starting on the first line of the change whether the header lines are
>before or after 
>session_start or the session_ register lines.
>
>header("Last-Modified: " . gmdate("D, d M Y H:i:s) . " GMT");
>header("Expires: " . gmdate("D, d M Y H:i:s) . " GMT");
>header("Cache-Control: no-cache, must re-validate");
>header("Pragma: no-cache");
--------------------[snip]-------------------- 

You're missing a double quote at the gmdate phrase. Use 
   header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");


     ...ebird

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





At 07:19 PM 1/22/01 +0100, you wrote:
>At 19:14 22.01.2001, Larry Jaques said:
>--------------------[snip]--------------------
>>I used this, the sample from "Core PHP Programming" and it gives me a parse
>>error
>>starting on the first line of the change whether the header lines are
>>before or after 
>>session_start or the session_ register lines.
>>
>>header("Last-Modified: " . gmdate("D, d M Y H:i:s) . " GMT");
>>header("Expires: " . gmdate("D, d M Y H:i:s) . " GMT");
>>header("Cache-Control: no-cache, must re-validate");
>>header("Pragma: no-cache");
>--------------------[snip]-------------------- 
>
>You're missing a double quote at the gmdate phrase. Use 
>   header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");

Oops, right. That took care of the error but now the variables aren't
passed to the
next page. What's the sequence?   Session_start/session_register/headers or 
Session_start/headers/session_register? There are no registries on the output
page but it's blank when I use the headers before/between/after the session
info.

The initial problem was one of Netscape giving me a "Data Missing" error
when I
tried to print the output page. Now I get an output page empty of data.
This is single-
use data but I need it for the duration of the session. Everything worked
fine (without
the cache header callouts) in MSIE5 but didn't in NN4.7

- 
Larry Jaques, President  1.760.941.8868
DIVERSIFY! Communications  Vista, CA  USA
1991 - Celebrating Our 10th Year in Business - 2001
Comprehensive Website Development  http://diversify.com




At 11:30 AM 1/22/01 -0800, you wrote:

>>You're missing a double quote at the gmdate phrase. Use 
>>   header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
>
>Oops, right. That took care of the error but now the variables aren't
>passed to the
>next page. What's the sequence?   Session_start/session_register/headers or 
>Session_start/headers/session_register? There are no registries on the output
>page but it's blank when I use the headers before/between/after the session
>info.
>
>The initial problem was one of Netscape giving me a "Data Missing" error
>when I
>tried to print the output page. Now I get an output page empty of data.
>This is single-
>use data but I need it for the duration of the session. Everything worked
>fine (without
>the cache header callouts) in MSIE5 but didn't in NN4.7

To reply to my own post, I found that Netscape doesn't update all of its
display
cache even when I physically reset both memory and file caches via Prefs.
A reload of Netscape cleared up the non-showing of data on the output page
with the sequence Session_start/headers/session_register.

What is not happening is data tracking when using the browser back button.
Should I be caching the pages for, say, half an hour vs no caching?

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$expires = time() + 1800;
header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT");
header("Cache-Control: max-age=1800");

This seems to work, but is there a cleaner way?  Also, I can't find info on 
conversion to my time, PST in the USA, but that shouldn't matter since I'm 
not referring to it anywhere in the scripts.

Thanks for your help so far, Richard, Eugene, list, and any others I missed.

- 
Larry Jaques, President  1.760.941.8868
DIVERSIFY! Communications  Vista, CA  USA
1991 - Celebrating Our 10th Year in Business - 2001
Comprehensive Website Development  http://diversify.com




With Apache, $HTTP_SERVER_VARS only has the element, "PHP_SELF".  What
am I missing in my Apache setup?

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






Are you running PHP as a CGI?

On Mon, 22 Jan 2001, Todd Cary wrote:

> With Apache, $HTTP_SERVER_VARS only has the element, "PHP_SELF".  What
> am I missing in my Apache setup?
>
> Todd
>
> --
> Todd Cary
> Ariste Software
> [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]
>





He is on windows 98...

----- Original Message ----- 
From: Rasmus Lerdorf <[EMAIL PROTECTED]>
To: Todd Cary <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 1:42 PM
Subject: Re: [PHP] $HTTP_SERVER_VARS has only 1 value


Are you running PHP as a CGI?

On Mon, 22 Jan 2001, Todd Cary wrote:

> With Apache, $HTTP_SERVER_VARS only has the element, "PHP_SELF".  What
> am I missing in my Apache setup?
>
> Todd
>
> --
> Todd Cary
> Ariste Software
> [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]





Rasmus -

I am running Apache on my notebook so that I can do some development
while I am "on-the-road".  My code needs to obtain the URL and SERVER
and I do this with $HTTP_SERVER_VARS.  However, under Apache (I use IIS
on the Win 2K server and $HTTP_SERVER_VARS contains many items) I am
only getting the PHP_SELF item.

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






Ramus -

I discovered the problem, but not the solution:

When I am using IIS, the HTTP info is in $HTTP_SERVER_VARS; when I am
using Apache in the Win32, DOS window environment, the HTTP info is in
$HTTP_ENV_VARS.

Now the question is how do I determine which HTTP server I am using so I
can query the correct array?

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






Hi Todd!
On Mon, 22 Jan 2001, Todd Cary wrote:

> Rasmus -
> 
> I am running Apache on my notebook so that I can do some development
> while I am "on-the-road".  My code needs to obtain the URL and SERVER
> and I do this with $HTTP_SERVER_VARS.  However, under Apache (I use IIS
> on the Win 2K server and $HTTP_SERVER_VARS contains many items) I am
> only getting the PHP_SELF item.
> 
Why don't you get them from environment?

$sn = getenv('SERVER_NAME');
$ru = getenv('REQUEST_URI'); or 'SCRIPT_NAME', depending on what you need.


-- teodor




Teo -

That works great for Apache but not for my ISAPI installation that is
using IIS on a Win 2K platform.  Is there a way to tell if I am using an
ISAPI server or not?  Otherwise I will put that in my parameter file.

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






Hi Todd!
On Mon, 22 Jan 2001, Todd Cary wrote:

> Teo -
> 
> That works great for Apache but not for my ISAPI installation that is
> using IIS on a Win 2K platform.  Is there a way to tell if I am using an
> ISAPI server or not?  Otherwise I will put that in my parameter file.
> 
Yap, I think it's php_sapi_name(). [I get `cgi' for the CGI version, and 
`apache' for Apache module, so I guess you'll get `iis' for the iis one ]


-- teodor




Teo -

Many, many thanks!!!  That will do it.

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






Just a quick addendum - search enginies tend to be picky about indexing
pages that have short expire times. So, if you're using header() to prevent
pages from being cached (or at least, cached for very long), you should
expect search engines to turn their noses up at them.

        Sam

-----Original Message-----
From: Sander Pilon [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 9:51 AM
To: Jamie; [EMAIL PROTECTED]
Subject: RE: [PHP] Search Engines and PHP


>
> I was wondering if anyone can enlighten me about the ability of search
> engines to read and list PHP pages.  I have been told that because PHP
> produces a dynamic html page (i.e. one that possibly outputs
> different HTML
> for each hit or request) that they are not easily added to search engines
> (if this is true though what would be the point of having any
> html pages if
> you can't update or change them at anytime?).  Another point was
> made to me
> was that many PHP pages require additional commands to be passed
> through the
> URL eg www.domain.com.au/writestufft.php?variable=foobar which search
> engines find hard to deal with also.
> If any of these are true or if there are such problems which
> could result in
> the page not getting listed then what are the options.
> My only idea has come from the [PHP]url hide thread in which a index.html
> single 'wrapper frame' could be applied to the entire site.
> Any Ideas
>

Search-engines read HTML, what drives that HTML is entirely irrelevant.

... however, some searchengines do not index pages that have variables on
the url, so those pages will never be indexed by that particular
searchengine.

But other searchengines will spider about everything (I think google spiders
a lot, including dynamic pages) - but realize that the searchengine always
contains a snapshot of your page, most likely one taken weeks ago.

If you want to be totally searchengine-safe, do not use variables on the
url, do not rely on cookies and do not rely on POST variables for the pages
you want to have the searchengine spider.

Also, you could make a robots.txt file and instruct the searchengines to
spider only particular pages on your site.

-Sander






Hello, Is there a way to upload files from the local PC/UNIX to the web 
sever? Especially multiple files at the same time?  What we need to do at 
the server and client side?

Thank you very much in advance.

Best Regards,

David


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com






Hello david, 

(dk == "david klein") [EMAIL PROTECTED] writes:

dk> Hello, Is there a way to upload files from the local PC/UNIX to the web 
dk> sever? Especially multiple files at the same time?  What we need to do at 
dk> the server and client side?

 Documents:
 http://www.php.net/manual/en/html/features.file-upload.html
 http://www.php.net/manual/en/html/feature-fileupload.multiple.html


-Brian
--
Caution: Cape does not enable user to fly.






At 5:11 PM +0200 1/22/01, Teodor Cimpoesu wrote:

>It outputs "text" and I would expect "Databases".
>

there is a great help with finding out where stuff is in objects and 
arrays if you do a var_dump() or a print_r() of the object/array.

This might help to get insight on where the info is (it sure has 
helped me a lot debugging scripts that contained complex arrays).

-- 
Thierry Coopman - [EMAIL PROTECTED]
My opinions are personal, and have really nothing or nothing to do 
with Keytrade!

I WILL NOT WASTE CHALK
I WILL NOT WASTE CHALK
I WILL NOT WASTE CHALK
I WILL NOT WASTE CHALK

        Bart Simpson on chalkboard in episode 7G02




Hi Brinkman,!
On Mon, 22 Jan 2001, Brinkman, Theodore wrote:

> Maybe I'm missing something, but I'm thinking it's giving the correct
> output.
> 
> The 'TEXT' that is showing up just seems to be some sort of indication as to
> what type of data it found.
> 
> ELEMENT catalog                       //the parser found an element named
> 'catalog'
>   TEXT                                //the element 'catalog' is of type TEXT
>     content=                  //it had no content of its own
>     ELEMENT category          //inside it found an element named
> 'category'
>       ATTRIBUTE id            //'category' has an attribute named 'id'
>         TEXT                  //  the attribute 'id' is of type TEXT
>           content=db          //  the attribute 'id' has a value of 'db'
>       ATTRIBUTE name          //'category' has an attribute named 'name'
>         TEXT                  //  the attribute 'name' is of type TEXT
>           content=Databases   //  the attribute 'name' has a value of
> 'Databases'
>       TEXT                            //the element 'category' is of type
> TEXT
> [...]                                 //[...]
> 
> Somebody who knows better please correct me if I'm wrong.
> 
Point made! xmllint gives +1 but the first found node looks like:
[result of print_r ($node) ]

DomNode Object
(
    [name] => text
    [content] => 

    [node] => Resource id #3
    [type] => 3
)

I don't get it why `name' is `text'. Maybe I should file a bug report.
Just wanted to be sure it's not me being wrong.


> 
> Hey,
> I've been playing w/ DOM functions (not very documented, but cool :)
> and had the following:
> 
> [categories.xml]
> 
> <?xml version="1.0"?>
> <catalog>
>         <category id="db" name="Databases">
>                 <topic>
>                   <name>MySQL</name>
>                   <description>MySQL Manual</description>
>                 </topic>
> 
>                 <topic>
>                   <name>PostgreSQL</name>
>                   <description>PostgreSQL Manuals</description>
>                 </topic>
> 
>         </category>
>  </catalog>
> 
> [xmltest.php]
> <?php
> header ('Content-Type: text/plain');
> 
> $doc  = new DomDocument();
> $node = new DomNode();
> 
> $doc  = xmldocfile ('categories.xml');
> $root = $doc->root();
> $cats = $root->children();
> 
> $node = $cats[0];
> 
> print_r ($node->name);
> 
> 
> It outputs "text" and I would expect "Databases".
> 
> running xmllint gives:
> 
> [teo@teo xml]$ xmllint --debug categories.xml 
> DOCUMENT
> version=1.0
> URL=categories.xml
> standalone=true
>   ELEMENT catalog
>     TEXT
>       content=
>     ELEMENT category
>       ATTRIBUTE id
>         TEXT
>           content=db
>       ATTRIBUTE name
>         TEXT
>           content=Databases
>       TEXT
> [...]
> 
> 
> Any idea what's wrong?
> 
> TIA
> 
> 
-- teodor




On Sun, 21 Jan 2001, Jochen Kächelin wrote:

> i have the following problem:
>
> i have the possibility to create 100 different
> pop-boxes and 100 different email-addresses.
>
> the pop-boxes must have the following name:
>
> wpXXXX-jk, wpXXXX-info and so on where
> XXXX stands for my custumer number an the text
> after the '-' for the part of the email-address
> before the '@'.
>
> when I want to catch all email for
>
> [EMAIL PROTECTED] I need the following:
>
> host:       mail.domain.de
> username:   wpXXXX-jk
> passwort:     **********
>
> When I will create a new pop-box and a new email-adress I use
>
> $link=imap_open($MAILSERVER,$username, $passwort, OP_HALFOPEN);
> $test = imap_createmailbox ($link,imap_utf7_encode
> ("{$MAILSERVER}INBOX.$newname"));
>
> But how can I set the passwort for the new created pop-box?
>
> Please help me.
> THANXS!
>
> --
> **********************************************
> * Jochen Kächelin                            *
> * Ihr WEBberater - Werbeagentur Pulvermüller *
> * Stuttgarter Str. 3 - D-73033 Göppingen     *
> * www.wa-p.de - mailto:[EMAIL PROTECTED]          *
> **********************************************
>

You don't, because the function call you're using doesn't actually create any
new accounts; it just creates new folders under the account it's logged in as.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





while ( list($key, $val) = each($bikes["Road"]) ) {
                echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\"
HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>";
                echo "<TD><A HREF=\"$val\" CLASS=\"menu\">$key</A></TD>";
            }


-----Original Message-----
From: Brian V Bonini [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 8:55 AM
To: PHP Lists
Subject: [PHP] Newbie: array help....


I have this array;

$bikes = array(
     "Road"  => array(
          "Trek 5200"  => "URL",
          "Schwinn Fastback Pro"  => "URL",
          "Va Moots"  => "url"
     ),
     "Mountain"  => array(
          "Trek Fuel 90"  => "url",
          "Schwinn Homegrown"  => "url"
     ),
     "BMX"  => array(
          "Haro Mira 540"  => "url",
          "Schwinn Powermatic Pro"  => "url"
     ),
     "Kids" => array(
          "Schwinn Tiger" => "put URL here",
          "Schwinn Bumblebee" => "URL"
     )
);

and am trying to list only a portion of it.
E.g., how can I reference only $bikes["Road"]
in the snippet below?


Like this:
while ( list($key, $val) = each($bikes["Road"]) ) {
                echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\"
HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>";
                echo "<TD><A HREF=\"$val\" CLASS=\"menu\">$key</A></TD>";
            }

NOT:

while ( list($type, $subarray) = each($bikes) ) {
            while ( list($key, $val) = each($subarray) ) {
                echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\"
HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>";
                echo "<TD><A HREF=\"$val\" CLASS=\"menu\">$key</A></TD>";
            }
        }


-- 
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]





You don't need the embedded while loop

             while ( list($key, $val) = each($bikes["Road"]) ) {
                 echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\"
 HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>";
                 echo "<TD><A HREF=\"$val\"
 CLASS=\"menu\">$key</A></TD>";
             }

-----Original Message-----
From: Brian V Bonini [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 9:16 AM
To: Ignacio Vazquez-Abrams
Cc: PHP Lists
Subject: RE: [PHP] Newbie: array help....


That's what I thought, which seemed to be the obvious
however, when I tried that it returns an error.

"Warning: Variable passed to each() is not an array or object in pagetop.inc
on line 105"

PHP Version 4.0B2
BSDI BSD/OS 4.0.1
Zend Engine v0.90,

> -----Original Message-----
> From: Ignacio Vazquez-Abrams [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 22, 2001 11:56 AM
> To: Brian V Bonini
> Cc: PHP Lists
> Subject: Re: [PHP] Newbie: array help....
>
>
> each($bikes["Road"])
>
>
>
> On Mon, 22 Jan 2001, Brian V Bonini wrote:
>
> > I have this array;
> >
> > $bikes = array(
> >      "Road"  => array(
> >           "Trek 5200"  => "URL",
> >           "Schwinn Fastback Pro"  => "URL",
> >           "Va Moots"  => "url"
> >      ),
> >      "Mountain"  => array(
> >           "Trek Fuel 90"  => "url",
> >           "Schwinn Homegrown"  => "url"
> >      ),
> >      "BMX"  => array(
> >           "Haro Mira 540"  => "url",
> >           "Schwinn Powermatic Pro"  => "url"
> >      ),
> >      "Kids" => array(
> >           "Schwinn Tiger" => "put URL here",
> >           "Schwinn Bumblebee" => "URL"
> >      )
> > );
> >
> > and am trying to list only a portion of it.
> > E.g., how can I reference only $bikes["Road"]
> > in the snippet below?
> >
> > while ( list($type, $subarray) = each($bikes) ) {
> >             while ( list($key, $val) = each($subarray) ) {
> >                 echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\"
> > HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>";
> >                 echo "<TD><A HREF=\"$val\"
> CLASS=\"menu\">$key</A></TD>";
> >             }
> >         }
> >


--
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]





You don't need the embedded while loop

             while ( list($key, $val) = each($bikes["Road"]) ) {
                 echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\"
 HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>";
                 echo "<TD><A HREF=\"$val\"
 CLASS=\"menu\">$key</A></TD>";
             }
-----Original Message-----
From: Brian V Bonini [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 9:16 AM
To: Ignacio Vazquez-Abrams
Cc: PHP Lists
Subject: RE: [PHP] Newbie: array help....


That's what I thought, which seemed to be the obvious
however, when I tried that it returns an error.

"Warning: Variable passed to each() is not an array or object in pagetop.inc
on line 105"

PHP Version 4.0B2
BSDI BSD/OS 4.0.1
Zend Engine v0.90,

> -----Original Message-----
> From: Ignacio Vazquez-Abrams [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 22, 2001 11:56 AM
> To: Brian V Bonini
> Cc: PHP Lists
> Subject: Re: [PHP] Newbie: array help....
>
>
> each($bikes["Road"])
>
>
>
> On Mon, 22 Jan 2001, Brian V Bonini wrote:
>
> > I have this array;
> >
> > $bikes = array(
> >      "Road"  => array(
> >           "Trek 5200"  => "URL",
> >           "Schwinn Fastback Pro"  => "URL",
> >           "Va Moots"  => "url"
> >      ),
> >      "Mountain"  => array(
> >           "Trek Fuel 90"  => "url",
> >           "Schwinn Homegrown"  => "url"
> >      ),
> >      "BMX"  => array(
> >           "Haro Mira 540"  => "url",
> >           "Schwinn Powermatic Pro"  => "url"
> >      ),
> >      "Kids" => array(
> >           "Schwinn Tiger" => "put URL here",
> >           "Schwinn Bumblebee" => "URL"
> >      )
> > );
> >
> > and am trying to list only a portion of it.
> > E.g., how can I reference only $bikes["Road"]
> > in the snippet below?
> >
> > while ( list($type, $subarray) = each($bikes) ) {
> >             while ( list($key, $val) = each($subarray) ) {
> >                 echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\"
> > HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>";
> >                 echo "<TD><A HREF=\"$val\"
> CLASS=\"menu\">$key</A></TD>";
> >             }
> >         }
> >


--
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]





Hey all.  well, here's (probably) an easy question from me again (surprise
surprise).....

Here goes:  I'm putting together a photo gallery for some friends of mine
who own a nightclub, and who want to update photos themselves..... I know
there are scripts available to do the job, but I'd like to have a go at my
own.

Most of the stuff I can handle, but I just need to know what code I might
use for returning table cells correctly.  Let's say, for example, there are
5 photos that need returning to one of the photo pages, and I have the
photos in rows of three;  Obviously, there'd be an empty table cell.  And
I'm not sure exactly how I get the results back into rows correctly
anyway...  Bullet points and whole table rows are fine, but table cells?
Hrms.

Anyway, here's how I might've started writing the code, if I hadn't realised
I should ask for help first ;) :

<?

//  Connection code

$table = "<table border=\"0\" /* Yadda Yadda */ >";

while($row = mysql_fetch_array($result)) {

    $row = $photo['photo'];

$table .= "<tr><td>$photo</td>"
$table .= "<td>$photo</td></tr>";

    }

$table .= "</table>";

//  End Crap programming.

?>

So.  Any takers?  :)

James.






> 5 photos that need returning to one of the photo pages, and I have the
> photos in rows of three;  Obviously, there'd be an empty table cell.  And

> <?
>
> //  Connection code
>
> $table = "<table border=\"0\" /* Yadda Yadda */ >";
>

$table .= "<tr>";
$photocount = 0;

> while($row = mysql_fetch_array($result)) {
>
>     $row = $photo['photo'];
>
#> $table .= "<tr><td>$photo</td>"
#> $table .= "<td>$photo</td></tr>";

$table .= "<td>$photo</td>";
$photocount++;

if (($photocount % 3) == 2){
    #time to start a new row:
    $table .= "</tr><tr>";
}

>
>     }

$table .= "</tr>";

> $table .= "</table>";
>
> //  End Crap programming.
>
> ?>

The % operator is the "modulo" operator, aka "clock arithmetic".

Using $x % 3 makes it "count by threesies" and "wrap-around" to 0 when you
pass 2...

Anyway, when you hit '2', it will dump out the end row and new row tags.

BTW:  Any particular reason for building up the $table variable instead of
just spewing it out to the browser with echo (or print)?...  Unless you are
building some kind of template system, you are just making life hard on
yourself with it...

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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






Hello,

I'm using PHP and ClibPDF.  I want to take a pdf that already exists and add
a page to the end of it.  I might just be dumb but I haven't seen how to do
this in the documentation.  Does anyone know?

Thanks in advance!





Or better yet, put the directory for each user outside the web tree.  Then
they can't surf to it.  Store the filename and path in the database.  Use
fpassthru() to serve the file after going through authentication and sending
the appropriate headers.  This keeps your database from growing too much.

Just a thought.

John Parker

> -----Original Message-----
> From: Ignacio Vazquez-Abrams [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, January 22, 2001 11:01 AM
> To:   johnny p.
> Cc:   [EMAIL PROTECTED]
> Subject:      Re: [PHP] file storage/downloader...
> 
> On Sun, 21 Jan 2001, johnny p. wrote:
> 
> > Ok, here's the prolem:  I'm trying to create a feature on my site
> similar to
> > xdrive.com.  Basically I want the user to be able to upload a file and
> have
> > it stored on my server.  I also want to have the ability for the user to
> > download the file at a later time.  Account authentiaction is handled,
> no
> > problem, but I have no idea where to put the files.  I create a
> directory,
> > it may be guessed and even the filename might be guessed and any user
> may be
> > able to download the file, breaking user authentication.  If I store the
> > file in a non-apache directory, how does the user download the file?
> >
> > My goal is to have the second scenario work, create a directory for each
> > user for file storage, and somehow get the user to be able to download
> it
> > after being authenticated.  I do not want to use .htaccess files for
> this,
> > either.  I want it to be seemless with the rest of the features of the
> site.
> >
> > Thanks in advance for any ideas,
> >
> > johnny p.
> >
> 
> Use a database for this. Store the mimetype of the uploaded file so that
> it
> can be dwnloaded properly afterwards. No file/directory permissions
> problems,
> unlimited flexibility for authentication... what more could you want?
> 
> -- 
> Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>
> 




Anyone know that you can use C++ make a COM object for extend ASP functional
. But how about PHP ????
Could I make a extenion by C++ to make PHP more functional ?






See article on Extending PHP
http://www.webtechniques.com/archives/2001/01/junk/


"kenji chan" <[EMAIL PROTECTED]> wrote in message
94i1kt$2b8$[EMAIL PROTECTED]">news:94i1kt$2b8$[EMAIL PROTECTED]...
> Anyone know that you can use C++ make a COM object for extend ASP
functional
> . But how about PHP ????
> Could I make a extenion by C++ to make PHP more functional ?
>
>
>
> --
> 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 am testing on Window 2000, Apache, and PHP 4 (latest release).

Is it possible to execute a command / program from PHP? I tried using the

system()

function, but i get an unable to fork error.

I looked through the mailing list archives, and it looks like this might be
known bug. Is there any other way to execute a command line program from PHP
on this platform (that works)?

thanks...

mike chambers

[EMAIL PROTECTED]





Greetings, the only way which comes to my mind now is to use a stub
<FRAMESET>, e.g.

<FRAMESET ROWS="100%,0">
 <FRAME NAME=main SRC=http://www.foo.co.uk/house-search/>
 <FRAME NAME=dummy SRC=about:blank>
</FRAMESET>

this works 100%, though could sound weird at first.

HTH,
-- 
Vahan Yerkanian                       Email: [EMAIL PROTECTED]
Leading Web Developer / Designer      Phone: (374) 158-2723
Web Development Department            Fax:   (374) 128-5082
ARMINCO Global Telecommunications     http://www.arminco.com

Eric Dahnke wrote:
> 
> I just asked a similar question two hours ago, and would like to express
> my interest in this same question.
> 
> Sorry it for a no answer response.
> 
> AJDIN BRANDIC wrote:
> 
> > Perhaps not related to php but I was wandering, is it possible to hide
> > site's real url and replace it with something else (some other URL).  ie.
> > someone clicks on a link on www.blah.co.uk which takes the user to an
> > designated area (ie. /house-search/) on www.foo.co.uk.  I want
> > the user still to see www.blah.co.uk. This is just for aesthetic reasons
> > since ones the user finishes the search for houses (on
> > www.foo.co.uk/house-search/) he/she will return to www.blah.co.uk.
> >
> > I have tried www.javascripts.com but no success??
> >
> > Thanks
> >
> > Ajdin
> 
> --
> 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]




Back in my rough-and-ready PHP days, I used to report runtime errors
using include("some long description of the error");, which would
report:

file "some long description of the error" not found in foo.php line 32.

Which is great for developers, but awful if a Real User ever sees it.

So, lately I've been using a function, handleException(String
errorType), 
which draws a nice page describing gently that something has gone wrong,
etc. Unfortunately this way can't report the line number of the function
that called it and I'd rather not have to manually include that info 
at each calling site.  

If there was a PHP function that printed out the call-stack, I'd be
totally set.  Is there such a function (I looked, but perhaps with the
wrong keywords), or if not, could it be easily added?  

thanks,
dylan




> So, lately I've been using a function, handleException(String
> errorType),
> which draws a nice page describing gently that something has gone wrong,
> etc. Unfortunately this way can't report the line number of the function
> that called it and I'd rather not have to manually include that info
> at each calling site.
>
> If there was a PHP function that printed out the call-stack, I'd be
> totally set.  Is there such a function (I looked, but perhaps with the
> wrong keywords), or if not, could it be easily added?

I don't think there is such a thing just yet, but it has been asked for a
lot...

You could, of course, use handleException($error, __FILE__, __LINE__)
everywhere...

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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






look into asp2php

a search on google for asp2php should get you the huys home page.

On Monday, January 22, 2001, at 12:54 PM, Jacky@lilst wrote:

> Hi people, 
> I have one ASP site that need to be converted to be PHP3 ( on Linux OS). Is there 
>any proper way 
> to do this? The database detail is that the ASP site is using SQL7.0.  And the 
>database server 
> that is avaliable on my Linux server is MySql. 
> Any thoughts?   
> Jack 
> [EMAIL PROTECTED] 
> "There is nothing more rewarding than reaching the goal you set for yourself" 
>  

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
Abriasoft Senior Developer

(510)  623-9726x357
Fax: (510) 249-9125




Actually look under ftp://ftp.nl2k.ab.ca/pub/unix.

I will be keeping all off my software, latest incarnation, available there.


On Mon, Jan 22, 2001 at 11:52:46AM -0800, Michael A. Peters wrote:
> look into asp2php
> 
> a search on google for asp2php should get you the huys home page.
> 
> On Monday, January 22, 2001, at 12:54 PM, Jacky@lilst wrote:
> 
> > Hi people, 
> > I have one ASP site that need to be converted to be PHP3 ( on Linux OS). Is there 
>any proper way 
> > to do this? The database detail is that the ASP site is using SQL7.0.  And the 
>database server 
> > that is avaliable on my Linux server is MySql. 
> > Any thoughts?   
> > Jack 
> > [EMAIL PROTECTED] 
> > "There is nothing more rewarding than reaching the goal you set for yourself" 
> >  
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Michael A. Peters
> Abriasoft Senior Developer
> 
> (510)  623-9726x357
> Fax: (510) 249-9125
> -- 
> 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]
> 

-- 
God Queen and Country                           Member - Liberal International
Never Satan President and Republic   This is [EMAIL PROTECTED]  Ici [EMAIL PROTECTED]
Society MUST be saved! Republics must dissolve.
Birthdate 29 Jan 1969  Redhill Surrey England U.K. 




Hi All

I need to have some task performed all the time in the background (database
task etc.)
How is this possible with PHP. I do not have direct access to the OS (can
not make an application to run directly under linux). Is it possible to have
a PHP script execute all the time in some way.

Thanks
Benny

NB: Linux and Apache as system underneath.






> I need to have some task performed all the time in the background
(database
> task etc.)
> How is this possible with PHP. I do not have direct access to the OS (can
> not make an application to run directly under linux). Is it possible to
have
> a PHP script execute all the time in some way.

Hmmmm.

Do you have telnet or SSH access, and can you install a "cron" job?...

Log in and do like this:

crontab -l

(That's an L for List, not 1)

This will list your (probably non-existant) cron jobs so far.

If that works, odds are that reading:

man 5 crontab

will have you pretty much hooked up on the "doing something regularly"
part...  Or at least, you'll see how it could maybe work once you figure out
all those *'s and stuff. :-)

Then you have to ask yourself, "Self, is PHP installed as a CGI binary
anywhere on this thing?"  Cuz if it is, it's way more better from a purist
perspective...  So, try this:

find / -name php -print 2> /dev/null | less

You may wanna take a coffee break right about here...  It's searching your
entire ISPs hard drive for the PHP binary...

Now, if that turns up a file that looks like it might be the php binary...
Do this:

ls -alsh XXX
where XXX is the thing you found and make sure it's a nice big file (a meg
or two) and not just some directory or something.

If it is, you can write a PHP script like this:

#!/full/path/to/php -q
<?php
    #your code here
?>

And then you can do:
chmod 775 myscript.php

Once you do *that* you can just slide /full/path/to/myscript.php right there
into your cron list using:

crontab -e

You'll be in an editor, and you can put in something like this:
0 1 * * * /full/path/to/myscript.php
and save it.
This one fires off at 1 am, every day.

Now, if you never did find the PHP binary, all is not lost.  There might be
"wget" on your server, and you can use crontab to make that *surf* to your
PHP page every day, still using crontab.

Now, even if you can't find that wget thingie, you almost for sure have
"lynx" on your server, and you can use *that* to surf to your page every
day.

PHP as a CGI (the first choice) is more efficient, wget after that, and lynx
last of all.

Still, they'll all get the job done.

Don't worry if it takes awhile to get the hang of this cron stuff -- Took me
months to figure it out the first time around (well, I had some editor
problems mixed in there too).  Once you do one of them, though, you find all
sorts of nifty things that it's handy for.  You don't want to get carried
away, of course, cuz cron is no magic bullet.  Each of those jobs you run
takes up some work, and they can add up if you get silly about it.

Still, all sorts of low-level maintenance and menial tasks can be automated
this way, and setting it up is not much harder than doing the task once.
But once it's going, you can cross it off your ToDo list practically
forever.

I know that was kinda ramblin', but that's the way I was feelin'  Hope it's
okay.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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






Thanks Richard for the info. Will try to see if I can make something work. I
do think that a background job thread is missing from PHP (as standard
functions etc.)

Benny


""Richard Lynch"" <[EMAIL PROTECTED]> skrev i en meddelelse
06a501c084ca$19dc44a0$[EMAIL PROTECTED]">news:06a501c084ca$19dc44a0$[EMAIL PROTECTED]...
> > I need to have some task performed all the time in the background
> (database
> > task etc.)
> > How is this possible with PHP. I do not have direct access to the OS
(can
> > not make an application to run directly under linux). Is it possible to
> have
> > a PHP script execute all the time in some way.
>
> Hmmmm.
>
> Do you have telnet or SSH access, and can you install a "cron" job?...
>
> Log in and do like this:
>
> crontab -l
>
> (That's an L for List, not 1)
>
> This will list your (probably non-existant) cron jobs so far.
>
> If that works, odds are that reading:
>
> man 5 crontab
>
> will have you pretty much hooked up on the "doing something regularly"
> part...  Or at least, you'll see how it could maybe work once you figure
out
> all those *'s and stuff. :-)
>
> Then you have to ask yourself, "Self, is PHP installed as a CGI binary
> anywhere on this thing?"  Cuz if it is, it's way more better from a purist
> perspective...  So, try this:
>
> find / -name php -print 2> /dev/null | less
>
> You may wanna take a coffee break right about here...  It's searching your
> entire ISPs hard drive for the PHP binary...
>
> Now, if that turns up a file that looks like it might be the php binary...
> Do this:
>
> ls -alsh XXX
> where XXX is the thing you found and make sure it's a nice big file (a meg
> or two) and not just some directory or something.
>
> If it is, you can write a PHP script like this:
>
> #!/full/path/to/php -q
> <?php
>     #your code here
> ?>
>
> And then you can do:
> chmod 775 myscript.php
>
> Once you do *that* you can just slide /full/path/to/myscript.php right
there
> into your cron list using:
>
> crontab -e
>
> You'll be in an editor, and you can put in something like this:
> 0 1 * * * /full/path/to/myscript.php
> and save it.
> This one fires off at 1 am, every day.
>
> Now, if you never did find the PHP binary, all is not lost.  There might
be
> "wget" on your server, and you can use crontab to make that *surf* to your
> PHP page every day, still using crontab.
>
> Now, even if you can't find that wget thingie, you almost for sure have
> "lynx" on your server, and you can use *that* to surf to your page every
> day.
>
> PHP as a CGI (the first choice) is more efficient, wget after that, and
lynx
> last of all.
>
> Still, they'll all get the job done.
>
> Don't worry if it takes awhile to get the hang of this cron stuff -- Took
me
> months to figure it out the first time around (well, I had some editor
> problems mixed in there too).  Once you do one of them, though, you find
all
> sorts of nifty things that it's handy for.  You don't want to get carried
> away, of course, cuz cron is no magic bullet.  Each of those jobs you run
> takes up some work, and they can add up if you get silly about it.
>
> Still, all sorts of low-level maintenance and menial tasks can be
automated
> this way, and setting it up is not much harder than doing the task once.
> But once it's going, you can cross it off your ToDo list practically
> forever.
>
> I know that was kinda ramblin', but that's the way I was feelin'  Hope
it's
> okay.
>
> Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
> http://www.zend.com
> 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
>
>
>
> --
> 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 have these pictures that I'm using for my webpage. Their background
changes from blue to white. When I loaded them onto the server, they looked
very nice and they always looked good on netscape browsers. Every once and a
while though, the background turns bad and all the pictures look terrible on
AOL and Internet explorer. The colors don't fade evenly between each other
and it's rather ugly. I have to reload them or redraw them in order for them
to look the same on all the browsers. How can I fix this?
Very frustrated,
Patrick




This could be your video card or something.  I doubt is has anything to do
with php.  If you have an older card, or not enough ram on the card, you
might experience something like that.  Try updating your video card driver,
or replace the card.

Robert Zwink
http://zwink.levitate.org

-----Original Message-----
From: Pat Hanna [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 3:23 PM
To: php help
Subject: [PHP] picture quality question


I have these pictures that I'm using for my webpage. Their background
changes from blue to white. When I loaded them onto the server, they looked
very nice and they always looked good on netscape browsers. Every once and a
while though, the background turns bad and all the pictures look terrible on
AOL and Internet explorer. The colors don't fade evenly between each other
and it's rather ugly. I have to reload them or redraw them in order for them
to look the same on all the browsers. How can I fix this?
Very frustrated,
Patrick





older versions of AOL use a custom 256 palette to support the AOL gui.

this has nothing to do with php.

-alex


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] ("Robert V. Zwink")
> Newsgroups: php.general
> Date: 22 Jan 2001 13:15:19 -0800
> Subject: RE: [PHP] picture quality question
> 
> This could be your video card or something.  I doubt is has anything to do
> with php.  If you have an older card, or not enough ram on the card, you
> might experience something like that.  Try updating your video card driver,
> or replace the card.
> 
> Robert Zwink
> http://zwink.levitate.org
> 
> -----Original Message-----
> From: Pat Hanna [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 22, 2001 3:23 PM
> To: php help
> Subject: [PHP] picture quality question
> 
> 
> I have these pictures that I'm using for my webpage. Their background
> changes from blue to white. When I loaded them onto the server, they looked
> very nice and they always looked good on netscape browsers. Every once and a
> while though, the background turns bad and all the pictures look terrible on
> AOL and Internet explorer. The colors don't fade evenly between each other
> and it's rather ugly. I have to reload them or redraw them in order for them
> to look the same on all the browsers. How can I fix this?
> Very frustrated,
> Patrick
> 
> 
> -- 
> 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]
> 





estoy tratando de instalar php4 para windows 98, con el servidor web:
personal web server, estoy tratando de ejecutarlo con el php.exe


el problema es que no entiendo que tengo que hacer con el archivo 
browscap.ini ya que en el manual de instalacion dice que se puede fijar el 
pws para que apunte a :
c:\windows\system\intsrv\browscap.ini

eso en donde lo fijo o que?????

otra cosa

si solamente quiero ver si funciona ya la instalacion necesito compilar las 
extensiones????
al fin y al cabo son añadidos o no????


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Excuse por favor mi malo y posiblemente español incorrecto.

PHP no necesita ser compilado, y después de él está instalado para el web 
server personal Win98. Apenas cree una escritura simple que diga:

<HTML><BODY>
<?php
phpinfo();
?>
</BODY></HTML>

Excepto esta escritura como phpinfo.php o phpinfo.php4 y coloqúelo en la 
raíz del documento de su web server. Entonces intente ejecutarlo. Si viene 
para arriba con la información sobre su servidor entonces está trabajando.

Espero que esto ayude, yo no sea muy familiar con el lenguaje español.



At 02:32 PM 1/22/2001 , you wrote:
>estoy tratando de instalar php4 para windows 98, con el servidor web:
>personal web server, estoy tratando de ejecutarlo con el php.exe
>
>
>el problema es que no entiendo que tengo que hacer con el archivo 
>browscap.ini ya que en el manual de instalacion dice que se puede fijar el 
>pws para que apunte a :
>c:\windows\system\intsrv\browscap.ini
>
>eso en donde lo fijo o que?????
>
>otra cosa
>
>si solamente quiero ver si funciona ya la instalacion necesito compilar 
>las extensiones????
>al fin y al cabo son añadidos o no????






Ok, let me try this again... it seems my code was stripped by the server. 
If this doesn't work could someone tell me how I can post script and html 
tags within the body of my messages to the list server? Thanks.
-------------------

Excuse por favor mi malo y posiblemente español incorrecto.


PHP no necesita ser compilado, y después de él está instalado para el web 
server personal Win98. Apenas cree una escritura simple que diga:

&lt;html&gt;&lt;body&gt;
&lt;?php
phpinfo();
?&gt;
&lt;/body&gt;&lt;/html&gt;

Excepto esta escritura como phpinfo.php o phpinfo.php4 y coloqúelo en la
raíz del documento de su web server. Entonces intente ejecutarlo. Si viene
para arriba con la información sobre su servidor entonces está trabajando.


Espero que esto ayude, yo no sea muy familiar con el lenguaje español.



At 02:32 PM 1/22/2001 , you wrote:
>estoy tratando de instalar php4 para windows 98, con el servidor web:
>personal web server, estoy tratando de ejecutarlo con el php.exe
>
>
>el problema es que no entiendo que tengo que hacer con el archivo 
>browscap.ini ya que en el manual de instalacion dice que se puede fijar el 
>pws para que apunte a :
>c:\windows\system\intsrv\browscap.ini
>
>eso en donde lo fijo o que?????
>
>otra cosa
>
>si solamente quiero ver si funciona ya la instalacion necesito compilar 
>las extensiones????
>al fin y al cabo son añadidos o no????






""oswaldo Aldrete"" ...
> estoy tratando de instalar php4 para windows 98, con el servidor web:
> personal web server, estoy tratando de ejecutarlo con el php.exe

Prueba a instalarte un servidor de web que no sea de microchof, por ejemplo,
yo para hacer pruebas uso un omnihttpd, y la instalación va de lujo... te
instala las extensiones para PHP y el propio PHP automáticamente...


--
        _         Iván Sánchez Ortega "MR"
  /|/| |_>        (eme)(erre)(punto)(arroba)wanadoo.es
 / | | | \
/    |    \    No, mamá, no toques ese cab#@@%%##  [NO CARRIER]






I have a question for a friend of mine (yes, it's actually for a friend of mine). Here 
is my code below. First of all, am I correct in assuming I could download a file and 
parse it using fopen("url")? Secondly, if I find an IMG tag, how would I go about 
grabbing the file that is contained in the SRC of that image tag? Would another simple 
fopen() and fput() to another file work with that, or is there an easier way?

$file = fopen("http://url");
while(!feof($file)) {
    $newline = fgets($file);
    if(str_replace("IMG SRC", "", $newline) != $newline) {
        /*do stuff*/
    }
}


Thanks a lot everyone!

Liam...




>First of all, am I correct in assuming I could download a file and parse it
using fopen("url")?

Yup.  Pretty darn nifty, huh?

>Secondly, if I find an IMG tag, how would I go about grabbing the file that
is contained in the SRC of that image tag?
>Would another simple fopen() and fput() to another file work with that, or
is there an easier way?

Yup, another fopen() and fgets() and away you go -- You snarfed the image.
You'll have to be kinda careful about your urls and files and not trip over
your own feet having two of each of them open at the same time, though. :-)
I'd say use $htmlurl and $imgurl, and $htmlfile and $imgfile to keep 'em
straight.

>    if(str_replace("IMG SRC", "", $newline) != $newline) {

This won't catch those heathens using lowercase or MixedCase for their HTML
tags.  While they deserve to burn in hell for it, I reckon you probably
would rather work with them while they're still here on Earth.

It also won't catch any heretics doing something wacky like <IMG BORDER=0
SRC=...>, which is, of course, totally immoral, even if it does match HTML
spec.

if (stristr($newline, "<IMG")){

will catch all legal image tags. :-)

Then you'll want something like:
ereg_match("*SRC\=(*) *", $newline, $parts);
$imgurl = $parts[2];
Only I always screw up regex, so you'll have to mess around with that part.

I think I'm getting punchy... Wonder why?...

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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,

i've got a $var1 that's referencing to a $var2 ($var1=&$var2;) ..

now, when i do unset($var1) it just unlinks the reference, instead
of "clearing" both variables (arrays) like i would want it to do..

any ideas how to get around that? as a bonus, the actual name of 
$var2 is not known at the point where unset() is done.


Rgds,
  Tfr

  --==< [EMAIL PROTECTED] >==< http://tfr.cafe.ee/ >==< +372-50-17621 >==--  




Hi,

> i've got a $var1 that's referencing to a $var2 ($var1=&$var2;) ..
> 
> now, when i do unset($var1) it just unlinks the reference, instead
> of "clearing" both variables (arrays) like i would want it to do..
> 
> any ideas how to get around that? as a bonus, the actual name of 
> $var2 is not known at the point where unset() is done.

ask myself, answer myself :)

$var1=array() did the trick.


Rgds,
  Tfr

  --==< [EMAIL PROTECTED] >==< http://tfr.cafe.ee/ >==< +372-50-17621 >==--  




try $var1 = NULL

I think that will work

Rom
----- Original Message ----- 
From: indrek siitan <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 4:33 PM
Subject: [PHP] quick PHP question on unset()


Hi,

i've got a $var1 that's referencing to a $var2 ($var1=&$var2;) ..

now, when i do unset($var1) it just unlinks the reference, instead
of "clearing" both variables (arrays) like i would want it to do..

any ideas how to get around that? as a bonus, the actual name of 
$var2 is not known at the point where unset() is done.


Rgds,
  Tfr

  --==< [EMAIL PROTECTED] >==< http://tfr.cafe.ee/ >==< +372-50-17621 >==--  

-- 
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 have note tested this, but I think you can probably get this in before the
apache header info:

header("HTTP/1.0 200 OK");

I'll go test that, I've also got a 404 handler, and wouldn't mind never
having 404s reported to IE :)

-alex


--
Alex Black, Head Monkey
[EMAIL PROTECTED]

The Turing Studio, Inc.
http://www.turingstudio.com

vox+510.666.0074
fax+510.666.0093

Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522




> From: [EMAIL PROTECTED] (Dieter Kneffel)
> Organization: http://mopilot.com - your personal mobile agent
> Newsgroups: php.general
> Date: 22 Jan 2001 05:58:52 -0800
> Subject: [PHP] 404 handler
> 
> Currently I use customized pages for 404 error handling.
> Problem is, even if my HTML page is sent, the header still
> contains the '404 not found'
> 
> How can I avoid an '404 not found' header to be sent?
> I want a normal page to show up without having sent
> the usuall 404 header.
> 
> Thanks,
> 
> dk
> 
> -- 
> 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]
> 





Hello all,

I am having a table named 'mytable' of 5 rows in a
MySQL database. I tried to print '5' which is the
highest row onto the screen. I used the following code
for that:

$result=mysql_query('select max(id) from mytable');
$max=mysql_result($result);
print ('Max id in the table=$max');

But what all i am getting is an error like below:

Warning:Wrong parameter count for mysql_result() in
/home/httpd/info.php on line xx
Max id in the table=$max

i am confused about which function to use instead of
mysql_result().

please help
Chakravarthy K Sannedhi


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/




> $max=mysql_result($result);

$max = mysql_num_rows($result).

- the L






Try this:

$result=mysql_query('select max(id) as max_id from mytable');
$max=mysql_result($result, 0, 'max_id');
print ('Max id in the table=$max');

HTH

Sam Masiello
Systems Analyst
Chek.Com
(716) 853-1362 x289
[EMAIL PROTECTED]

 -----Original Message-----
From:   Chakravarthy K Sannedhi [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, January 22, 2001 4:44 PM
To:     [EMAIL PROTECTED]
Subject:        [PHP] Selecting max(id) of a table

Hello all,

I am having a table named 'mytable' of 5 rows in a
MySQL database. I tried to print '5' which is the
highest row onto the screen. I used the following code
for that:

$result=mysql_query('select max(id) from mytable');
$max=mysql_result($result);
print ('Max id in the table=$max');

But what all i am getting is an error like below:

Warning:Wrong parameter count for mysql_result() in
/home/httpd/info.php on line xx
Max id in the table=$max

i am confused about which function to use instead of
mysql_result().

please help
Chakravarthy K Sannedhi


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.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]





If you are using auto-incrementing id column mysql_num_rows won't give you a
reliable number

try

$max=mysql_result($result, 0);


-----Original Message-----
From: Liam Gibbs [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 1:48 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Selecting max(id) of a table


> $max=mysql_result($result);

$max = mysql_num_rows($result).

- the L


--
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]





Sometime ago I read that it is possible to configure UltraEdit to interprete
PHP Code.
Is this correct?  Which configuration settings do I have to make in
UltraEdit?

Steve Haemelinck





hey Steve,

look here:
http://www.ultraedit.com/downloads/additional.html
for your additional wordfiles/tagfiles for ie. PHP (and a _lot_ of other
languages)

Kees Hoekzema
[EMAIL PROTECTED]

-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Namens
Steve Haemelinck
Verzonden: Monday, January 22, 2001 10:56 PM
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] PHP && UltraEidt


Sometime ago I read that it is possible to configure UltraEdit to interprete
PHP Code.
Is this correct?  Which configuration settings do I have to make in
UltraEdit?

Steve Haemelinck


--
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 am wrting a php page that will write out an email message to the email
address retrieved from Db. If i want to have CC function togethere with
mailTo, how could I do that?

Use the optional fourth argument to send Cc: header with the mail.

$headers = "Cc: [EMAIL PROTECTED]\r\n";
$headers .= "Cc: [EMAIL PROTECTED]\r\n";
mail($to, $subject,$body, $headers);

WARNING:
Using builtin PHP email in rapid-fire high-volume (like, 20 or 50 messages
in a row) is highly error-prone.  You're forking sendmail on each mail() and
that's a big performance hit.
Upgrade to Manuel Lemos email class, or to some other user-contributed
package that spews email directly to port 25, thereby bypassing the sendmail
fork limitations.

WARNING:
Even spewing directly to port 25 is not designed for truly high-volume
email.  Custom email software such as majordomo, ezmlm, SmartList, et al
"pre-sort" outgoing email by its destination -- IE, all the "yahoo.com"
emails get sent together.  And they, errr..., do other magical things I
don't know about, but that you're not gonna duplicate in an afternoon of PHP
scripting.
If you are sending the same email to a bazillion people, use custom email
software and integrate it with PHP.

WARNING:
Even majordomo et al aren't designed to handle spam-quantity email.
If you're contemplating spamming, don't.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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







Hey!

After bringing and fetching the results, the data from a money field is treated like 
strings. There is a function or a command to make it treat the variables as numbers?

Because I want to sum them.

Thank you,

Rom




I am sorry about this - I figured out already - was nothing to do with the
convertion...

Rom

----- Original Message -----
From: Romulo Roberto Pereira <[EMAIL PROTECTED]>
To: php-general <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 5:15 PM
Subject: [PHP] MSSQL field type money bring a string not a number back


Hey!

After bringing and fetching the results, the data from a money field is
treated like strings. There is a function or a command to make it treat the
variables as numbers?

Because I want to sum them.

Thank you,

Rom






Hi,

since i am on 56k i was wondering if instead of downloading a file from some 
server and then uploading it again to my server, if i could just have PHP 
tell the server to download it from the server the original file was in.





Maybe -- If php was installed with FTP, you can have it FTP stuff
dynamically...

Might be easier to log in to the other server and do FTP by hand for just
one file though...



Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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: <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, January 22, 2001 4:20 PM
Subject: [PHP] downloading


> Hi,
>
> since i am on 56k i was wondering if instead of downloading a file from
some
> server and then uploading it again to my server, if i could just have PHP
> tell the server to download it from the server the original file was in.
>
>
> --
> 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]
>





Does anyone have a piece of code that calculates shipping costs in real time, that 
could easily be placed into an existing e-commerce site?

Thanks.
Dave M.




Dave,

This guy wrote a class to figure out UPS shipping rates. You might be able
to start with it. Just go to the CODE section. I found it through
Google.com.

http://www.brogdon.net/~darrell/

Toby

----- Original Message -----
From: "Dave M." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 8:48 PM
Subject: [PHP] Quick Shipping


Does anyone have a piece of code that calculates shipping costs in real
time, that could easily be placed into an existing e-commerce site?

Thanks.
Dave M.






"Dave M." wrote:
> 
> Does anyone have a piece of code that calculates shipping costs in real time, that 
>could easily be placed into an existing e-commerce site?
> 
> Thanks.
> Dave M.

look at http://www.intershipper.com/
and a PHP class from 
http://www.digitalmayhem.com/code.php?action=php&module=intershipper

The service is free (just a little banner for intershipper) and the class works
great. You can even get rates from multiple carriers at the same time. There are
some other similar services out there that trade the banner add for a monthly
fee and function in a similar way, but this is the only code I've seen for free.

Enjoy,
David Pieper


-- 
programmer n. /pro gram er/ A device for transmuting caffeine into code.




I never really got an answer to this one, it probably drowned in the
discussion, so...

Are there any real performance gained by turning register_globals off? After
all, it must take the php engine some clock cycles to generate all the
global variables. Have anyone tested it?

- Carsten
~~~~~~~~~~~~~~~~






> Are there any real performance gained by turning register_globals off?
After
> all, it must take the php engine some clock cycles to generate all the
> global variables. Have anyone tested it?

It can't be that many clock cycles...

I think people do it more to stop hackers from trying to use a mix of GET
and POST to confuse their code than for clock cycles.

Your best bet is to test it on your own server anyway -- Nothing else will
be very accurate.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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






> mysql use myisamchk and myisamchk --recover to check and repair the table.
> However, does anybody know how myisamchk indicates that whether the table
is
> damaged or
> whether the the repair is successful  when running myisamchk or
> myisamchk --recover command?

I'm pretty sure you get informative messages if anything is broken or needs
fixing...

If you need the exact text of the possible messages, you'll probably have to
read the source, but it might be documented on http://mysql.org

The MySQL mailing list or other support forums will probably have more
experience and better answers with this one.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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 anyone know how to create a .zip file using php?

Hmmmm.   Not sure if gzip can handle .zip file per se, or if .gz file is
okay for what you need, but try here:

http://php.net/manual/en/ref.zlib.php


If not, there's probably some software out there somewhere that runs on
Linux that could be exec()ed to create a zip file.

If you are on Windows, I think the exec() stuff may or may not work
depending on a whole host of factors, such as PHP version, which Win version
you're on, ... Or maybe it just never worked...

But, if you could get exec() to work on your box, you could probably find a
command-line interface to a zip archive package somewhere.






> can anybody help me how to count seconds, minutes and hours in php?
> I want to sum values like 03:35,  02:31, 04:59, etc. and show the
> results in minutes.

Here's how I would try to do it:

<?php
    $times = array("03:35", "02:31", "04:59");
    $hours = 0;
    $minutes = 0;
    $seconds = 0;
    while (list(,$time) = each($times)){
        $minsec = explode(':', $time);
        $minutes += $minsec[0];
        $seconds += $minsec[1];
    }
    $minutes += (int) ($seconds/60);
    $seconds = $seconds % 60;
    $hours = (int) ($minutes/60);
    $minutes = $minutes % 60;
    if ($hours){
        echo "$hours hours, ";
    }
    echo "$minutes minutes, $seconds seconds<BR>\n";
?>

There's probably several other ways to do it.  YMMV.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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






{code snipped}

You could probably simplify this a bit with mktime(). The syntax is
mktime(hours, minutes, seconds):

$minsec = explode(":", $time);
$numsecs += mktime(0, $minsec[0], $minsec[1]);

That'll give you the number of seconds. Then at the end, you can say:

echo(floor($totalseconds / 60) . " minutes.");

to get the total number of minutes. Use ceil() instead of floor() if you
want to round up instead of down, or just echo((int)$totalseconds); to round
to the nearest integer.

Sig for a Day
Stephan Ahonen, ICQ 491101
"That's very funny Scotty, now beam down my clothes!"
Come back tomorrow for a different sig!
Backspace a single "s" to reply by email





> I'm trying to pass a string variable to a custom function, echoing its
> *value on one line, and its *name (that is, its key if this were an array

I think you are looking for "variable variables"...

<?php
    $foo = 'test';
    $test = 42;
    echo "$foo is ", $$foo, "<BR>\n";
?>

Note the use of $$ to sort of "follow the trail" down to a variable.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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 article <069f01c084ca$1642a320$[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
("Richard Lynch") wrote:

> > I'm trying to pass a string variable to a custom function, echoing its
> > *value on one line, and its *name (that is, its key if this were an array
> 
> I think you are looking for "variable variables"...

A variable variable results in a second variable which is named for the 
*value of the first.  So what I need is a sort of "inverse variable 
variable" to extract the *name of the first variable:

$foo="bar"
echo $foo   //"bar"
echo [something] //"foo"

I ended up doing a clumsy workaround by altering $foo--

$foo="bar"
$foo=array("foo"=>$foo)
echo $foo[key($foo)];  //"bar"
echo key($foo); //"foo"

--but then I'm having to tell PHP the very info that I was hoping it'd 
dynamically tell me. Any other suggestions would be much appreciated!

-- 
CC




> Hey all.  Does anyone have any ideas how I can carry over a selected
value?
> :)  It's probably easy but my mind is making it difficult.  A value is
> stored for a record in the DB which had been previously assigned through a

#get all the possible options into an array $options
$options = array('red', 'yellow', 'green');
#get the selected option into a variable $option
$option = 'yellow';
echo "<SELECT>\n";
while (list(,$opt) = each($options)){
    $selected = ($opt == $option) ? 'SELECTED' : '';
    echo "<OPTION $opt $selected>$opt</OPTION>\n";
}
echo "</SELECT>\n";

Twist on a theme:
If you can have a pre-determined order, you can have this work with multiple
selections, but only advancing the selected array (or result set or
whatever) when you have a match.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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






> With IIS $path gives the actual path to the directory in which the PHP
> scripts reside.  With Apache, $path is empty.  What have I missed?  This
> is my first use of Apache, so it's configuration is new for me.

What Apache gives depends on what Apache is configured to give...

$PHP_SELF is supposed to always have the path to PHP, but it's broken under
Windows CGI, I think...

Anyway, any time you have a question like this, the good news is:

<?php phpinfo();?>

If what you want is there, you have it.  If it's not there, it's because
Apache ain't giving it to PHP -- So you'll need to edit httpd.conf to change
it.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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






> How is the sintaxe of this command????

Like, a database rollback?

That depends on the database, not on PHP.

Something not unlike this:

$query = "rollback";
mysql_query($query);

Only I dunno if the mysql team has that new transaction stuff they bought
really integrated yet or not, much less what the SQL syntax for it is.

Try http://mysql.org for documentation on their transaction support.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
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







 From the preface of the manual:

    'PHP, which stands for "PHP: Hypertext Preprocessor" ...'

I frankly don't beleive that "PHP" started life as a recursively
defined acronym - I remember reading somewhere that it stood for
"Personal Home Page" which makes more sense to me.

Anybody know the truth?

Regs

Brian White
-------------------------
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy

http://www.steptwo.com.au/
[EMAIL PROTECTED]





Brian White wrote:
>     'PHP, which stands for "PHP: Hypertext Preprocessor" ...'
>
> I frankly don't beleive that "PHP" started life as a recursively
> defined acronym - I remember reading somewhere that it stood for
> "Personal Home Page" which makes more sense to me.
>
> Anybody know the truth?

IIRC it started as Personal Home Pages and later PHP: Hypertext Preprocessor" 
was voted to be the new name.

Wagner

-- 
One maniac alone can do what 20 together cannot




Yeah, it used to be called PHP/FI for Personal Home Page / Form 
Interpreter I do believe. Not sure about the "Interpreter" but I think
that was it.

Gfunk         -          http://www.gfunk007.com/

I sense much beer in you. Beer leads to intoxication, intoxication to
hangovers, and hangovers to... suffering.
  

----- Original Message ----- 
From: "Brian White" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 23, 2001 10:20 AM
Subject: [PHP] What "PHP" Stands For....


> 
>  From the preface of the manual:
> 
>     'PHP, which stands for "PHP: Hypertext Preprocessor" ...'
> 
> I frankly don't beleive that "PHP" started life as a recursively
> defined acronym - I remember reading somewhere that it stood for
> "Personal Home Page" which makes more sense to me.
> 
> Anybody know the truth?
> 
> Regs
> 
> Brian White
> -------------------------
> Brian White
> Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
> 
> http://www.steptwo.com.au/
> [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]
> 





That is what I have heard as well, "Personal Home page".

It has also been come to be known as "People hate perl".

And of course the (AFAIK) official "PHP: Hypertext Preprocessor".

Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "LINUX is obsolete"  -- Andy Tanenbaum, January 29th, 1992
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       http://www.JEEP-FOR-SALE.com/ -- I need a buyer
  Get your own Free, Private email at http://www.smackdown.com/

On Tue, 23 Jan 2001, Brian White wrote:

> Date: Tue, 23 Jan 2001 10:20:49 +1100
> From: Brian White <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [PHP] What "PHP" Stands For....
> 
> 
>  From the preface of the manual:
> 
>     'PHP, which stands for "PHP: Hypertext Preprocessor" ...'
> 
> I frankly don't beleive that "PHP" started life as a recursively
> defined acronym - I remember reading somewhere that it stood for
> "Personal Home Page" which makes more sense to me.
> 
> Anybody know the truth?
> 
> Regs
> 
> Brian White
> -------------------------
> Brian White
> Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
> 
> http://www.steptwo.com.au/
> [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]
> 
> 





That's the truth. PHP started out as a set of "Personal Home Page tools"
(1st version), then PHP/FI (PHP + form interpretter [or something similar -
I'm not sure 'form interpretter' is completely correct, but that was
basically the functionality of the FI portion])... anyway, then sometime
during PHP3/4 they opted to change it to Hypertext Preprocessor... it
wasn't really just "personal home page tools" anymore ;)

Anyway, I only know what I read - I got to the scene to late to actually
know this stuff first hand... hope this helps... and if someone who really
was on the scene back then cares to comment/correct me, please do ;)

--Toby

----- Original Message -----
From: "Brian White" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 6:20 PM
Subject: [PHP] What "PHP" Stands For....


>
>  From the preface of the manual:
>
>     'PHP, which stands for "PHP: Hypertext Preprocessor" ...'
>
> I frankly don't beleive that "PHP" started life as a recursively
> defined acronym - I remember reading somewhere that it stood for
> "Personal Home Page" which makes more sense to me.
>
> Anybody know the truth?
>
> Regs
>
> Brian White
> -------------------------
> Brian White
> Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
>
> http://www.steptwo.com.au/
> [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 - thanks. That has satisfied my curiosity....

At 03:32 PM 1/22/01 -0800, jeremy brand wrote:
>It has also been come to be known as "People hate perl".

... and tickled the old sense of humour.

Regs

Brian

-------------------------
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy

http://www.steptwo.com.au/
[EMAIL PROTECTED]





> That's the truth. PHP started out as a set of "Personal Home Page tools"
> (1st version), then PHP/FI (PHP + form interpretter [or something similar -
> I'm not sure 'form interpretter' is completely correct, but that was
> basically the functionality of the FI portion])... anyway, then sometime
> during PHP3/4 they opted to change it to Hypertext Preprocessor... it
> wasn't really just "personal home page tools" anymore ;)
>
> Anyway, I only know what I read - I got to the scene to late to actually
> know this stuff first hand... hope this helps... and if someone who really
> was on the scene back then cares to comment/correct me, please do ;)

I sort of do.  ;)

The first thing I put out was a collection of cgi scripts collectively
known as the Personal Home Page Tools.  These were tools I was using on my
own home page to track hits on my resume, do custom logging to mSQL and
other things.

I had another tool that wasn't really part of the package that I used to
process form data.  Because I am a lazy sod, I kept the filename short.
It was just "fi" in my cgi-bin directory.  I sat down and completely
rewrote the parser behind the PHP Tools and at that point it became very
obvious that the little FI tool needed to be an integral part of the
package.  That's where the whole concept of bringing form variables
directly in and making them available to all the different tools came
from.  When talking to people I described it as PHP/FI a couple of times
as a bit of a joke (because it looked like TCP/IP) and it just stuck.  I
couldn't think of a better name and people were starting to use it, so I
just left it.

When the development team grew and the next rewrite hit (PHP 3) it was
decided to drop the rather akward /FI part and just make it PHP, but since
even at this time it had grown to be significantly more than a set of
tools for personal home pages, that meaning was also dropped.  A name vote
ensued and all the proposed names sucked, so this PHP: Hypertext
Preprocessor name was deemed to suck the least.  So that's where we are.
As far as I am concerned PHP is just PHP.  It doesn't stand for anything.

-Rasmus





> That is what I have heard as well, "Personal Home page".
>
> It has also been come to be known as "People hate perl".

Hey now.  I'll deny to my grave I ever said that in public.  ;)

-Rasmus





> > It has also been come to be known as "People hate perl".
> 
> Hey now.  I'll deny to my grave I ever said that in public.  ;)

I never claimed you said it.  ;)   I will deny that I ever heard it
from you.  :)

Jeremy

Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "LINUX is obsolete"  -- Andy Tanenbaum, January 29th, 1992
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       http://www.JEEP-FOR-SALE.com/ -- I need a buyer
  Get your own Free, Private email at http://www.smackdown.com/





Rasmus, you are genius!

This is one of the coolests postings of yours I ever read in here.
I will now know how to talk about that guy who made it and what PHP stands
for.

I, personally, always knew it but never could explain myself:

The replies from my clients on my "well, then maybe we should design it in
PHP" usually are:
 "PHP"?
 What is "PHP"?
 What do you mean by "PHP" ?
 is that... ?
 oh... really?

 but "Hypertext Preprocessor" is "HPP" ... hmm makes no sense...
 oh... 
 "PHP:  Hypertext Preprocessor"? nor even that makes sense enough... that
would be "PHPHPP" ...  hmm...

.......and so on;...and so on;......and so on............

BUT Now I will have something to print out and to bring in my bag with me
all the time awaiting for these naive interrogations.

:-))

You are my saver, Rasmus!

Cheers,
Maxim Maletsky


-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 8:50 AM
To: Toby Butzon
Cc: [EMAIL PROTECTED]; Brian White
Subject: Re: [PHP] What "PHP" Stands For....


> That's the truth. PHP started out as a set of "Personal Home Page tools"
> (1st version), then PHP/FI (PHP + form interpretter [or something similar
-
> I'm not sure 'form interpretter' is completely correct, but that was
> basically the functionality of the FI portion])... anyway, then sometime
> during PHP3/4 they opted to change it to Hypertext Preprocessor... it
> wasn't really just "personal home page tools" anymore ;)
>
> Anyway, I only know what I read - I got to the scene to late to actually
> know this stuff first hand... hope this helps... and if someone who really
> was on the scene back then cares to comment/correct me, please do ;)

I sort of do.  ;)

The first thing I put out was a collection of cgi scripts collectively
known as the Personal Home Page Tools.  These were tools I was using on my
own home page to track hits on my resume, do custom logging to mSQL and
other things.

I had another tool that wasn't really part of the package that I used to
process form data.  Because I am a lazy sod, I kept the filename short.
It was just "fi" in my cgi-bin directory.  I sat down and completely
rewrote the parser behind the PHP Tools and at that point it became very
obvious that the little FI tool needed to be an integral part of the
package.  That's where the whole concept of bringing form variables
directly in and making them available to all the different tools came
from.  When talking to people I described it as PHP/FI a couple of times
as a bit of a joke (because it looked like TCP/IP) and it just stuck.  I
couldn't think of a better name and people were starting to use it, so I
just left it.

When the development team grew and the next rewrite hit (PHP 3) it was
decided to drop the rather akward /FI part and just make it PHP, but since
even at this time it had grown to be significantly more than a set of
tools for personal home pages, that meaning was also dropped.  A name vote
ensued and all the proposed names sucked, so this PHP: Hypertext
Preprocessor name was deemed to suck the least.  So that's where we are.
As far as I am concerned PHP is just PHP.  It doesn't stand for anything.

-Rasmus


-- 
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]




Acthually, it stands for Personal Home Page....

Frasre

On Tue, 23 Jan 2001, Alexander Wagner wrote:

> Brian White wrote:
> >     'PHP, which stands for "PHP: Hypertext Preprocessor" ...'
> >
> > I frankly don't beleive that "PHP" started life as a recursively
> > defined acronym - I remember reading somewhere that it stood for
> > "Personal Home Page" which makes more sense to me.
> >
> > Anybody know the truth?
> 
> IIRC it started as Personal Home Pages and later PHP: Hypertext Preprocessor" 
> was voted to be the new name.
> 
> Wagner
> 
> 





At 10:27 PM 1/22/2001, Fraser MacKenzie wrote:

i like people hate perl :-)

~kurth

>Acthually, it stands for Personal Home Page....
>
>Frasre
>
>On Tue, 23 Jan 2001, Alexander Wagner wrote:
>
> > Brian White wrote:
> > >     'PHP, which stands for "PHP: Hypertext Preprocessor" ...'
> > >
> > > I frankly don't beleive that "PHP" started life as a recursively
> > > defined acronym - I remember reading somewhere that it stood for
> > > "Personal Home Page" which makes more sense to me.
> > >
> > > Anybody know the truth?
> >
> > IIRC it started as Personal Home Pages and later PHP: Hypertext 
> Preprocessor"
> > was voted to be the new name.
> >
> > Wagner
> >
> >
>
>
>--
>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]





The one that is easiest to explain to clients is
'Professional Hypertext Preprocessor'

They don't get confused with the recursiveness of
PHP Hypertext Preprocessor, and it has the word "professional" in it.  The
recursiveness, like GNU meaning 'GNU's Not Unix' (or so I've heard) would
drive them batty.

"This statement is false" - they just wouldn't get it.

On the naming thing - perhaps if it was EHP for "Enterprise Hypertext
Preprocessor" more PHBs would give it their blessing.  After all, it would
say 'enterprise', so it MUST be good, right?  ;)



Brian White wrote:

>  From the preface of the manual:
>
>     'PHP, which stands for "PHP: Hypertext Preprocessor" ...'
>
> I frankly don't beleive that "PHP" started life as a recursively
> defined acronym - I remember reading somewhere that it stood for
> "Personal Home Page" which makes more sense to me.
>
> Anybody know the truth?
>
> Regs
>
> Brian White
> -------------------------
> Brian White
> Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
>
> http://www.steptwo.com.au/
> [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]





Hello Jeff,

Everyone has their favorite editor, and FWIW mine is editplus. I've
programmed for almost 20 years with many different editors and in
my opinion, this is the best editor I've ever used. It works
great with PHP.
www.editplus.com

Best regards,
 Randy   


Sunday, January 21, 2001, 11:36:35 PM, you wrote:

JL> Textpad is pretty good on Micro$ucks products.  It has a free evaluation
JL> which isn't very bothersome (unlike others...).  You can examine it as
JL> www.textpad.com.


JL> ""Karl J. Stubsjoen"" <[EMAIL PROTECTED]> wrote in message
JL> 003701c0815f$b6f80e40$0afc020a@kstubsjoen">news:003701c0815f$b6f80e40$0afc020a@kstubsjoen...
>> So what editor is recommended?  I'm a little familiar with Emacs (kinda
>> cool, but I'm use to keywords and such being colored - as in Interdev).
>>
>> 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]
>>






Hello,

I have a form in an htm file that is sending info to a cgi script
(formmail.pl) but the confirmation page I am using is php3. I want to pass
the value of a text box in the form to the php3 page.

Kinda like thanks you message $message has been sent.

I don't know how to send to the cgi script and pass the variable to the
confirmation page.
Here is my code so far for the form action.

<form method="POST"
action="/cgi-bin/formmail.pl?http://www.domainname.co.nz/developing/faq/faq_
confirm.php3">

So I need the faq_confirm.php3 page to appear, plus have it send the
variable $message that is one of the fields on the form.
I thought you just added it like ?message
But i already have a ?

Please help?

Chris






To pass more than one argument type:

http://foo.com/script.php?var1=hello&var2=foo&var3=bar

--Joe

On Tue, Jan 23, 2001 at 01:44:19PM +1300, Sefton wrote:
> Hello,
> 
> I have a form in an htm file that is sending info to a cgi script
> (formmail.pl) but the confirmation page I am using is php3. I want to pass
> the value of a text box in the form to the php3 page.
> 
> Kinda like thanks you message $message has been sent.
> 
> I don't know how to send to the cgi script and pass the variable to the
> confirmation page.
> Here is my code so far for the form action.
> 
> <form method="POST"
> action="/cgi-bin/formmail.pl?http://www.domainname.co.nz/developing/faq/faq_
> confirm.php3">
> 
> So I need the faq_confirm.php3 page to appear, plus have it send the
> variable $message that is one of the fields on the form.
> I thought you just added it like ?message
> But i already have a ?
> 
> Please help?
> 
> Chris
> 
> 
> 
> -- 
> 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]

-- 

Joe Stump, PHP Hacker
[EMAIL PROTECTED]
http://www.miester.org/





----------------------------------------------------------------------------
----------------- 
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
[EMAIL PROTECTED] and delete the email document without making a
copy. 
----------------------------------------------------------------------------
-----------------
Hi guys whats the best way to turn off PHP for a directory?
 
"php_flag engine off" in a .htaccess but doesnt work as i am using Apache
and PHP CGI.
 
Any other possibilities?
 
 
 

Mark Nold
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
Senior Consultant
 
Change is inevitable, except from vending machines. 

 




----------------------------------------------------------------------------
----------------- 
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
[EMAIL PROTECTED] and delete the email document without making a
copy. 
----------------------------------------------------------------------------
-----------------
After a bit of further playing it appears that simply AddType with the same
extensions that were set up should also stop php from working.

So in a .htaccess file you can just 
AddType text/plain .php4 .php .inc .htm


Or in httpd.conf put something like

<LocationMatch "/test/att.*">
AddType text/plain .php4 .php .inc .htm
</LocationMatch>

That way any directory like http://myserver.com/test/attachements/ wont be
parsed by PHP.

mn


Mark Nold
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
Senior Consultant
 
Change is inevitable, except from vending machines. 



-----Original Message-----
From: Lewis Bergman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 10:28 AM
To: Nold, Mark
Subject: Re: [PHP] Turning off PHP for one directory with apache


> Hi guys whats the best way to turn off PHP for a directory?
>  
> "php_flag engine off" in a .htaccess but doesnt work as i am using
> Apache and PHP CGI.
>  
You could do it in httpd .conf with the location directive.




Previously, Nold, Mark said:
>
> After a bit of further playing it appears that simply AddType with the same
> extensions that were set up should also stop php from working.
> 
> So in a .htaccess file you can just 
> AddType text/plain .php4 .php .inc .htm

Wouldn't that spit the source code out to the browser though?  Personally
I would find that undesirable.

You could also do something like this, should work in an .htaccess or in
the httpd.conf/access.conf files:

# Stops .php .php3 .php4
<Files ~ "^.*\.php?$">
  order allow,deny
  deny from all
</Files>
# Stops .inc
<Files ~ "^.*\.inc$">
  order allow,deny
  deny from all
</Files>
# Stops .htm .html
<Files ~ "^.*\.htm?$">
  order allow,deny
  deny from all
</Files>

 -dan

-- 
Dan Lowe <[EMAIL PROTECTED]>                 http://tangledhelix.com/
  
Can vegetarians eat animal crackers?  -George Carlin




----------------------------------------------------------------------------
----------------- 
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
[EMAIL PROTECTED] and delete the email document without making a
copy. 
----------------------------------------------------------------------------
-----------------
You're right.

Thats exactly what i wanted. If you imagine uploaded files, or attachments
to email in a PHP mailing list archive. You definatly wouldnt want them to
execute code, in the case of mailing list archives you'd probably want to
display em.

Would anybody know how i can conigure Apache (with PHP as a CGI) to then
show these as PHP highlighted source?

Ive tried (im using a windows box to test)

Action application/x-httpd-php-source "/php4/php.exe -s"
AddType application/x-httpd-php-source .php4 .php .inc .htm

Any ideas what im doing wrong? (I do have a vague memory of someone say you
couldnt use this feature with PHP as a CGI)

Or can someone confirm its definatly not available in PHP as a CGI?

mn




Mark Nold
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
Senior Consultant
 
Change is inevitable, except from vending machines. 



-----Original Message-----
From: Dan Lowe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 12:42 PM
To: Nold, Mark
Cc: 'Lewis Bergman'; Php-General (E-mail)
Subject: Re: [PHP] Turning off PHP for one directory with apache


Previously, Nold, Mark said:
>
> After a bit of further playing it appears that simply AddType with the
same
> extensions that were set up should also stop php from working.
> 
> So in a .htaccess file you can just 
> AddType text/plain .php4 .php .inc .htm

Wouldn't that spit the source code out to the browser though?  Personally
I would find that undesirable.

You could also do something like this, should work in an .htaccess or in
the httpd.conf/access.conf files:

# Stops .php .php3 .php4
<Files ~ "^.*\.php?$">
  order allow,deny
  deny from all
</Files>
# Stops .inc
<Files ~ "^.*\.inc$">
  order allow,deny
  deny from all
</Files>
# Stops .htm .html
<Files ~ "^.*\.htm?$">
  order allow,deny
  deny from all
</Files>

 -dan

-- 
Dan Lowe <[EMAIL PROTECTED]>                 http://tangledhelix.com/
  
Can vegetarians eat animal crackers?  -George Carlin




Instead of:

> Action application/x-httpd-php-source "/php4/php.exe -s"
> AddType application/x-httpd-php-source .php4 .php .inc .htm

why not:

> Action application/x-httpd-php-source "/php4/php.exe
/path/to/showsource.php "
> AddType application/x-httpd-php-source .php4 .php .inc .htm

and using a php program that takes the input params and shows the
source for whatever file you're trying to look at?

I just pulled that out of my ass tho, dunno how viable it is as an idea
or a server directive, somebody out there correct me?

Gfunk         -          http://www.gfunk007.com/

I sense much beer in you. Beer leads to intoxication, intoxication to
hangovers, and hangovers to... suffering.


----- Original Message -----
From: "Nold, Mark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "'Lewis Bergman'" <[EMAIL PROTECTED]>; "Php-General (E-mail)"
<[EMAIL PROTECTED]>
Sent: Tuesday, January 23, 2001 3:49 PM
Subject: RE: [PHP] Turning off PHP for one directory with apache


> --------------------------------------------------------------------------
--
> -----------------
> Disclaimer: The information contained in this email is intended only for
the
> use of the person(s) to whom it is addressed and may be confidential or
> contain legally privileged information. If you are not the intended
> recipient you are hereby notified that any perusal, use, distribution,
> copying or disclosure is strictly prohibited. If you have received this
> email in error please immediately advise us by return email at
> [EMAIL PROTECTED] and delete the email document without making a
> copy.
> --------------------------------------------------------------------------
--
> -----------------
> You're right.
>
> Thats exactly what i wanted. If you imagine uploaded files, or attachments
> to email in a PHP mailing list archive. You definatly wouldnt want them to
> execute code, in the case of mailing list archives you'd probably want to
> display em.
>
> Would anybody know how i can conigure Apache (with PHP as a CGI) to then
> show these as PHP highlighted source?
>
> Ive tried (im using a windows box to test)
>
> Action application/x-httpd-php-source "/php4/php.exe -s"
> AddType application/x-httpd-php-source .php4 .php .inc .htm
>
> Any ideas what im doing wrong? (I do have a vague memory of someone say
you
> couldnt use this feature with PHP as a CGI)
>
> Or can someone confirm its definatly not available in PHP as a CGI?
>
> mn
>
>
>
>
> Mark Nold
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> Senior Consultant
>
> Change is inevitable, except from vending machines.
>
>
>
> -----Original Message-----
> From: Dan Lowe [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 23, 2001 12:42 PM
> To: Nold, Mark
> Cc: 'Lewis Bergman'; Php-General (E-mail)
> Subject: Re: [PHP] Turning off PHP for one directory with apache
>
>
> Previously, Nold, Mark said:
> >
> > After a bit of further playing it appears that simply AddType with the
> same
> > extensions that were set up should also stop php from working.
> >
> > So in a .htaccess file you can just
> > AddType text/plain .php4 .php .inc .htm
>
> Wouldn't that spit the source code out to the browser though?  Personally
> I would find that undesirable.
>
> You could also do something like this, should work in an .htaccess or in
> the httpd.conf/access.conf files:
>
> # Stops .php .php3 .php4
> <Files ~ "^.*\.php?$">
>   order allow,deny
>   deny from all
> </Files>
> # Stops .inc
> <Files ~ "^.*\.inc$">
>   order allow,deny
>   deny from all
> </Files>
> # Stops .htm .html
> <Files ~ "^.*\.htm?$">
>   order allow,deny
>   deny from all
> </Files>
>
>  -dan
>
> --
> Dan Lowe <[EMAIL PROTECTED]> http://tangledhelix.com/
>
> Can vegetarians eat animal crackers?  -George Carlin
>
> --
> 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]
>





can anyone tell me whats wrong with this function:

function AuthenticateUser($user, $password)
{
global $DB_Server, $HTTP__Host, $DB_Login, $DB_Password, $DB_Name, $DocRoot
;
// Open a connection with the MySQl server
if (!($link = mysql_connect ($DB_Server,$DB_Login, $DB_Password))) {
DisplayErrMessage(sprintf("internal error %s %s %s %d:%s\n",$DB_Server,
$DB_Login, $DB_Password,
mysql_errno(), mysql_error()));
return 0 ;
}
// Do the user/password authentication via attempted update of stats
if (!($result = mysql_db_query($DB_Name,"UPDATE users SET visits='4' WHERE
user_id='$user' AND password='$password'")))
return 0;
else
return 1;
}


code that references the above function
if (AuthenticateUser($form_user_id, $form_password)){
setcookie("cookie_passwd",$form_password);
setcookie("cookie_user",$form_user_id);
header("Location:http://$HTTP_Host/$DocRoot/default_authenticated.php");
exit();
} else {
header("Location:http://$HTTP_Host/$DocRoot/error.php?type=badpass");
exit() ;
}

It's ment to test the validity of a login attempt with a user and passoword
by updateing the colum visits to a new value. But weather or not this update
passes or fails the return value seems to be 1 as the page is rediredted to
the logged in page.
Also can I update the visits value in the SQL command I've tried
visits=visits+1 but that does not seem to work even though I have seen this
done with a $variable instead of the value one.
Any help would be appreciated.
Jamie





is "$HTTP__Host" just a typo?

it should be $HTTP_HOST.

Cheers,
Maxim Maletsky

-----Original Message-----
From: Jamie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 11:41 AM
To: PHP
Subject: [PHP] Function with True / False return


can anyone tell me whats wrong with this function:

function AuthenticateUser($user, $password)
{
global $DB_Server, $HTTP__Host, $DB_Login, $DB_Password, $DB_Name, $DocRoot
;
// Open a connection with the MySQl server
if (!($link = mysql_connect ($DB_Server,$DB_Login, $DB_Password))) {
DisplayErrMessage(sprintf("internal error %s %s %s %d:%s\n",$DB_Server,
$DB_Login, $DB_Password,
mysql_errno(), mysql_error()));
return 0 ;
}
// Do the user/password authentication via attempted update of stats
if (!($result = mysql_db_query($DB_Name,"UPDATE users SET visits='4' WHERE
user_id='$user' AND password='$password'")))
return 0;
else
return 1;
}


code that references the above function
if (AuthenticateUser($form_user_id, $form_password)){
setcookie("cookie_passwd",$form_password);
setcookie("cookie_user",$form_user_id);
header("Location:http://$HTTP_Host/$DocRoot/default_authenticated.php");
exit();
} else {
header("Location:http://$HTTP_Host/$DocRoot/error.php?type=badpass");
exit() ;
}

It's ment to test the validity of a login attempt with a user and passoword
by updateing the colum visits to a new value. But weather or not this update
passes or fails the return value seems to be 1 as the page is rediredted to
the logged in page.
Also can I update the visits value in the SQL command I've tried
visits=visits+1 but that does not seem to work even though I have seen this
done with a $variable instead of the value one.
Any help would be appreciated.
Jamie


-- 
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]




Got it in the end. It should be:

<snip>


if  ((preg_match("/Mozilla/i", "$agent")) && (preg_match("/Gecko/i",
"$agent")))  {
        $result = "You are using Netscape 6 or a later version of Mozilla.";

<snip>

But the thought occurs that there must be a site out there somewhere
which lists the HTTP_USER_AGENT tags for *all* browsers?
-- 
******************************************************************************
Marx: "Why do Anarchists only drink herbal tea?"
Proudhon: "Because all proper tea is theft."
******************************************************************************




No idea dude, but I will bring the topic back to the top and some
all-knowledgable guru will hopefully help you *hint hint* :)

-----Original Message-----
From: Bruno Freire [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 23 January 2001 3:01 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Help!!! MY ODBC!!!!


Hi everyone!!
My name is BRUNO, and I'm in Brazil........

I dont know how to configure my_odbc!!!

What I wanna do:

I wanna make a report using The Crystal reports.
My Mysql database is placed in a pc with LINUX. Then i have instaled Myodbc
in may pc with Win98 but just install the MYODBC doesn't work!!!

Please, If somebody knows that......HEEEEEELLLLPPPPP!!!!!

Thanks.



Reply via email to