Re: [PHP] Recommendations for PHP/MySQl calendar & on-line submission/votin g

2002-11-25 Thread David T-G
Dave, et al --

...and then Merritt, Dave said...
% 
% I working with helping our local high school technical center set up a web
% server/site.  Went with the typical AMP solution (unfortunately on MSWin

Hey, three out of four ain't bad :-)


% though).  The center is wanting to add an on-line calendar system.  This

If you'll consider perl, Maorong Zou's webcalendar (see

  http://www.ma.utexas.edu/~mzou/webCal/

and

  http://www.math.utexas.edu/pipermail/webcalendar/

for info) is quite mature.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg87273/pgp0.pgp
Description: PGP signature


Re: [PHP] Method for displaying Downline

2002-12-01 Thread David T-G
Daren --

...and then Daren Cotter said...
% 
% I need to display an entire downline (info about all
% members referred by another member). The query to
...
% The output I need is something like:
% 
%  7
%10 11
%14  16 18  20
%  26  28  31  34 36  38  41  44
% 
% Where 7 referred 10 and 11, 10 referred 14 and 16, 14
...

% 
% I know some sort of looping (possibly recursion?)

That depends on how you have your tables structures.  This is a perfect
opportunity for a binary tree, which is also easy to traverse.  How is
the data stored?


% structure is needed, but I can't figure out how to
% display the output in tables as shown above.

See if you can live with something like

   7
  10  11
  14  16  18  20
  26  28  31  34  36  38  41  44

and then go from there.  That's trivial.

If that won't work, then you can calculate the number of cells you'll
have to have running across the table as 2n+1, where n is the referral
depth, and then calculate the position based on what level and what path.


% 
% Any help would be greatly appreciated!


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg87970/pgp0.pgp
Description: PGP signature


Re: [PHP] re: ini_set() / Jason Wong / dynamically setting this?

2002-12-03 Thread David T-G
Matt --

...and then Matt Babineau said...
% 
% Hi everyone:

Hi!


...
% 
% I am working on a website, and I have a shared hosting account on a
% win2k machine. When I upload from my local machine to the shared hosting
% machine I have to change a variable on each of my pages that gives me
% the proper path to including the necessary files to execute the page
% properly. If I don't I get an error.

What I've done is put a bit of code in each of my scripts

  # this will let us figure out where we are and then always source the right include 
stuff!
  # it does not work with symlinks (__FILE__ reports the *target*)
  # you must have a full env tree in your devel tree; we now look exclusively in 
$DEVELDIR if set
  if ( ereg("/home/sites/\.php/",__FILE__) )# are we *somewhere* in our 
usual master tree?
{ $DEVELDIR = preg_replace("|/.*/home/sites/\.php(.*)/[^/]*$|","\\1",__FILE__) ; } 
 # get the working dir

and then I work from my base development tree with a

  include("/home/sites/.php$DEVELDIR/includestuff.inc");# include our various 
files
  require("/home/sites/.php$DEVELDIR/ImageInformation.class.php");

and away I go.  I replicate my build directory anywhere under the .php
dir and everything else knows where it is and thus where to find the
other files in the same version.

This may be helpful; good luck!


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg88211/pgp0.pgp
Description: PGP signature


Re: [PHP] Howto: run local script to update remote script

2002-12-05 Thread David T-G
eriol --

Yes, a cron job would do the trick for a process that must run at fixed
and frequest intervals.  The Windows scheduler might accomplish the same
thing.

Since we've already veered sharply off-topic, I'll go ahead and recommend
that you check out dyndns.org or the like; set up your address (they'll
give you one like eriol.dyndns.org for free), download some software to
your box, and then it will always be available at that fully-qualified
name, without any PHP magic; your friends would just point a browser or
ftp client to eriol.dyndns.org and start sucking down MP3s.

If you do go with a php script (on either end), be careful how you then
implement it; anyone could hijack your pointer by connecting to the same
script with your "password".  Better to do something like encrypt your
current [external, of course] IP address (and maybe timestamp and maybe
who knows what else, with the more you can throw on the better) with a
secret password and send the garbage over the wire to your Linux server;
the script there also knows the password and decrypts the stuff and
checks to see that the sent IP matches the sending IP (and anything else
that you want to check) but you haven't actually exposed your password on
the wire.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg88457/pgp0.pgp
Description: PGP signature


Re: [PHP] Simple text editor for Windows?

2002-12-15 Thread David T-G
John --

...and then John W. Holmes said...
% 
% I know the text editor question has been beat to death, but I'm looking

Heh.


% for a simple editor with syntax highlighting that can be installed in
% Windows by a general user. It would have to be something that didn't
% access the registry, as normal users can't do that. Does anyone know of
% a program like this? Thanks.

gvim and vim, hands-down.


% 
% ---John Holmes...
% 
% PS: Yes, I already know what program you use and it's the best and I use
% it every day to... does it answer the question above?? ;)

Of course it does :-)


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg89684/pgp0.pgp
Description: PGP signature


Re: [PHP] approaching a relational database

2002-12-15 Thread David T-G
Doug --

...and then Doug Parker said...
% 
% I'm about to embark on a project where I have to enter many, many fields 
% into a MySQL database, and I don't know how to approach the database 
...
% 
% Any suggestions would be greatly appreciated...

Have you asked on the mysql list?  I'd think that that's a better place
to start...


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg89686/pgp0.pgp
Description: PGP signature


[PHP] to php or to perl, that is the question

2002-12-15 Thread David T-G
Hi, all --

I am starting a project that will have a web front end and mysql back end
and handle staff input (eg not general web surfers, though an Internet face
may come about one day)and updating for client records and scheduling.  I
am comfortable with both perl and php (and expect to be much more so with
at least one of them by the project's maturity :-)

In general, is there a checklist of when to use perl and when to use php
in a web site design?  Perhaps a comparison of the two languages, like I
think I've seen long ago for C, Pascal, assembler, perl, and python?

I read both lists (as I'm able, anyway; Hi perl guys!) and so you can
reply to either or both of the lists or just to me as you see fit.  I'll
be happy to post a summary of any answers or directions I get.


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg89697/pgp0.pgp
Description: PGP signature


Re: [PHP] PGP/PHP

2002-12-16 Thread David T-G
Jonathan --

...and then Jonathan said...
% 
% I have necessary PGP client software on my machine and have tested the
% functionality of PGP from my site, however, I want to know how to use
% PHP to send a PGP email.

1) Do you know how to use pgp to encrypt and decrypt a file?

2) Do you know how pgp is used by a mail user agent to encrypt a mail
message?


% 
% This is the scenario, 
% 
% I have a shopping cart which directs to SSL, then while in SSL, the
% customer will input their information, including credit card info. 

OK.

In general, you send a mail message to someone with the mail() function,
and many people choose to predefine their headers, recipient, and content.
To wit:

[From the manual:]
  mail
 (PHP 3, PHP 4 )
 mail -- send mail
  Description
 bool mail ( string to, string subject, string message [, string
 additional_headers [, string additional_parameters]])

and

  

All you have to do is encrypt your message body and then paste that into
this example as $body.  You could do it either by capturing $body or just
doing an inline replacement.  To wit:

  bash-2.05a$ echo "this is text" \
| gpg --encrypt --armor --recipient 7B9F4700 \
| gpg --armor --decrypt
  
  You need a passphrase to unlock the secret key for
  user: "David T-G <[EMAIL PROTECTED]>"
  2048-bit ELG-E key, ID 1AEFE05A, created 2001-12-16 (main key ID
  7B9F4700)
  
  gpg: encrypted with 2048-bit ELG-E key, ID 1AEFE05A, created 2001-12-16
"David T-G <[EMAIL PROTECTED]>"
  this is text

Of course, leaving off the decrypt side will spit out a lovely encrypted
text block -- but that takes up more lines to demo :-)


% 
% I want to show a receipt, (no cc #'s of course) and send the order to an
% administrator of the site using PGP after all the information has been
% gathered and send it from SSL. The site's admin will be able decrypt the
% information using the client software.

So the site's admin will get a encrypted mail message, right?  What's
this about no cc number -- you won't print one on the receipt, or you
won't give one to the admin, or the receipt without the number is what
the admin gets?


% 
% 
% Thanks in advance.

HTH & HAND


:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg89713/pgp0.pgp
Description: PGP signature


Re: [PHP] PHP Auto-Responder

2002-12-17 Thread David T-G
Kevin, et al --

...and then Kevin Stone said...
% 
% I need a solution to activate a PHP script when somebody sends an email to a
% specified account.  I've looked into procmail and sork and find that I am in

I won't go into procmail propaganda except to say that it isn't as hard
as it looks -- or as most people make it out to be.

I can't think of an MTA that doesn't have a forwarding method (.forward
or .qmail, with exim and postfix perhaps having something else but they
all work the same way).  Set up mail forwarding so that a copy goes to
your PHP script, or a wrapper script that does something with the message
and then calls your real script.  No need for cron jobs and polling.  [If
you want, you can also store a copy of the email by providing a second
target in the forward file).


HTH & HAND & Happy Holidays

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg89969/pgp0.pgp
Description: PGP signature


Re: [PHP] MySQL vs PostgreSQL

2002-12-23 Thread David T-G
Miro, et al --

...and then Miro Kralovic said...
% 
% Hi,

Hello!


% 
% I'm just deciding which DB to use for my projects and I'm not clear with one
% thing... When considering a database for web, is MySQL good enough? I read
% it only supports table locking, which is not very satisfying in such a
% multiuser environment as the internet..

You will probably find mysql, just like postgresql, quite sufficient for
your needs; it works for many people in many situations -- very much
including the web.


% 
% Based on your experience, what are pros and cons of MySQL and why most of
% you prefer to use MySQL to PostgreSQL, which is aparently more powerful..

Your best bet is probably to check out the mysql and postgresql docs
and see for yourself, as well as check the mailing list archives for
each for posts about the other or comparisons.  I do know that asking
this question on the mysql list will generally return lots of "it really
depends on what you're doing" responses, with a number of "here's my
[often truly staggering] example of how I'm using mysql; are you planning
anything [bigger than, faster than, different from] this today?" and the
occasional "MySQL R00LZ, d00d!!!" frothing :-)


% 
% Thanks for your opinions..
% Miro..


HTH & HAND & Happy Holidays

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg90530/pgp0.pgp
Description: PGP signature


Re: [PHP] Cheap Hosting

2002-12-27 Thread David T-G
Stephen --

...and then Stephen said...
% 
% Hello,

Hi!


% 
% I need a nice, reliable host for my new website. It needs to be fast, reliable, 
needs a good uptime, and some features. PHP and MySQL are the two I really need. Does 
anyone recomend one that's really cheap? So far I've found on, $5 a month, but it's 
slower then what'd I like. If nothing else pops up, I'll go with it. I'd also like 
domain parking and/or domain registration (don't really need the registration though). 
Thanks in advance!

This question has come up a number of times before.  Check the archives
for even more suggestions.

That said...  I offer php, mysql, ftp, multiple mail boxes, mailing
lists, yourdomain hosting/parking, and more; my server is at DataPipe
with good bandwidth and all of the goodies of a more expensive hosting
package (since that's what *I* have).


% 
% Thanks,
% Stephen Craton
% http://www.melchior.us
% 
% "What is a dreamer that cannot persevere?" -- http://www.melchior.us
% -- 
% PHP General Mailing List (http://www.php.net/)
% To unsubscribe, visit: http://www.php.net/unsub.php


HTH & HAND & Happy Holidays

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg90763/pgp0.pgp
Description: PGP signature


[PHP] holding a page open and then redisplaying

2002-12-28 Thread David T-G
Hi, folks --

I would like to start my db query (in response to a form input) and put
up a friendly "I'm working on it" page (or image or text block) and then,
when the query is done and I'm ready to display the results, clear that
page and show the real stuff.  I *think* I've seen this done before, but
even if I have I haven't the slightest idea of how.  It's probably more a
browser and HTML question but this seems a likely place to learn about
tricks like that or at least get some pointers :-)

TIA & HAND & Happy Holidays

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg90834/pgp0.pgp
Description: PGP signature


[PHP] loading a db table into a php array from mysql

2002-12-31 Thread David T-G
Hi, all --

I'm so far about knee-deep in my project where I'll be using php to talk
to the mysql database and spit out my web pages.  I wonder if I should be
making individual calls to the database or loading a table into an array
so that I can walk it without those calls.

For instance, I have an instructors table, a clients table, and a
schedule table that has an instructor number column, a client number
column, and a time slot column.

In order to print an instructor's schedule for the day, I have to query
the instructors table to get the id where the name matches, and then
query the schedule table to get the clients and times where the time slot
matches some time today, and then I have to repeatedly query the clients
table to get the names where the returned id matches.  Since the schedule
should be arranged in time order, I might even have client 1 and then
client 2 and then client 1 again -- but I've already switched to 2 so I
have to start over for 1.

It seems a bit silly to, say, load the entire clients table into an array
because there could be thousands or millions of clients, but it's an
awful pain to go and make all of those mysql_query calls to walk the
clients list.  Should I just build a huge query something like

  $query = "select fname,lname from clients where " ;
  foreach ($results_from_previous_query_somehow as $clinum)
{ $query .= "id = '$clinum' or "; }
  $query .= "id = ''" ; # nice always-failing value; easier than pruning

and then query that way, to get all of what I need in one shot but not
the whole table (unless I need it all)?  Does sql like big OR clauses
like that?

I don't know if this is a PHP or a MySQL question, so this once I've
posted it to both lists.  I'll also summarize to both.


TIA & HAND & Happy New Year

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91127/pgp0.pgp
Description: PGP signature


Re: [PHP] Re: loading a db table into a php array from mysql

2002-12-31 Thread David T-G
Tularis, et al --

...and then Tularis said...
% 
% Usually,
% using mysql to handle your tables is *way* faster than letting php 
% handle it.

Hmmm...  OK.  But that's so many queries...  "Or is it?", he asks,
reading farther.


% 
% That's what it was made for, speed...!

Well, yeah, I figured that :-)


% 
% In your case, you could just do a complex join I think. That would give 

Ahhh...  A new term.  Back to the books for me!


% all results in one table, and you could just order that on scheduletime, 

That certainly would be lovely :-)


%   and voila, you'd have a pretty nice outcome, namely the schedule you 
% were making via a complex way ;)

I've been known to do that sort of thing :-)


Thanks! & HAND & HNY

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91133/pgp0.pgp
Description: PGP signature


[PHP] SUMMARY - Re: [PHP] Re: loading a db table into a php array from mysql

2002-12-31 Thread David T-G
Tularis, et al --

...and then David T-G said...
% 
% ...and then Tularis said...
% % 
% % Usually,
% % using mysql to handle your tables is *way* faster than letting php 
% % handle it.
...
% % 
% % In your case, you could just do a complex join I think. That would give 
% 
% Ahhh...  A new term.  Back to the books for me!

A little RTFMing later, our hero returns...


% 
% % all results in one table, and you could just order that on scheduletime, 
% 
% That certainly would be lovely :-)

Look at that; I get out what I want in the order I'll want it in a single
query!

  mysql> select substring(s.timeslot,1,13),i.fname,concat(c.fname,'
  ',c.lname) from personnel as i, clients as c, schedule as s where i.id
  = s.instr and c.id = s.client and i.fname = 'penelope' order by timeslot;
  ++--+-+
  | substring(s.timeslot,1,13) | fname| concat(c.fname,' ',c.lname) |
  ++--+-+
  | 2002-12-27 06  | penelope | david t-g   |
  | 2002-12-27 07  | penelope | david t-g   |
  | 2002-12-27 08  | penelope | laura t-g   |
  | 2002-12-27 10  | penelope | david t-g   |
  ++--+-+
  4 rows in set (0.00 sec)

I'll probably have to refine this a bit as I also learn more about how to
use this, but I'm well on my way..


Thanks again & HAND & HNY

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91137/pgp0.pgp
Description: PGP signature


Re: [PHP] Re: loading a db table into a php array from mysql

2003-01-01 Thread David T-G
Rick, et al --

...and then Rick Widmer said...
% 
% At 02:57 PM 12/31/02 -0500, David T-G wrote:
% >...and then Tularis said...
% >%
% >% Usually,
% >% using mysql to handle your tables is *way* faster than letting php
% >% handle it.
% 
% Yes, do as much as you can in the database.  The people who wrote it spent 
% a lot of time trying to optimize it.

Yeah :-)


% 
% >% In your case, you could just do a complex join I think. That would give
% >
% >Ahhh...  A new term.  Back to the books for me!
% 
% Here is a query from one of my projects...
...

Wow.  Some piece of work.


% 
% Every field in the Schedule table is a key to another table that has to be 
% looked up and translated to something people will understand.  Note the two 

Exactly my situation (by design; I at least know that I wouldn't want to
store a name string in the schedule again and again and again :-)


% different ways of connecting tables with LEFT JOIN.  USING( fieldname ) 
% connects the  table being joined, with the table listed right before it, 
% using the same fieldname in both.  The ON syntax allows you to use 
% differently named fields, and/or a different table.

I still don't get what a left or right or outer or inner join is...  I've
read the mysql docs for the syntax and some examples, but this is a place
where I'll need to go to outside tutorials.  Do you know of any (on the
web) which will give me the background?


TIA & Thanks for the example & Happy New Year

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91180/pgp0.pgp
Description: PGP signature


[PHP] Re: threads (was "Re: [PHP] BreadCrumb Class")

2003-01-03 Thread David T-G
Jason, et al --

...and then Jason Wong said...
% 
% On Friday 03 January 2003 11:50, Michael J. Pawlowsky wrote:
% > I was wondering if anyone had a good BreadCrumb class.
...
% 
% You have started a new thread by taking an existing posting and replying to
% it while you changed the subject.

I try not to harp on this, though I vehemently agree that it just
shouldn't be done.  The probblem is that those who typically do this
(usually it's LookOut! users; this is the first time I've noticed Calypso
as the X-Mailer: and I'm sure there are some others) can't even see the
threading information and can't use it in their MUA, "threading" only by
a Subject: line, and will probably never learn.  Since I use mutt and
have the thread-breaking and thread-joining patch installed, I just break
the thread and move on.

Absolutely classic, though, was Jim MacCormaic's identical attempt at a
new thread in response to your message!


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91459/pgp0.pgp
Description: PGP signature


Re: [PHP] upgrading WAMP environment

2003-01-04 Thread David T-G
Anders --

...and then Anders Thoresson said...
% 
%  I've been using Apache, MySQL and PHP under Win2k for a while to learn 
% PHP. At the moment, I'm running PHP 4.2.2, MySQL 3.23.39 and Apache 2.0.40.

Good for you!  All you have left to do is upgrade to Linux ;-)


% 
%  During the holidays, I've read about a security hole in MySQL and 

I haven't seen this one...  If the list isn't interested, could you at
least send me a pointer?


% therefore plans to upgrade to 3.23.54a. At the same time, I want to install 
% PHP 4.3.0 and Apache 2.0.43.

Sounds like fun.


% 
%  But when I started to look for upgrading instructions for each software 
% package, I find nothing.

Yeah.  Generally just think of it as a fresh install instead of an
upgrade.

If I were you, I would

  - shut down mysqld and httpd

  - make a backup, of course

  - save your configs for each (did you install the utils originally?)

  - remove all three

  - install apache

  - install mysql

  - install php

  - install perl ;-)

I say that because the web server is the base and mysql may tie into it;
then you load mysql so php can see both it and the web server; then you
drop in php (and the same for perl and mod_perl :-)

You should be fine with the installation instructions for each.  When in
doubt, you might try the mailing lists for each, but I know that they are
all supposed to go in together.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91603/pgp0.pgp
Description: PGP signature


Re: [PHP] array help please

2003-01-05 Thread David T-G
John, et al --

...and then John Fishworld said...
% 
% can someone give me a bit of help / walthrough the following for me !

Let's see if I can help.


% this first bits is okay
% $mysql query1
% result
% array[cityid][cityname]
% 
% mysql query2
% result
% array[cityid][cityname]

Are CityIDs unique, like US-GA-ATL and CN-QC-MON or 214365 and 214387, or
is duplication possible?  If the IDs are unique then adding duplicates
won't cause duplicate entries.


% 
% now what i want to do is kick out any doubles in my array and resort them
% alphebetically by cityname ?!

Check out array_merge and array_multisort to put the two together and
sort on the second key, respectively.


% 
% 
% help !


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91646/pgp0.pgp
Description: PGP signature


[PHP] undefining an array element

2003-01-05 Thread David T-G
Hi, all --

If I have an array like

  $a1 = array ( 'a' => 'aaa' , 'b' => 'bbb' , 'c' => 'ccc' ) ;

and I want to completely remove 'b' from it (not just set $a1[b] to ""),
how do I undefine that element?


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91647/pgp0.pgp
Description: PGP signature


Re: [PHP] undefining an array element

2003-01-05 Thread David T-G
Tom, et al --

...and then Tom Rogers said...
% 
% Hi,

Hi!


% 
% Sunday, January 5, 2003, 9:46:05 PM, you wrote:
% 
...
% DTG> how do I undefine that element?
% 
% unset($a1['b']);

Ah!  And here I was looking for 'undefine' (and boy o boy are there a lot
of occurrences of *that* in the manual!).


% 
% -- 
% regards,
% Tom


Thanks a bunch! & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91651/pgp0.pgp
Description: PGP signature


Re: [PHP] Dreaded Return-Path and mail()

2003-01-06 Thread David T-G
Monty --

...and then Monty said...
% 
% Okay, I've read just about everything on the Internet about how the change
% the Return-Path header in an e-mail sent using mail(), but, I STILL can't
% get it to work. All e-mail sent via PHP says Return-Path: [EMAIL PROTECTED]
% and Received: (from nobody@localhost).

How interesting.

What do you get if you put

  $to = "[EMAIL PROTECTED]" ;
  $subj = "here is a subject" ;
  $body = "this is the message body" ;
  $hdrs = "From: [EMAIL PROTECTED]\r\nReturn-Path: [EMAIL PROTECTED]" ;

  mail($to,$subj,$body,$hdrs) ;

in a php script and execute it?  If it doesn't work, what do the mail
server lots on your web server say?  I just tested this code on my box
and it worked, so if you have problems then you can figure it's your mail
setup and not your code.  If it works, expand from there in small steps :-)


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg91859/pgp0.pgp
Description: PGP signature


Re: [PHP] Converting Excel Spreadsheet to MySQL table ...

2003-01-10 Thread David T-G
Adam, et al --

...and then Adam Ferguson said...
% 
% Hello ...

Hi!


% 
% I was wondering if anyone had a good resource or code sample for opening ( or 
accessing ) an excel spreadsheet using php.  I need to be able to convert a 
spreadsheet of products and info to a table of products in a mysql database.  Also ... 
I need to be able to perform this on a Linux machine.  Any help would be great.

I haven't used either, but xlHtml and xls2csv have been mentioned on
the mutt-users list a few times for when one receives those annoying
attachments.


% 
% Thanks guys!
% Adam Ferguson


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg92419/pgp0.pgp
Description: PGP signature


Re: [PHP] something annoying about includes/relative paths.

2003-01-10 Thread David T-G
Sean, et al --

...and then Sean Malloy said...
% 
...
% 
% Its a bad example. However, it demonstrates that the relative path for each
% include changed depending on what file was being included.
% 
% PHP doesn't do that. Which is kind of annoying, but you get used to it.. But

Not only does one get used to it, but one might have preferred it that
way in the first place :-)


% I've come up with a work around.
% 
% htdocs/index.php
% include('./system/core.php');
% 
% htdocs/system/core.php
% define('CORE_PATH', str_replace('core.php', '', __FILE__));
% include(CORE_PATH.'logic/engine.php');
% 
% htdocs/system/logic/engine.php
% include(CORE_PATH.'html/header.php');

I've come up with the following trick for files being tested in a
development environment.

In general, we have

  $ cat index.php
  

  $ cat other.php
  

where /devel might be missing (for production code) or /test (for a test
version) or anything else for some devel offshoot.  There are various
files included within index.inc, and we of course want to get the right
copies.

So in index.inc and other.inc and any other files, I have a short

  # this will let us figure out where we are and then always source the right include 
stuff!
  # it does not work with symlinks (__FILE__ reports the *target*)
  # you must have a full env tree in your devel tree; we now look exclusively in 
$DEVELDIR if set
  if ( ereg("/home/sites/\.php/",__FILE__) )# are we *somewhere* in our 
usual master tree?
{ $DEVELDIR = preg_replace("|/.*/home/sites/\.php(.*)/[^/]*$|","\\1",__FILE__) ; } 
 # get the working dir

followed by

  include("/home/sites/.php$DEVELDIR/includestuff.inc");# include our various 
files

where includestuff.inc looks like

  # config settings and functions and the like
  foreach ( array ( "config.php" , "functions.inc" ) as $incfile )
  {
foreach
( array # (this could be quite long)
  (
"/home/sites/.php$DEVELDIR",# host-wide dir
"$_SERVER[DOCUMENT_ROOT]",  # web-site-wide dir
getcwd()# this job
  )
  as $dir   # what do we call it?
)
{
  if ( file_exists ("$dir/$incfile") )  # is there a script file?
{ include ("$dir/$incfile") ; } # well, include it!
}
  }

and, as you can see, gets the master config.php and functions.inc from
the proper devel tree (as well as then from the doc root and the script
dir), and any other includes down in the script point the same way like

  include ("/home/sites/.php$DEVELDIR/index.table.inc");# magic auto-table code

or so.  It's hard-coded to our central directory (/home/sites/.php) but
you have to write these things down somewhere :-)


% 
...
% Hope someone finds that useful

Same here :-)


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg92420/pgp0.pgp
Description: PGP signature


Re: [PHP] stupid question (Back Function)

2003-01-13 Thread David T-G
Remon, et al --

...and then Remon Redika said...
% 
% hi everyone, 

Hi!


% 
% It's Possible We used Php Scripting to Back the client Browser

Well, yes and no.  There was just a new 'crumb' class released (see 

  http://www.phpclasses.org/browse.html/package/934.html

for more) which will let you track where you've been.  You can then put
up a 'back' link to your last page for the user, or otherwise direct it;
although the user's browser history will actually only be going forward,
you'll get the forward and back that you need.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg92769/pgp0.pgp
Description: PGP signature


Re: [PHP] Free web-hosting

2003-01-16 Thread David T-G
Gladky --

...and then Gladky Anton said...
% 
% Hello everybody!

Hi!


% Can anybody advice me the best free web-hosting with PHP?

No, there's still no new advice (I can understand posting a second time
because of a lack of response the first time -- and so I'll stop a third
post right now).  Check the mailing list archives for the last million
times this has come up.


% Thank you.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93181/pgp0.pgp
Description: PGP signature


Re: [PHP] Free PHP Hosts?

2003-01-18 Thread David T-G
JJ --

...and then JJ Harrison said...
% 
...
% Does anyone know of a free php webhost? (Banners, poop-ups etc are
% exceptable).

You should ask google first:

  Advanced SearchPreferencesLanguage ToolsSearch Tips
  free web hosting php___ Google Search
  ...
  Searched the web for free web hosting php.  Results 1 - 10 of about
  1,520,000. Search took 0.18 seconds.

Doesn't seem too difficult...


% --
% ---
% JJ Harrison
% [EMAIL PROTECTED]


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93490/pgp0.pgp
Description: PGP signature


Re: [PHP] Free PHP Hosts?

2003-01-19 Thread David T-G
JJ --

...and then JJ Harrison said...
% 
% I did do that, and have yet to turn up a useful result. That is why I asked.

Ah.  None of my business, I suppose, but how do you define a useful
result?  There were at least three that clearly indicated that they
provided free PHP hosting in the first page of results alone.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93532/pgp0.pgp
Description: PGP signature


[PHP] cli class

2003-01-19 Thread David T-G
Hi, all --

I forget, and can't find, who it was who suggested a mailing list for php
as a shell programming language and made the comment that it seems that
few use it as such.  S/He might find

  http://www.phpclasses.org/browse.html/package/954.html

of interest; it's a CLI class for php :-)


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93542/pgp0.pgp
Description: PGP signature


Re: [PHP] Re: Re: Freshmeat question

2003-01-21 Thread David T-G
Deco --

...and then De deco said...
% 
% I am not new to programming, just to scripting languages. I have seen that Perl has 
some high advanced sintaxes for string processing, for example, but I don't know if 
the same level can also be achieved in PHP...?

PHP is quite perl-ish, and supports some extended functions borrowed
straight from Perl.


% 
% As for the script below, could I run it inside a (my) browser? This could be in any 
browser?

A browser won't run a php script; in a web surfing context it's the
server that runs it, just like a mod_perl script.

Just like Perl, though, you can

  php /path/to/myscript.php

from the command line (if you built php to not only install a web server
module but also generate a standalone executable) and away you go.  You
might want to use -q to turn off the http header output.

So the short answer is "no", but don't let it throw you.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93725/pgp0.pgp
Description: PGP signature


[PHP] changing a key in an array

2003-01-21 Thread David T-G
Hi, all --

If I have an associative array

  Array
  (
  [t] => Array
  (
  [t1] => temp1
  [t2] => temp2
  )
  
  [f] => Array
  (
  [f1] => foo1
  [f2] => foo2
  )
  
  )

and I want to change the key 't' to, say, 'tmp', is there a way to change
it or do I have to use the brute force

  $a[tmp] = $a[t] ;
  unset $a[t] ;

approach?

I expect that, however it's done, it works the same way on just a 1-d
assoc array like

  Array
  (
[t1] => temp1
[t2] => temp2
  )

but in particular I have the 2-d array case that I need to play with
today.


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93740/pgp0.pgp
Description: PGP signature


[PHP] re-ordering keys in an array

2003-01-21 Thread David T-G
Hi, all --

If I have an associative array $a like

  Array
  (
[t] => temp1
[u] => ugh
[m] => moo
  )

is there any way to re-order the keys so that

  foreach (array_keys($a) as $k)
{ print "$k\n" ; }

will print

  t
  m
  u

for me?  At the moment it seems my only option is

  sort(array_keys($a))

and that's a start but finding another order spec would be lovely...


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93742/pgp0.pgp
Description: PGP signature


Re: [PHP] changing a key in an array

2003-01-21 Thread David T-G
Jason --

...and then Jason k Larson said...
% 
% My first question back would be why you create on array with keys you 
% know you want to change, or why in that case it became necessary to 
% dereference the original key.

A fair question :-)

I'm writing a picture gallery add-on which will allow users to create
"favorite pictures" baskets.  For each basket, the user throws in a bunch
of pictures in an array.  Then I make an array of baskets, where the name
of the basket is the key and the array that is the basket is the value.

When a user wants to rename a basket, the new version of that basket
appaers at the bottom of the list instead of in its original place --
wherever that was.


% 
% $a['tmp'] =& $a['t']; // exact same values by reference (no copy)

I don't think I can do this, since I eventually save the array of arrays
to a file for the user to reload on another visit.  Thanks, though.


% 
% Only other way I can think of at the moment is to create a copy and 
% unset the original as you described as brute force.

Ah.  Well, that's what they get, then :-)


% 
% HTH,
% Jason k Larson


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93747/pgp0.pgp
Description: PGP signature


Re: [PHP] re-ordering keys in an array

2003-01-21 Thread David T-G
Jason, et al --

...and then Jason k Larson said...
% 
% There are many pre-defined functions to manipulate the sort order of 
% arrays and it's keys.  However sometimes, to fit special needs, you just 
% have to do it manually.  Here's the useful PHP reference manual links to 
% better understand what's available.
% 
% http://www.php.net/manual/en/ref.array.php
% 
% http://www.php.net/manual/en/function.asort.php
% http://www.php.net/manual/en/function.arsort.php
% 
% http://www.php.net/manual/en/function.ksort.php
% http://www.php.net/manual/en/function.krsort.php
% 
% http://www.php.net/manual/en/function.usort.php
% http://www.php.net/manual/en/function.uksort.php

Thanks for the pointers.  All of those are great (I hadn't read up on
asort yet; quite nice, and I may offer a "sort these pictures by name"
option based on that or a nat sort) but don't help me with the problem of
reordering keys based on a position, and I don't think I want to try
writing the sort function that will take arbitrary input and spit it back
out with the purpose of moving a single key around :-)


% 
% 
% HTH,
% Jason k Larson


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93749/pgp0.pgp
Description: PGP signature


Re: [PHP] Page Rendering

2003-01-21 Thread David T-G
Bill --

...and then Bill Arbuckle, Jr. said...
% 
...
% This code is at the top of an include file which is included in pics.php.
% It seems that $PHP_SELF is interpreted differently in *some* instances
% between the two browsers.  I can't figure it out because PHP_SELF is a

Dunno much about your code (I haven't taken the time to really read it),
but you could be missing pics.php under NS if the server will hand that
up as a default index name (or if you have an index.php as a copy).  That
is,

  http://www.xyz.com/

might be a perfectly valid link to your script.  Meanwhile, you're right
that PHP_SELF (in either form) is a server-side variable and the browser
won't ever see it.

Worth checking out just to be sure...


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93760/pgp0.pgp
Description: PGP signature


Re: [PHP] Newbie Questions

2003-01-21 Thread David T-G
Bryan --

[BTW, I could not find your key on us.php.net or eu.php.net; is it on a
keyserver?]

...and then Bryan Cassidy said...
% 
% Could someone point me to a VERY good doc for learning PHP for a
% NEWBIE!!! Something I can understand from the beginning to the end. YES

Do you have any programming or scripting experience?  If you know even a
bit of something it's generally helpful when you want to pick up something
else.

I speak perl and shell well, do a lot of scripting, and can read some C
(plus other things that have faded into memory :-)  When I hadn't yet met
php at all, a buddy bought me the PHP Developer's Cookbook from SAMS and
it was easy to understand and presented some useful examples, and I was
able to get started and do the work he wanted me to do (when I tried
twice to thank him for the book he told me to shut up because "it's a
self-serving gift" :-)  It's no "Learning Perl", but then again it isn't
supposed to be.

Having worked my way through that, currently my only reference is the php
manual from the web site; a quick search will take me to any function
that I want to use, and only rarely am I stumped with a "how would I even
approach this task?" problem -- and then this mailing list is wonderfully
helpful.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93780/pgp0.pgp
Description: PGP signature


Re: [PHP] encrypt data with pgp

2003-01-21 Thread David T-G
ermelir --

[You know, this message really has nothing to do with converting ASP to
PHP...]

...and then ermelir said...
% 
% Hello everyody,

Hi!


% 
% I search to encode a string with a strong alogrythm. I choose pgp my 
% desktop is a windows computer; I have found a function but I can't use it 
% because on windows, pgp can"t encrypt on commandline.
% have you found something for windows station?
% your help will be helpfull.

I don't use pgp at all or windows much, but IIRC gnupg will work from the
command line with no problem.  You might try that instead.  Check out

  http://gnupg.org/

for info and downloads.


% 
% greetings


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93788/pgp0.pgp
Description: PGP signature


Re: [PHP] changing a key in an array

2003-01-22 Thread David T-G
Brent, et al --

...and then Brent Baisley said...
% 
% I had to do something like this not to long ago. Luckily it hit me that 
% I shouldn't be changing keys, you don't do it in a database, so  you 
% really shouldn't do it in an array.

Hmmm...  Good point.


% I ended up adding a "column" to my array that contained the name. Then I 
% didn't need to change keys and it worked just as well, and easier.

Can you show me how?  Currently I have

  Array
(
  [a1] => Array
(
  [k1] => value1
  [k2] => value2
)
  [a2] => Array
(
  [k1] => value1
  [k2] => value2
)
)

and now I'll want to add a 'name' thingie (I daren't call it a column :-)
so that I can change it at will ... but where and how do I add it?


Thanks & TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93996/pgp0.pgp
Description: PGP signature


Re: [PHP] changing a key in an array

2003-01-23 Thread David T-G
Brent, et al --

...and then Brent Baisley said...
% 
% I'm not sure how you are creating your array, but your resulting array 

Well, here's some code with some commentary to perhaps help:

  - first we define a name for a picture basket; the default is
'default' (we might later get a new name from the user or replace
an existing basket and save the collection)

  - we base64_encode the basket name (if it isn't already done) so that
we can safely store it and use it as a key in the basket list

  - so we're ready to populate $pixbasket, an array of values (path to
picture) and keys (base64_encoded version of the value, in fact, for
the same sorts of reasons); we're given a base64_encoded path as the
picture to put in the basket:

if ( $fn == "add" || $fn == "rm" )  # are we adding or removing a 
pic?
{
  ...
$p = base64_decode($basketpic); # get the pic path
  ...
  case add: $pixbasket[$basketpic] = $p; break ;# add to basket
  ...
}

  - when it's time to save the basket, we put the whole array (as a
value) onto the basket list array:

  if ( $fn == "manage" )# still?
  {
...
if ( $basketsave && ( $newname || $target ) )   # what to do and how to do it?
{
  if ( $newname ) { $basketname = base64_encode($newname) ; }   # use this if 
we have it ...
else { $basketname = $target ; }# ... or else use 'target' 
(already encoded)
  $basketlist[$basketname] = $pixbasket ;   # put it in the array
  ...
}

  - then we write the whole basket list array to a file and get it back
some other day


% would look something like this:
% 
% Array
% (
%   [name1]=>namevalue1
%   [a1]=>Array
%   (
%   [k1]=>value1
%   [k2]=>value2
%   )
%   [name2]=>namevalue2
%   [a2]=>Array
%   (...

Hmmm...


% 
% You end up with a two dimensional array (avoiding the columns term) that 
% contains a name value and a values array for each entry.

OK.  I was able to construct this directly, but I don't see how to use
it; if I ask for array_keys() for the outer array I'll get both types of
keys and that would be a mess.

I suppose I could have another array like

  $names = array ('name1', 'name2', 'name3') ;

where I maintain the order (renaming 'name2' is as simple as

  $names[1] = 'newname' ;

once I determine that I'm working with position 1) and then have my array
of baskets, now simply by ID instead of like a hash, so

  $baskets = array (array(...),array(...),...) ;

would work) and then wrap both of those into the single array for writing
(like

  $basketlist = array($names,$baskets) ;

or so), but that seems even more of a kludge :-)

Given the array you present above, how would you extract a basket by
name?  The closest I can come is to go and find the name and then
increment the ID by 1 and then get out that basket, which sounds like a
*huge* mess...


Thanks again & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94162/pgp0.pgp
Description: PGP signature


Re: [PHP] PHP Image Gallery

2003-01-23 Thread David T-G
John --

...and then 1LT John W. Holmes said...
% 
% I know there are a ton of these out there and I've used a few of them, but
% I'm looking for a specific feature, of course. :)

Of course!


% 
% Does anyone know of a Gallery system where I can, once it's installed, just

Yep.


% drop a folder full of images into the "gallery_root" and the program

We typically mkdir and put via ftp, but a browser interface isn't by any
means impossible.  You throw your pix on the server in any dir layout you
want and then browse to the page and, voila!, the 'nails are made and the
pages laid out and you can add comments and whatnot.

Care for a demo account to try it out? :-)


% automatically makes it into a new "gallery" on the web site. In other words,
% I don't want to go through and Browse... for each and every file.

Fair enough.


% 
% Any advice is greatly appreciated. Again, I already know what gallery
% program you use (I'm psychic ;) and I agree with you that it's the best
% program out there, but does it have the above feature?

It sure does :-)


% 
% ---John Holmes...


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94166/pgp0.pgp
Description: PGP signature


Re: [PHP] Re: textarea new line

2003-01-23 Thread David T-G
Adi, et al --

I somehow missed the original message.  Odd...


...and then Neil M said...
% 
% Adi wrote:
% >i want to add in textarea a string with new line tag in it. how to do that?
% >
% >my try:
% >$string="-line1n\ -line2 n\-line3";
% >echo "$string";

Did you type this from memory or paste it in?  You have n\ instead of the
backslash before the n.  I think that

  $string="-line1\n-line2\n-line3" ;

would give you the line breaks you want.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94174/pgp0.pgp
Description: PGP signature


Re: [PHP] looking for PHP, MYSQL & IMAGEMAGIK hosting

2003-01-23 Thread David T-G
Vahan, et al --

...and then Vahan Yerkanian said...
% 
% I know I'll start another flamewar, but I'm desperate for
% a quality hosting provider supporting php/mysql/imagemagik
% 
% anyone has good experience with any company?

I promise that I'm not just here to keep beating my own drum, but you've
described us to a tee (well, you left out perl :-)  What do you need?
Drop me a note off-list (since I doubt anyone else wants to hear much
about it) for more info..


% 
% regards,
% Vahan


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94177/pgp0.pgp
Description: PGP signature


Re: [PHP] changing a key in an array

2003-01-23 Thread David T-G
Brent --

...and then Brent Baisley said...
% 
% Unless the user has a lot of baskets, I would assume you would just list 
% all the baskets the user has as links on the web page or as a pop up 

One never knows, but I currently list as many as he has anyway.


% menu. The value passed by the links or pop up would be the element 
% number of the array item containing the desired basket.

OK...  Then, of course, I'd have to do name->number mapping so that I can
present the surfer with the name that he chose rather than just a number,
but that could be done, too.


% To extract a basket by name I would say you could use array_search, but 
% in looking into that function it appears to have changed through recent 
% versions of PHP. In PHP 4.1 it doesn't search multi-dimensional arrays, 
% I'm not sure about in 4.2.

Makes it trickier :-)


% 
% But it's easy enough to create your own function to search the array. 

Right.


% And you are right, the setup I recommended can get a bit kludgy. But if 
% you "denormalize" the array structure it can get easy again. Just make 
% the first element for each basket the name of basket.
% $baskets[] = array("basketname1","item1","item2");
% $baskets[] = array("basketname2","item1","item2","item3");
% $baskets[] = array("basketname3","item1","item2",...);

Hmmm...  I tried something like this and it got ugly.  I could try again,
except now it looks like I won't have to.


% 
% You can use sort() to sort the array.

Right.


% 
% Hope that helps and sorry about steering you down the difficult path 
% first.

It's quite informative, and I still need a lot of that, and the tough
path is no problem :-)  Thanks for all of the input!


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94209/pgp0.pgp
Description: PGP signature


Re: [PHP] changing a key in an array

2003-01-23 Thread David T-G
Jason, et al --

...and then Jason k Larson said...
% 
% If you are looking for something as simple as an index or key rename 

Yep.


% function it can be done and without making any copies of the array or 
% object etc by:

Cool!


% 
% $array['new_key_name'] =& $array['old_key_name'];
% unset($array['old_key_name'];

*blink*  Oh, cool.  I didn't know why I didn't think of that!  I'm quite
used to dereferencing in perl, and this is the same concept.


% 
% The first line creates a reference to the array.
% The second line removes the first reference without removing the second.

Of course.  Perfect!

Now to go and try it ;-)


% 
% See this for more info:
% http://www.php.net/manual/en/language.references.unset.php

Thanks; I sure will.


% 
% Regards,
% Jason k Larson


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94211/pgp0.pgp
Description: PGP signature


Re: [PHP] changing a key in an array

2003-01-23 Thread David T-G
Jason, et al --

...and then David T-G said...
% 
% ...and then Jason k Larson said...
% % 
% % If you are looking for something as simple as an index or key rename 

That was it, indeed, but

  $t = array("t1" => "temp1", "t2" => "temp2" ) ;
  $f = array("f1" => "foo1", "f2" => "foo2" ) ;
  $a['t'] = $t ;
  $a['f'] = $f ;
  $a['n'] =& $a['t'] ;
  unset($a['t']) ;
  print_r($a) ;

yields

  Array
  (
  [f] => Array
  (
  [f1] => foo1
  [f2] => foo2
  )
  
  [n] => Array
  (
  [t1] => temp1
  [t2] => temp2
  )
  
  )

instead of having 'n' before 'f' (in the old 't' spot) as desired.

So I'm back to the beginning and to funky array wrappers again...  I
think these surfers will just see their baskets in different order after
a rename :-)


Thanks to all & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94215/pgp0.pgp
Description: PGP signature


Re: [PHP] URLencode issues - halp!

2003-01-23 Thread David T-G
Mike --

...and then SpyProductions Support Team said...
% 
% I am having some issues, apparently, with URL encode.
...
% 
% I decided to use this because people are allowed to use *any* key as part of
% their name, so a name like "rt'$%^*&'rt" is perfectly allowable.

Makes sense, but I'd use base64_encode (with base64_decode, of course)
rather than urlencode; it will properly shield everything.  No, I don't
know why 'normal' names fail and goofy ones don't; without some code and
some specific examples we can't really tell too well :-)


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94223/pgp0.pgp
Description: PGP signature


Re: [PHP] changing a key in an array

2003-01-23 Thread David T-G
Chris --

...and then Chris Boget said...
% 
% > So I'm back to the beginning and to funky array wrappers again...  I
% > think these surfers will just see their baskets in different order after
% > a rename :-)
% 
% Of course, if you display the baskets in alpha order by name, it won't

True enough, and I've thought about that, too, but I'd like to keep it in
the original order if possible.  Now that I've pretty much decided that
that's not going to happen, I'll probably sort :-)


% be too much of a shock to them when they are displayed in a different
% order after rename. :p

Probably not :-)


% Just a through. 

Thanks; they all help.


% 
% Chris


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94224/pgp0.pgp
Description: PGP signature


Re: [PHP] SSH change password!

2003-01-27 Thread David T-G
Mantas --

...and then Mantas Kriauciunas said...
% 
...
% And what I need this script for, is, not everyone knows how to use ssh
% and I don't want to give access to 50 users that can run their
% processes, my server will freeze. That's why I need to change it somehow

Either your users plan to run major, major processes or your server is an
old 486 with 16M of slow RAM...  50 users isn't a problem.

If your users have real accounts, let them change their own passwords and
then deal with them using the server.  If they don't have real accounts,
then maintain your own password list or whatever authentication you wish
within apache.  If you're executing system programs on their behalf, set
up your web server to run subprocesses as the user rather than all as the
apache user -- and then one of those subprocesses could be 'passwd'.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94573/pgp0.pgp
Description: PGP signature


Re: [PHP] CRON?

2003-01-27 Thread David T-G
Nicole, et al --

BellSouth, eh?  I'm in Atlanta :-)

...and then Nicole said...
% 
% Thanks. But I would think if you can run cron jobs as certain users, you
% could create cron jobs for those users only. I mean, if you can do it with
% CPanel or these other Control Panels, then why not? It wouldn't have to run

The reason you could do it in a control panel is that the panel process
is running with special privs -- perhaps even in a separate httpd that is
running as root.  The way it's set up on my server is that httpd runs on
port 80 and admind runs on port 88, and admind is allowed to do certain
things as root *and* requires authentication before you can even get the
first page of data out of it.


% as root? I have a good bit to learn about linux. I am new to getting around
% in ssh.
% 
% I am learning from the command line now. It doesn't seem too bad yet. Not
% sure.

Give it all you've got and grow to love it.  It's the only way to go.
GUIs are for sissies. 

In all "seriousity", though, the command line is incredibly powerful.  I
highly recommend it.


% 
% Thanks!


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94576/pgp0.pgp
Description: PGP signature


Re: [PHP] Transition Page?

2003-01-27 Thread David T-G
Lee --

...and then Lee Herron said...
% 
% >> I'm interested in how most would create a transition page..
% >
% > One thing you might consider is using flush() to output
% > what you have so far to the browser rather than sending
% 
% The problem I'm having is that the uploading of the file takes time, and the

Ah; you're waiting for the browser to send rather than for the server to
send.

I'm no expert, but I don't think there's a way to do this directly.
Ideas that occur to me:

- It wouldn't work for everyone since some (such as I :-) have javascript
  turned off, but you could first change the page on the click and then
  actually submit the form and start the upload.

- You might send the just file name to upload back, get a new page
  containing the "please wait", and let that page request the file by
  name.  This doesn't sound great; if you can do that, what's to keep you
  from getting any file you want from a surfer's computer?  Maybe you
  can, but I'd be moderately surprised, which means I'd be moderately
  surprised if this approach works -- but it's worth evaluating.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94578/pgp0.pgp
Description: PGP signature


Re: [PHP] Need Guru's Help

2003-01-28 Thread David T-G
Tariq --

...and then Tariq Murtaza said...
% 
% Hi All Guru's here,

Hi!  [Hey, does that make me a guru now? ;-]


% 
% I need your help regarding converting HTML Table structure to DB schema 
% or XML format. I am not a Regular expression expert.

While I realize that this is a php list, I nonetheless recommend perl.  I
had a quick look around at search.cpan.org for "html table parse" and
found lots of results, the first two of which look like exactly what you
need.  If this is a one-shot conversion for your 500 files, I'd go that
route since it's already written.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94699/pgp0.pgp
Description: PGP signature


Re: [PHP] Multiple Emails

2003-01-29 Thread David T-G
John, et al --

...and then 1LT John W. Holmes said...
% 
% Is anyone else getting multiple emails from this list? I'm about to jump on
% people for asking the same question 3 or 4 times, but maybe it's just me
% getting copies of the same message.

Check the Message-ID: to see if it's really the same; occasionally it is.

Check the message length to see if it's the same as a previous one but
freshly injected; often it is.

Check the sender to see if it's the "same" message from two different
accounts; sometimes it is.


% 
% ---John Holmes...


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94867/pgp0.pgp
Description: PGP signature


Re: [PHP] How to uncompress PHP

2003-02-08 Thread David T-G
Lin --

...and then ?$BNS?(B ?$B7C72?(B said...
% 
% Hi, I am Lin.

Hello!


% 
% When I execute a command
% 
% gzip -d php-4_3_0_tar.gz
% 
% on the linux. The system show the following error.
% 
% gzip: php-4_3_0_tar.gz: not in gzip format
% 
% How can I uncompress this file.

Sounds like it isn't compressed, no matter what the extension says.  What
does

  file php-4_3_0_tar.gz

tell you?  And what if you just run tar on it, without any z flag?


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96281/pgp0.pgp
Description: PGP signature


[PHP] multiple file upload, yet again

2003-02-08 Thread David T-G
Hi, all --

I realize that this has probably been beaten to death, and I've watched
with some excitement the recent crop of discussions of multiple file
uploads, but only to be disappointed.

I've read in detail the archives and seen countless statements that one
cannot upload multiple files in one selection, requiring instead that you
have multiple input boxes and then a single submit button if you want.
I've also see, however, a few mentions of a script or a class that *do*
allow you to select multiple files in the browse window and make
reference to hotmail multiple attachment uploads.

Does anyone know how to do this?  I would like for my users to be able to
select their files in one swell foop, perhaps even "all in the directory",
rather than having to click repeatedly for each file to upload.

I even tried making myself a hotmail account so I could send myself mail
and try to upload multiple files and then look at the HTML source :-) but
the server had some problem or other and I couldn't get set up.  Well, I
didn't really want an account anyway.


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96291/pgp0.pgp
Description: PGP signature


Re: [PHP] multiple file upload, yet again

2003-02-09 Thread David T-G
Gurhan, et al --

...and then Gurhan Ozen said...
% 
% Hi David, 

Hi!


% I know that there is an php application doing multiple file uploading at
% once which is open source..

Cool!


% The application is san franscisco indymedia's news publishing system.
% You might wanna download it at: http://tech.sfimc.net/download.php and

Hmmm...  I haven't yet been able to download it, but I was pointed to a
live page (tech.indymedia.org/publish.php3) only to find that it has
multiple boxes for multiple files, which I can already do.  Nothing that
allows multiple files with shift-clicking or the like...

If only hotmail would let me sign up!  grr...  Then i could see if it
really does it and how...


% scrutinize the source code.. I am very sure their coders will help you
% in anyway as well.

Heh.  I haven't found any yet, though the #tech channel has been very
nice about being unhelpful.


% I hope this helps..
% Gurhan


Thanks anyway & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96348/pgp0.pgp
Description: PGP signature


Re: [PHP] little problem with ' " and stuff

2003-02-10 Thread David T-G
Michael --

...and then Michiel van Heusden said...
% 
% hi there,

Hi!


% 
% i'm having a small problem, wondering if anybody can help
...
%  echo '';

You've already seen the suggestions to . together your parts, so I
needn't suggest that.

I wonder why on earth you're bothering, though!  If you use ' then you
will, indeed, need to . the $variables into the string, but if you use "
then you can just include them with the rest of your output.  Your
incorrect

  echo '';

instead of having to become

  echo '';

is simply

  echo "";

and away you go...


I, too, have wondered why pretty much everyone on this list writes their
html as

  

rather than using perfectly valid single quotes and making their lives
easier...  In perl you can use *any* char as your quoting character and
so you even have it both ways!

HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96399/pgp0.pgp
Description: PGP signature


Re: [PHP] multiple file upload, yet again

2003-02-10 Thread David T-G
Jason --

...and then Jason Wong said...
% 
% On Monday 10 February 2003 08:36, David T-G wrote:
% 
% > Hmmm...  I haven't yet been able to download it, but I was pointed to a
% > live page (tech.indymedia.org/publish.php3) only to find that it has
% > multiple boxes for multiple files, which I can already do.  Nothing that
...
% 
% You probably already know this -- HTML does not allow for the type of multiple 

Ah.  No, actually I didn't know it, though I suspected it.

Thanks for the clarification.


% uploads that you seek. Any solutions out there will be based on 
% 'non-standard' technology -- javascript, java or some activex control.

Yeah.  So I suppose that must be how Javier did it, too.  Again, if I
could get on to hotmail I could see how they do it and copy it :-)


Thanks a *bunch* & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96401/pgp0.pgp
Description: PGP signature


Re: [PHP] restricting access to files using PHP

2003-02-12 Thread David T-G
Shams --

...and then Shams said...
% 
% Hi,

Hi!


% 
...
% however, how do I restrict people from accessing HTML files in that

You've seen the suggestions from others to change your .html files.  You
may or may not want to do that.

If you don't want to do that, then you need a .htaccess file.  You don't
necessarily, however, need a .htpasswd file as well; just make your php
script the authenticator:

  AuthName AccessYourDirectory
  AuthType Basic
  AuthExternal /path/to/your/script
  order allow,deny
  allow from all
  require valid-user

This is untested code, but you get the idea.  You may have to define your
external auth script with some name and then call it; our version of this
uses NickName instead of /path/to/your/script and in the httpd.conf file
we have

  AddExternalAuth NickName "/path/to/script"
  SetExternalAuthMethod NickName pipe

and I dunno if 1) adding and nicknaming is necessary or 2) you can do it
in a .htaccess file instead of having to put it in the http.conf file.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96652/pgp0.pgp
Description: PGP signature


Re: [PHP] Learning PHP

2003-02-12 Thread David T-G
Greg --

...and then Greg Luce said...
% 
% Could anyone recommend a fast track for learning php for an experienced
% ColdFusion developer? I'm working my way through the tutorials on
% php.net and free2code.net, but they seem pretty kindergarten. Any
% advice?

I had extensive perl experience as well as lots of other programming and
scripting experience when I started to look at PHP.  I got the PHP
Developer's Cookbook from SAMS by Sterling Hughes and worked through the
examples in there; by the time I had finished the book I had a working
knowledge of PHP and was coding away.

Have you checked the list archives?  I know that "what book?" has come up
at least a couple of times recently...


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96669/pgp0.pgp
Description: PGP signature


Re: [PHP] PGP and PHP together???

2003-02-12 Thread David T-G
Mike --

...and then MIKE YRABEDRA said...
% 
% Is it possible to use php and pgp together? Are there any good tutorials out
% there?

It's absolutely possible.  What do you want to do?  The only thing that
most people find a little tricky is that you have to think as the web
server and not as yourself, so the web server has to be able to find the
keys and such.

I don't know of any tutorials in particular but it's like calling any
other external program.  It might be fun to have some pgp/gpg functions
built into a class, but I'm not clever enough to write that [yet ;-]


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96734/pgp0.pgp
Description: PGP signature


Re: [PHP] PGP and PHP together???

2003-02-12 Thread David T-G
Jason, et al --

...and then Jason Sheets said...
% 
% There is a PHP extension named GPGext for PHP, it uses the gnupg made
% easy library to make gpg functions available to PHP without executing
% external programs.

Way cool!  I'm not suprised, but I hadn't heard of it before.  Can't wait
to see what functions it offers.


% 
% It is available at: http://www.sourceforge.net/projects/gpgext/

Thanks a *bunch* for the link.  I'll very eagerly surf over!


% 
% Jason


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96736/pgp0.pgp
Description: PGP signature


Re: [PHP] restricting access to files using PHP

2003-02-13 Thread David T-G
Shams --

...and then Shams said...
% 
...
% I'm interested in your solution David, what is the format of the external
% auth script that you use.. is there some kind of return you have to give
% .htaccess ?

Yep.  It's just a simple perl script; it's attached for reference.


% 
% Also, is there no way I can allow a user to login using a PHP login script,
% and then pass the "username" and "password" over to .htaccess to verify ?

Dunno about that one, but since you can tell .htaccess to run your php
script to verify you should get the same results...


% 
% Thanks for the help,

Sure thing!


% 
% Shams


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!


#!/usr/bin/perl 

$user = <>;
chomp($user);
$pass = <>;
chomp($pass);

exit(2) if($user =~ /^root$/);
exit(3) if($user =~ /[^a-zA-Z0-9_@.-]/);

open(CHKPW,"| /home/vpopmail/bin/vchkpw /bin/true 3<&0 >&2");
print CHKPW $user,"\0";
print CHKPW $pass,"\0";
print CHKPW time(),"\0";
if(not close(CHKPW)) {
exit(4);
}



msg96801/pgp0.pgp
Description: PGP signature


[PHP] uploading files and MAX_FILE_SIZE and php.ini

2003-02-13 Thread David T-G
Hi, all --

Yes, I'm back again with another upload question.  I promise I've been
paying attention in class, but I just can't get this to work!

The default upload_max_filesize in my php.ini was 2M, but I changed it to
200M and restarted the server, and now phpinfo() reports 200M.  I created
a dinky little upload form, which is attached, to either accept an upload
or tell me that it got one, and I can successfully upload files of 7M
(much bigger than the original 2M).  After initial failures, I added a
hidden form field MAX_FILE_SIZE as has been suggested (but sometimes
contested) in other posts.  I still cannot, however, upload anything
larger; a 9M file as well as some 30M and 40M tests just doesn't appear.

I have only 5-10M of my 256M available, but I have 90M of swap free and
over 1G free on /, the monolithic root partition.

Now I'm at a loss for where to turn to fix this.  It would seem that
everything is in place!  Is there an apache directive that I need as
well, perhaps?


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




  

  Send me some files!

  

  
" ;
  #print(exec("id"));   ###
  #phpinfo() ;  ###
  if ( $_FILES[uploads] )
  {
print "I HAVE _FILES!\n" ;  ###
print "\n";###
print_r($_FILES);
print "\n";   ###
  }
  else
  {
  print
"
OK, buddy.  Time to send me some files.


  
  
  


" ;
  }
  print
"
  


" ;

?>



msg96845/pgp0.pgp
Description: PGP signature


Re: [PHP] uploading files and MAX_FILE_SIZE and php.ini

2003-02-13 Thread David T-G
Jason, et al --

...and then Jason Wong said...
% 
% On Friday 14 February 2003 02:44, David T-G wrote:
% 
% > Yes, I'm back again with another upload question.  I promise I've been
% > paying attention in class, but I just can't get this to work!
% 
% [snip]
% 
% > Now I'm at a loss for where to turn to fix this.  It would seem that
% > everything is in place!  Is there an apache directive that I need as
% > well, perhaps?
% 
% manual > Handling file uploads > Common Pitfalls

Ahhh...  After reading it *twice* I realized that I'm using method='post'
and so I need to set post_max_size as well.  I've now confirmed that I
can upload multiple MAX_FILE_SIZE files up to post_max_size :-)

Yeah, I feel stupid, but I'm happy :-)


% 
% -- 
% Jason Wong -> Gremlins Associates -> www.gremlins.biz


Thanks again! & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96854/pgp0.pgp
Description: PGP signature


Re: [PHP] uploading files and MAX_FILE_SIZE and php.ini

2003-02-13 Thread David T-G
Mike, et al --

...and then Mike Kercher said...
% 
% You might also check out your timeout value in php.ini

I'll definitely need to tweak that for the real world, but this was
locally on a laptop.  It was fun to watch the two drive lights flash back
and forth as I watched my free space go down by 200M or so :-)


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96855/pgp0.pgp
Description: PGP signature


Re: [PHP] uploading files and MAX_FILE_SIZE and php.ini

2003-02-13 Thread David T-G
Hi again --

...and then David T-G said...
% 
...
% Ahhh...  After reading it *twice* I realized that I'm using method='post'
% and so I need to set post_max_size as well.  I've now confirmed that I
% can upload multiple MAX_FILE_SIZE files up to post_max_size :-)

Oh, yeah -- and now I need to see if I can override php.ini settings in
my script because the production server is set to 2M :-)


Thanks again & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96856/pgp0.pgp
Description: PGP signature


Re: [PHP] programming question

2003-02-14 Thread David T-G
Thomas --

...and then Thomas Moore said...
% 
...
% showMasterCategories($year, $model_id, $syear_model_id, $keyword, $make_id,
% $display_mode, $catid)
% {
%   $category_array2[$i] = getParent($category_id, $year_model_id, $i, $catid);
% }
% 
% 
% function getGrandParent($cat_id, $year_model_id, $x) {
...

Are you actually using getGrandParent, or where is your getParent code?
If the former, why are you passing $catid to getGrandParent if it's not
expecting it?

Let's make sure we're working with the right code before we try to debug ;-)


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96920/pgp0.pgp
Description: PGP signature


Re: [PHP] Use GnuPG with PHP?

2003-02-14 Thread David T-G
Mike --

...and then MIKE YRABEDRA said...
% 
% I want to be able to encrypt a block of text using a passphrase. Then when I
% get the email, I just need to unlock it using that passphrase (no keys...i
% think).

Then it has nothing to do with GnuPG.  Not only did you hijack this
thread, your subject isn't even meaningful!


% 
% Can anyone tell me how to do this in PHP code?

Let's first figure out what you actually want to do :-)  I would say that
the easiest way to encrypt and decrypt is certainly with gpg, though
others might not.  I took a quick surf through the manual and looked at
the mcrypt functions and they will let you enter a crypt phrase and
transform the data; maybe that's what you want.


% 
% TIA


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg96921/pgp0.pgp
Description: PGP signature


Re: [PHP] List problem

2003-02-16 Thread David T-G
Beauford --

...and then Beauford.2002 said...
% 
% Does anyone else get bounced messages saying they can't send email to
% [EMAIL PROTECTED] when sending email to the list? Every email I send to

Yep.  Looks like that person was subscribed to this list and died but the
list hasn't yet kicked out the address.

Just flush 'em when you get 'em.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97143/pgp0.pgp
Description: PGP signature


Re: [PHP] Re: recursion?????

2003-02-16 Thread David T-G
Fred, et al --

...and then Fred Merritt said...
% 
...
% The benefit of checking in javascript(which I suspect is enabled in most 

Not me!  Not me!  Not me!

It is by no means ubiquitous.  Anyone who even moderately considers
security will have it turned off.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97144/pgp0.pgp
Description: PGP signature


Re: [PHP] Re: recursion?????

2003-02-18 Thread David T-G
Kirk --

...and then Johnson, Kirk said...
% 
[quoting me]
% 
% > Not me!  Not me!  Not me!
% > 
% > It is by no means ubiquitous.  Anyone who even moderately considers
% > security will have it turned off.
% 
% The latest survey I've seen indicates that about 11% of browsers have JS
% disabled.

Hmmm...  Less than I thought; I was under the impresssion that it was up
nearer 20%.


% 
% About the same percent have cookies disabled.

Yeah.  Just as I do :-)


% 
% Kirk


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97395/pgp0.pgp
Description: PGP signature


Re: [PHP] test

2003-02-21 Thread David T-G
Guram --

...and then Guram Mosashvili said...
% 
% test

Do I have to?  I do not support the idea of testing or condone its
activity; I feel that it unfairly pigeonholes the developing spirit
and hinders natural unfoldment.

[Yes, your test worked, but please don't do this ;-]


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97831/pgp0.pgp
Description: PGP signature


Re: [PHP] mr. jason wong kind attention

2003-02-21 Thread David T-G
Diksha --

...and then DIKSHA  NEEL said...
% 
% respected mr.jason wong,
% 
% i hope you are no more annoyed with me!
% looking forward to hearing from you.

Let it go.  As you spend more time on the 'net and in mailing lists you
will learn more about "Netiquette", the Etiquette rules of the Internet,
and how a single instruction is not only often sufficient but not meant
to describe forever the relationship between two (or more) people.  You
did something wrong, and he corrected you.  Further traffic such as this
is not appropriate for the mailing list -- so don't worry about it :-)


% 
% regards,
% diksha neel


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97833/pgp0.pgp
Description: PGP signature


Re: [PHP] mr. jason wong kind attention

2003-02-21 Thread David T-G
Wilbert --

...and then W. Enserink said...
% 
% hey david,

Hiya!


% 
% should she apologize to you know?? for apologizing twice?:-)

*grin*  Tee hee.


% I'm sorry if offended anyone with this mail.

D'oh!  Sorry if *I* offended anyone with my reply!  Or with this reply!
Or with my apology!


% 
% 
% regards Wilbert
% 
% (counting down: 3 hrs to weekend)

Have a nice one, then!


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97885/pgp0.pgp
Description: PGP signature


Re: [PHP] Convert *.PST Files to Something Else (LDAP...)

2003-02-21 Thread David T-G
Michael --

...and then Michael A Smith said...
% 
% Hi,

Hi!


% 
% Is there any way using PHP (or any thing else, preferably PHP) to
% convert a MS Outlook *.PST file to another file that would be usable by

Converting from Outhouse comes up a lot on the mutt-users list.  To date
the only thing of which I know that will do it is Netscape, and therefore
presumably Mozilla; NS has an import function.  You might pull down the
Moz source code and start reading :-)


HTH & HAND & Good luck

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Array instead of Switch

2003-02-21 Thread David T-G
Chris, et al --

...and then Chris said...
% 
% Let's say I need to take one of 20 actions depending on a form selection. I 
% could use a switch statement with 20 cases, but I could also do something 
% like:
% 
% // Pretend this comes from a form
% $formchoice = "mars";
% 
% 
% $response = array(
%  "mars" => "go_mars()",
%  "mercury" => "go_mercury()",
%  "earth" => "go_earth()");
% 
% foreach ($response as $choice => $action)
% {
%  if (strtoupper($formchoice) == strtoupper($choice))
%   {
%   eval("$action;");
%   }
% }
%   
% But are there even better ways? 

I'm just pulling this out of my ear, but assuming the structure you gave
what about a simple

  eval("$response[$formchoice];") ;

to match if it matches and do nothing if it doesn't?  In fact, I got
curious, so here is some test code I just whipped up; note that when the
choice is 'comet' nothing happens.

  function go_mars()
{ print "Welcome to mars, dude!\n" ; }
  $formchoice = "comet" ;
  $response = array
(
  "mars" => "go_mars()" ,
  "mercury" => "go_mercury()" ,
  // continue ad nauseam
) ;
  print "Will we eval?\n" ;
  eval ("$response[$formchoice];") ;
  print "DONE!\n" ;

Seems like this ought to be pretty safe since you're writing the go_*
functions and otherwise nothing matches and you eval a "".


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] is_writable for a dir?

2003-02-22 Thread David T-G
Hi, all --

How can I tell if a directory is writable?  It seems that is_writable
only works on file, and the mode I get out of stat() is [in this case,
anyway] '16895' for a 0777 dir.


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] is_writable for a dir?

2003-02-22 Thread David T-G
Michael --

...and then Michael Sims said...
% 
% On Sat, 22 Feb 2003 07:23:20 -0500, you wrote:
% 
% >How can I tell if a directory is writable?  It seems that is_writable
% >only works on file, and the mode I get out of stat() is [in this case,
% >anyway] '16895' for a 0777 dir.
% 
% The 16895 is in decimal.  Use decoct() to convert it to octal and drop
% the leading digit (which seems to be 4 for directories):

Ahhh...  I get it!


% 
% $statInfo = stat('./testDir');
% $dirMode = substr(decoct($statInfo['mode']), 1);

Hey, lookit that...  My mode is now 40777, just as I would figure :-)
Thanks!

The real problem still remains, however; if it's not writable for all,
then I need to see whether or not its writable, and preferably without
checking the making of a temp file or digging into UID/GID and group
membership and so on...


Thanks & TIA for more & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] is_writable for a dir?

2003-02-22 Thread David T-G
Michael --

...and then Michael Sims said...
% 
% On Sat, 22 Feb 2003 11:49:09 -0500, you wrote:
% 
% >checking the making of a temp file or digging into UID/GID and group
% >membership and so on...
% 
% I wouldn't know of any other way to do it except for the two that you

Oh, well.  Thanks for the help otherwise!


% mentioned.  Maybe someone else has some better ideas...

I'm listening :-)


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] using function()[subscript] directly

2003-02-23 Thread David T-G
Hi!

I started out with

  $stat = stat("$gallery_dir/$pix_base") ;
  $mode = decoct($stat[mode]) ;
  print "mode = '$mode'\n" ;

and moved to

  $stat = stat("$gallery_dir/$pix_base") ;
  print "decoct(stat[mode]) is '" . decoct($stat[mode]) . "'\n";###

but I would like to get rid of $stat as well.  How can I feed the proper
subscript output of the stat call to decoct?  I've found that

  print "decoct(stat(file)[mode] is '" . decoct($stat("$gallery_dir/$pix_base")[mode]) 
. "'\n" ;###

gives me a parse error, while

  print "decoct(stat(file)[mode] is '" . 
decoct(${stat("$gallery_dir/$pix_base")}[mode]) . "'\n" ;  ###

just returns 0.  Do I *have* to use a temp array here?


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Constant Arrays Possible?

2003-02-23 Thread David T-G
Daniel --

...and then Daniel R. Hansen said...
% 
% Is it possible to define a constant that is an array of other predefined

Nope.  From the manual:

  Only scalar data (boolean, integer, float and string) can be contained
  in constants.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Help needed - move_uploaded_file

2003-02-24 Thread David T-G
Hi!

...and then Fat Lizard said...
% 
% Hi,
% I'm trying to use move_uploaded_file, but so far with no success, no matter
% what I try.

Do you have register_globals turned on?

Did you really use "" in your form code?

Are you sure that $userfile has a value?  What is it?

What if you turn things around a bit and run

  move_uploaded_file()
or die("Explanatory message $!\n") ;

to see if m_u_f() is complaining?


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Deleting a page after viewing it

2003-02-26 Thread David T-G
Chris, et al --

...and then Chris Hayes said...
% 
% At 18:32 26-2-03, you wrote:
% >I have a confirmation of "membership" page a user would arrive at after 
% >clicking on a URL in an email. After they click on a link in this page I 
% >want to delete the page itself so it will only exist for this one use. The 
...
% 
% I think this is usually done with a link like 'confirm.php?id=23sahd', and 
...

Agreed.


% 
% However back to your question. I would not delete a file that is currently 
% being executed. That could lead to all sorts of confusion by the server 

Although the server should hang on to the filehandle and you could even
unlink at the beginning of your code, I agree that it doesn't sound like
a good idea.


% and/or php. So you could pass the filename on to the second or you could 
% read the $_server['http_referer'] to see the filename as url. Then i think 

Oooh, yeah.  Just let me send your delete script /index.html as my
referrer and we'll have lots of fun :-)

If you're going to unlink, you should do it within the page in question.
Don't trust what comes to you from the outside unless *maybe* it's a
crypted one-time token passed not on the URL.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] PHP list problems?

2003-02-27 Thread David T-G
Sebastian --

...and then Sebastian said...
% 
% every so often i get a blank email that contains an attachment, a ATTxyz.dat
% and ATTxyz.txt why?

Don't know that for sure, but ...


% 
% I just got a reply from David T-G, Thread "Deleting a page after viewing it"
% and its blank with an attachment..

... in my case it's because your MUA does not know what to do with a
PGP-MIME signature (what it incorrectly calls that .dat file).  You can
open the .txt file and read the message.  I hope you've figured that out
by now or I guess you won't read this to see that, actually :-)


% 
% warm regards,
% Sebastian - [BBR] Gaming Clan
% http://www.broadbandreports.com


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] PHP Project for a newbie (me) or for hire?

2003-03-01 Thread David T-G
Dan --

Just a short followup to your note, though I hope to come back to it when
I get a breather.

Yes, anything is possible if you have the gumption :-)  You sound like
you've been around the web a bit and aren't scared, so feel free to dig
in and try it.  PHP is a fairly easy language to grasp, especially if you
speak any perl.

I enjoy the SAMS PHP Developer's Cookbook, though there are others out
there I'd love to have.  I'm one of those coders who would love to work
up a quote for the job if you're still in the market for hiring.

I like the idea; I once put in a bid on a sailboat cabin reservation
system for a fellow who ran a cruising sailboat with about 8 berths, and
this sounds quite similar.  I like little businesses like that who aren't
afraid of some technology :-)


HTH & HAND & at the very least Good Luck!

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Free email service Plus get Paid while using it!!!!

2003-03-03 Thread David T-G
Steve --

...and then steve adamian said...
% 
% I thought you would enjoy this new web site
...

Actually, I have no interest in it unless it so happens that it is
written in PHP and we can discuss the source code.


% 
...
% If you will decide to join please use my User ID rudeboy311
...

Well, you got that part right, anyway :-)  Please keep this stuff off the
PHP mailing lists.


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] mortgage calculator

2003-03-05 Thread David T-G
Karen --

...and then Karen E. Lubrecht said...
% 
...
% familiar with perl and would prefer avoiding it until my knowledge improves.

Actually, if you can read php, you can probably read perl; php is very
perl-ish.

If you *do* find it, I'd love to see a followup post :-)  Heck, I'd even
take the perl script location; I speak perl.  In fact, I'm sure I can
translate the perl script for a small fee; it shouldn't take long.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] PHP vs. CGI

2003-03-05 Thread David T-G
Mike --

...and then SpyProductions Support Team said...
% 
% Does PHP use less system resources than CGI on a server?

Now that we know that by 'CGI' you mean 'perl' we're at least getting
*somewhere*.  We don't really know what you mean, though, so I''ll see if
I can fill out the truth table for you.

In general, a mod_* version will be faster and lighter than a CGI version
(yes, you can have PHP as a CGI as well).  In general, php and perl are
about on the same footing; both can be heavyweights but certainly don't
have to be.

 perlphp
   +--+--+
   |approx|approx|
   | some amount  | some amount  |
  mod  | of resources | of resources |
   |   X  |   Y  |
   +--+--+
   |  something   |  something   |
   |more  |more  |
  CGI  |than  |than  |
   |  X   |  Y   |
   +--+--+

You'll probably find that X and Y are about the same.  Your choice of
column doesn't matter one way or another.  Which row you use is the
kicker.


% 
% I have a bulletin board which is incredibly active, but there is a PHP
% sister to it.

The real question becomes "how are you running the perl version and,
figuring that's as a CGI, would you rather switch languages or just
modules?".


% 
% Thanks,
% 
% -Mike


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] print "$array[$i][0]" pukes

2003-03-05 Thread David T-G
Hi, all --

I have a two-dimensional array built from reading a file and I'm having
trouble accessing a value of an inner array.  I know, particularly with
some help from print_r(), that the arrays are filled in properly.

I can do

  $m = count($manilist) ;
  for ( $i=0 ; $i<$m ; $i++ )
{ $ml = $manilist[$i] ; print "$i :: $ml[0]\n" ; }

and get the expected 0th values of each of the inner arrays, but when I
try

  $m = count($manilist) ;
  for ( $i=0 ; $i<$m ; $i++ )
{ print "$i :: $manilist[$i][0]\n" ; }

I simply get 'Array[0]' out for each inner..  Clearly php is seeing that
$manilist[$i] is an array, telling me so, and then happily printing the
"[0]"; how do I get to the value itself without having to use a temporary
array?


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] print "$array[$i][0]" pukes

2003-03-05 Thread David T-G
Chris --

...and then Chris Wesley said...
% 
% On Wed, 5 Mar 2003, David T-G wrote:
% 
% >   $m = count($manilist) ;
% >   for ( $i=0 ; $i<$m ; $i++ )
% > { print "$i :: $manilist[$i][0]\n" ; }
...
% 
% Actually, it's literally printing "[0]" after it prints "Array".  PHP is

Right.


% detecting that $manilist (not $manilist[0]) is an array (for which it
% prints "Array"), then you get a literal "[0]"  afterwards because you put
% it all within quotes.

A...


% 
% If you print this way, you'll get what you want:
% 
% print "$i :: " . $manilist[$i][0] . "\n";

OK.  That works, though it isn't pretty.  Is there any way I can avoid
doing the dot dance?  I'd rather something like

  print "$i :: ${manilist[$i]}[0]\n" ;

(which I know to not work! :-) than to have to open and close; that's
just not very clean to me.  I'm the sort who doesn't switch in and out of
php parsing, either :-)


% 
%   HTH,
%   ~Chris


Thanks & TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] print "$array[$i][0]" pukes

2003-03-06 Thread David T-G
Leif, et al --

...and then Leif K-Brooks said...
% 
% print "$i :: {$manilist[$i][0]}\n";

Aha!  Perfect.  Here I'd been trying such things with the leading $ on
the *outside* of the braces.

Thanks, all, for the help!


Back on the 'net after a great all-night storm (which in fact hasn't
stopped and is really doing the sheet-of-tin-booming thing),
:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] php list via email

2003-03-06 Thread David T-G
Daniel --

...and then electroteque said...
% 
% hi there , is there any way to possibly get the list via email ? i can only
...

Um, yeah.  Look at the bottom of every post, including the very one you
just made:

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

If accessing via the web doesn't float your boat (like it just plain
sinks mine), try the old-fashioned methods.  When you get down the list
to mailing

  [EMAIL PROTECTED]

you'll get a confirmation response.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] print "$array[$i][0]" pukes

2003-03-06 Thread David T-G
Ernest, et al --

...and then Ernest E Vogelsinger said...
% 
% At 10:44 06.03.2003, David T-G said:
% [snip]
% >...and then Leif K-Brooks said... 
% >% 
% >% print "$i :: {$manilist[$i][0]}\n";
% >Aha! Perfect. Here I'd been trying such things with the leading $ on 
% >the *outside* of the braces.
% [snip] 
% 
% Try to see it this way: $manilist[$i][0] is a PHP expression, thus needs to
% be put in curly braces _as_a_whole_ within a string.

Right.  What I hadn't seen before is that

  $manilist[$i]

is NOT evaluated like

  {$manilist}[$i]

but as

  {$manilist[$i]}

and so that's why I was putting the $ outside the {}.  Some things about
php aren't quite as perl-ish as others :-)


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] php list via email

2003-03-06 Thread David T-G
Dan --

...and then Dan Rossi said...
% 
% shit i'm a dope this is the email address [EMAIL PROTECTED], as i

No problem :-)


% access the group via newsgroup i never knew :|, but what i am saying is , as

No problem!  So you don't see the footer at the bottom of everyone else's
list posts when they get to your newsgroup?


% like mysql it is downloading all the messages to my inbox i cannot do this
% with the php list i can only post, and can only read them in the newsgroup
% viewer, and also what i'm saying is the firewall dude has blocked newsgroup
% port access so i cant access it and the fool wont open it up for me.

So ditch news and subscribe to the mailing list and get 'em all in your
mailbox.  I do :-)


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] what is session_name?

2003-03-13 Thread David T-G
Joe --

...and then Joseph Bannon said...
% 
% I read the description on php.net, but what is
% session_name really used for?

Uttam's answer is technically correct, but it may not really provide the
info you seek.  [That's not meant as a slight upon Uttam, of course; it's
a very good and thorough answer.]

It's a way to name your session, and in particular it's what people will
see when their browser says "this site would like to set a cookie" or
when they peruse their cookie collections.  It can be a way to better
identify yourself -- particularly for those cases where the visitor might
accept the cookie or might not.


% 
% Thanks,
% 
% Joe.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Re: PHP Books

2003-03-13 Thread David T-G
Hi, all --

...and then rotsky said...
% 
...
% 'PHP Developer's Cookbook' - Sterling Hughes with contributions by Andrei
% Zmievski (Sams). Still playing with this one. Definitely not for beginners
% as it assumes (IMHO) a fairly well-developed familiarity with PHP concepts
% and procedures and general wirehead argot. But I get the feeling that I'll
% be turning to this one more and more as it is a resource of solutions to
% specific problems.

I have this as well, and I like it but I find it too limited.  That is, I
get some good examples, and they cover a lot of ground, but it's not at
all a reference book.  I'm a perl guy as well, and I compare it to the
Perl Cookbook (which itself covers much more ground than the PHP Dev CB)
rather than a nice fat reference *and* instruction book like Programming
Perl.

I must be  a wirehead, since I hadn't touched PHP when I got the book and
I kept up if not outpaced it as I worked through it :-0


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] OT? Dynamic Page Setup in IE please help

2003-03-14 Thread David T-G
Anthony --

Your question is pure browser.  Good luck, especially considering the
browser you have to target :-)

You might be able to change the setting with some javascript.  You might
also be able to define the print format with a style sheet (doubtful).
In either case, you need to get into IE internals to see what it is that
you want to set.

I don't think you'll be able to do this for "only this page", though you
could perhaps put the settings back (hey, store 'em in a cookie; it can't
get much worse!) after the job has printed.


HTH & Good luck & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] multiple sessions

2003-07-06 Thread David T-G
Hi, all --

I am trying to integrate phpbb into our web site and do so such that we
set the login info before getting into the forum.  We have a user 'x' who
has a numeric user_id 'y' in the phpbb system that we'll need to set.  We
store that user_id in our system for other uses as well.

Our cookie is simply named PHPSESSID and we usually see the session data
by looking in $_SESSION.  The phpbb cookie is named phpbb2mysql_data and
has other good stuff in it.

When I am in the phpbb code I want to be able to look at the PHPSESSID
session data so that I can extract the user_id and pre-set it and then go
on to create the phpbb cookie and so on.  When I get there, though, I
find that $_SESSION is empty.

How do I look at the data stored in another cookie or session -- if I'm
even using the terminology correctly?


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] daemonized php

2003-07-07 Thread David T-G
Uros --

...and then Uros said...
% 
% Hello!

Hi!


% 
% Can somebody give me any workable example how to run some script written in
% PHP in Unix console.

Sure.

  php -q /path/to/script/name

(assuming you have the command-line version of php, which you may not,
and that your script doesn't need apache to feed it env vars).


% 
% I wan't to write some server aplication. So it has to be run in the
% backgroud.

Then tack '&' on the end of the line above.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] where are my errors?

2003-08-08 Thread David T-G
John, et al --

...and then David T-G said...
% 
...
% Does that show up in phpinfo() output?

Well, apparently so, and apparently it is.  I specifically called phpinfo()
from the require()d file to make sure I'd pick up the value at the time
rather than just what's in php.ini and it seems that's not what we've
tanked.


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


  1   2   3   4   5   >