Re: [PHP] 2d array?

2001-01-10 Thread Joe Stump

I'll give it a whirl ...

$array_of_page_titles = array(
'aboutus.php' = 'All about our company',
'index.php' = 'Welcome to www.server.com!',
'foo.php' = 'I\'m a worthless script!'
);

Then ...

TITLE? echo $array_of_page_titles[$file]; ?/TITLE

$file should be the name of the file - there is a PHP variable for this but
I'm drawing a blank right now.

--Joe

On Wed, Jan 10, 2001 at 08:40:21PM -0500, Kurth Bemis wrote:
 i'm confused by the method the go about this.
 
 i want to have a location: home / company / about on a page like 
 server.com/company/aboutus.php
 
 i'm thinking that i can use an array containing the page name and then 
 search the array and return the page title.  now - how do i do this with an 
 array?  I know that i've seen it done like aboutus.php:About Company or 
 something.  Its hard to explain - can anyone help me?
 
 ~kurth
 Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer
 
 People disagree with me.  I just ignore them.
  -- Linus Torvalds, regarding the use of C++ for the Linux kernel
 
 [EMAIL PROTECTED] | http://www.usaexpress.net/kurth
 PGP key available - http://www.usaexpress.net/kurth/pgp
 
 Fight Weak Encryption!  Donate your wasted CPU cycles to Distributed.net 
 (http://www.distributed.net)
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

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


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




Re: [PHP] Autonomous Mass Mail List System (Broadcast Email)

2001-01-10 Thread Joe Stump

Sure - I did this with qmail. In your .qmail file or any file that passes the
incoming mail to /dev/stdin you need to pipe it to a php script. It will look
like this:

?

  $fp = fopen('/dev/stdin','r');
  while(!feof($fp))
  {
$line = trim(fgets($fp,4096));
if(ereg("^From:",$line))
{
  // example of parsing out the From: header
}
  }

?

I had email addresses setup like ezmlm - 
ie [EMAIL PROTECTED] or on the other hand
[EMAIL PROTECTED] - then just parse out the
To: address and replace the = with a @ (dashes as well with something else) and
remove the email.

--Joe



On Wed, Jan 10, 2001 at 06:49:16PM -0700, Jason Beebe wrote:
 Hey Everyone,
 
 I'm working a project for one of the company's websites. they have a subscription 
mailing list that the user signs up their email address to receies periodical 
emailings.
 
 The email addresses are stored in a flat txt file. 1 email per line. I could also 
convert it to a coma delimited txt file if it would be easier.
 
 So, they've had problem with people who no longer want to receive emails, and one's 
that bounce for whatever reason, generally a bad email address.
 
 What I am trying to find out if who has some information to set up a system where we 
will send out our emails to the subscribers with our mailing list manager. when i 
customer respondes with a certain command in the body or subject (like unsubscribe) 
or if the mail bounces, I'd like it to search out the email address and delete it.
 
 Now, I know there's lists like majordomo that do something similar. But I'm looking 
for something a little more straightforward.
 
 I also know this may be more along the lines of shell scripting, but I thought some 
of you ingenious people may have already done something similar or have some ideas on 
where to start. thanks.

-- 

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


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




Re: [PHP] FORM problem

2001-01-10 Thread Joe Stump

Have you tried looking at addslashes() ??? Or am I not understanding the problem
here. Just remember to deliminate the "'s and ''s before entering them into the
db.


--Joe

On Wed, Jan 10, 2001 at 08:19:24PM -0500, Romulo Roberto Pereira wrote:
 Hello!
 
 I am having a problem when people copy and paste text inside a TEXTAREA in a form 
that contains double quotes ' " ' . 
 
 The first file is a simple form. The second one is a php script that treats the data 
from the user and stores in a MySQL table. Onyone has any ideas? I need to use 
javascript to treat the variables before I execute submit?
 
 Thank you,
 
 Rom

-- 

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


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




Re: [PHP] load balancing with php/apache?

2001-01-13 Thread Joe Stump

 Any of the above.  It's up to you.  Most people probably store the session info in a 
database.  But you could also do it in a shared drive. But I got a little static a 
while ago when I suggested storing shared session data on an NFS mounted drive. NFSes 
are too slow I guess.

Whoever said NFS is slow hasn't used a NetApp

--Joe


 
 Michael
 
 
 On Saturday, January 13, 2001, at 03:43 PM, Cal Evans wrote:
 
  When you say "handled by us" do you mean you: 
   
  1) Write the sess_* files to a shared drive 
  2) Store them in the database 
  3) ignore them totally, who needs users anyhow? 
  4) some other option? 
   
  Cal 
  http://www.calevans.com 
   
   
  -Original Message- 
  From: jeremy brand [mailto:[EMAIL PROTECTED]] 
  Sent: Saturday, January 13, 2001 2:20 PM 
  To: Cal Evans 
  Cc: [EMAIL PROTECTED] 
  Subject: RE: [PHP] load balancing with php/apache? 
   
   
  We have a centralized DB server.  Sessions are handled by us, the 
  programmers, not the cluster. 
   
  Jeremy 
   
  Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] 
  http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more 
  Get your own Free, Private email at http://www.smackdown.com/ 
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 "body"   -- Quoted from Yahoo! homepage, http://www.yahoo.com 
   
  On Sat, 13 Jan 2001, Cal Evans wrote: 
   
   Date: Sat, 13 Jan 2001 11:51:01 -0600 
   From: Cal Evans [EMAIL PROTECTED] 
   To: [EMAIL PROTECTED] 
   Subject: RE: [PHP] load balancing with php/apache? 
   
   How does it deal with sessions? Or do use store sessions in the database? 
   
   Cal 
   
   -Original Message- 
   From: Joe Stump [mailto:[EMAIL PROTECTED]] 
   Sent: Saturday, January 13, 2001 11:22 AM 
   To: Rasmus Lerdorf 
   Cc: [EMAIL PROTECTED] 
   Subject: Re: [PHP] load balancing with php/apache? 
   
   
http://www.linuxvirtualserver.org/ 
   
   We use LVS on our website - it works great! We have 2 load balancers with 
   the 
   HA package and 6 PHP webservers running behind it (with a central DB 
   server). 
   
   In short, it's possible and works quite well. BTW We user FreeBSD for 
   webservers 
   if that's any help (though linux, NT, solaris, etc would all work) 
   
   --Joe 
   
   
   
   
http://linas.org/linux/load.html 

-Rasmus 


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

-- 

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


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




Re: [PHP] PHP vs JSP

2001-01-14 Thread Joe Stump

This has been covered extensively in the archives - just an FYI.

--Joe

On Sun, Jan 14, 2001 at 10:10:56PM -0600, Cal Evans wrote:
 Actually, I understand what he's trying to say, even if I don't agree with
 him. The main problem people have had with load balancing is sessions.  If a
 particular scripting language *cough*ASP stores session information in
 memory then the load balancing system has to always send the session from a
 given user to the same server. (during that session)
 
 IMHO, the easiest way to do this (without writing your own session handling
 scheme and then telling people about it but not divulging details!)  ;) is
 to store the session info in a database.  Using a central database for all
 sessions, any server can get to the session info for any user.
 
 I've just finished leading a team on a large scale JSP application.  While
 it is slower to develop in (Java has a high learning curve, IMHO) The
 servlet engine we are using, JRun is fairly fast.  Our bottle neck right now
 seems to be a poorly tuned Oracle database.
 
 My $0.02,
 Cal
 http://www.calevans.com
 
 
 -Original Message-
 From: Alex Black [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, January 14, 2001 7:02 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP vs JSP
 
 
 http://www.zdnet.com/enterprise/stories/linux/0,12249,2646052,00.html
 
 gah:
 
 "Also, any organization doing clustering or failover with PHP is in largely
 uncharted waters. "
 
 what _bull_!
 
 what does loadbalancing and clustering have to do with any scripting
 language? this guy is obviously one of those dilettantes that things CFML is
 the holy grail :P
 
 anyway, that article is wrong, _except_ the part about JSP:
 -slow
 -extremely time consuming
 -friggin annoying :)
 
 I've worked on a couple of projects with JSP, and decided to use PHP to
 build binarycloud. 'nuff said :)
 
 _alex
 
 
 
 --
 Alex Black, Head Monkey
 [EMAIL PROTECTED]
 
 The Turing Studio, Inc.
 http://www.turingstudio.com
 
 vox+510.666.0074
 fax+510.666.0093
 
 Saul Zaentz Film Center
 2600 Tenth St Suite 433
 Berkeley, CA 94710-2522
 
 
 
 
  From: [EMAIL PROTECTED] (Donald Goodwill)
  Newsgroups: php.general
  Date: 14 Jan 2001 15:13:12 -0800
  Subject: Re: [PHP] PHP vs JSP
 
  There is an interesting ZD Net comparison of several
  scripting languages at
  http://www.zdnet.com/enterprise/stories/linux/0,12249,2646052,00.html
  Some time ago I did the comparison of JSP to PHP and
  JSP turned out to be much, much slower.
 
  Now I'm just learning CodeCharge generator and so far
  it seems really helpful. I even started redoing one
  project from scratch using it. Maybe surprise your
  client and create both PHP and JSP versions...
 
 
  - Original Message -
  From: [EMAIL PROTECTED]
  To: PHP list [EMAIL PROTECTED]
  Sent: Sunday, January 14, 2001 7:35 PM
  Subject: [PHP] PHP vs JSP
 
 
  Hi all
 
  I'm busy working on a contract .. and we need to do
  some web based
  stuff
  .. but the client is intent on using jsp and not PHP.
  Is there somewhere where I can get good comparists
  between the two
  pro and
  cons etc etc ..
 
  I would much rather use PHP  then JSP for the
  development
 
  Thanks
  Henti Smith
 
 
 
  __
  Do You Yahoo!?
  Get email at your own domain with Yahoo! Mail.
  http://personal.mail.yahoo.com/
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

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


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




Re: [PHP] Unknown number of fields

2001-01-15 Thread Joe Stump

http://www.php.net/manual/en/function.mysql-fetch-field.php

--Joe

On Mon, Jan 15, 2001 at 05:27:03PM +0200, Shimon Dekel wrote:
 Hi,
 I need to be able to reactive an unknown number of fields from a Data
 Base generated form.
 How do I handle an unknown number of fields?
 II can generate a list of all possible fields and try them all but will
 this generate errors?
 I will appreciate any help or information.
 Thanks 
 Shimon Dekel
 
 ==
 Shimon Dekel  Israeli Vegetable Board
 Information System Manager
 2 Karlibach St Tel-Aviv 67132
 [EMAIL PROTECTED]   www.yerek.co.il
 ==
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

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


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




Re: [PHP] Date data type problem

2001-01-15 Thread Joe Stump

This is not possibly - do this on $date2 first:

$foo_date2 = str_replace('-',$foo_date2);

then 

if($date1  $foo_date2)
{

}
else
{

}

--Joe

On Mon, Jan 15, 2001 at 03:15:38PM -0600, Jacky@lilst wrote:
 Hi people,
 I have tried to compare 2 date values to see if one come before another using the 
sniplet below:
 
 if ($date1  $date2) {
 do something
 }else{
 ...
 }
 
 while $date1 is in "mmdd" format but $date2 is in "-mm-dd" formate because I 
get value of $date2 from a "date" data type field from a table. 
 Can I use this "-mm-dd" to compare with value from another date variabile in the 
"mmdd" format?  If not possible, How do I make both of them to be in the same 
format?
 cheers
 Jack
 [EMAIL PROTECTED]
 "There is nothing more rewarding than reaching the goal you set for yourself"

-- 

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


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




Re: [PHP] load balancing with php/apache?

2001-01-15 Thread Joe Stump

I would agree - we started using one at work (the 760 I believe) with 128GB of
online RAID 4 storage - YUM! We run a large SUN DB and run our DB straight from
the NetApp. NetApp basically rules.

--Joe


On Mon, Jan 15, 2001 at 10:08:32AM -, Tim Parkin wrote:
 A NetApp (Network Appliance) is a big RAID that uses multiple scsi drives to
 create a single transparent volume which, with CIFS (transparent filesystem)
 can be used by any OS. They are v fast, use NVRAM buffering and can go up to
 post terabyte storage capacity without worries. 
 
 Oh and they start at 60k pounds sterling
 
 But they are great. Network Attatched Storage at its best (gigabit fibre
 too)
 
 Tim Parkin
 Didio Communications
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 15, 2001 08:39
 To: Alex Black; [EMAIL PROTECTED]
 Subject: Re: [PHP] load balancing with php/apache?
 
 
 Addressed to: Alex Black [EMAIL PROTECTED]
   [EMAIL PROTECTED]
 
 ** Reply to note from Alex Black [EMAIL PROTECTED] Sun, 14 Jan 2001
 17:16:50 -0800

   Whoever said NFS is slow hasn't used a NetApp

 
 OK, I'll bite.  What is NetApp?   Network Appliance?
 
 
 Is this a cache technology, or will it help if I want to transfer 1GB
 of data with no duplication?  Once upon a time I was considering using
 NFS for backing up my web servers.  Then I found it would take over 150
 hours per backup over my 56K Frame Relay link.  I've got it down to
 about 46 hours with tar.gz and ftp.  It takes most of my sleep time
 during the week.
 
 
 
 
 
 
 Rick Widmer
 Internet Marketing Specialists
 http://www.developersdesk.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

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


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




Re: [PHP] variable question

2001-01-19 Thread Joe Stump

Put them in an array? PHP allows for variable variables, but I'm not sure they
work with classes.

This works:

 $foo0 = 'a';
 $foo1 = 'b';
 $foo2 = 'c';
 $foo3 = 'd';
 $foo4 = 'e';

 for($i = 0 ; $i  5 ; ++$i)
 {
   $var = 'foo'.$i;
   echo $$var;
 }

Try it with an object...

--Joe


On Fri, Jan 19, 2001 at 05:15:25PM -0500, Michael Zornek wrote:
 ok so i have an object that has (among other things) the following properties:
 
 $vendor_data-s9
 $vendor_data-s10
 $vendor_data-s11
 $vendor_data-s12
 ...
 $vendor_data-s40
 
 The values are 1 or 0
 
 I'd like to write a loop to say:
 
 for ($count=9; $count40; $count++) {
   if ($vendor_data-s(insert_number_here) == 1) {
   echo something;
   }
 }
 
 any thoughts?
 
 Mike
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

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


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




Re: [PHP] help!!! (PHP)

2001-01-23 Thread Joe Stump

Use cron for this - put the following in your crontab ("crontab -e") to run a
script everyday at midnite:

0 0 * * * lynx -source http://www.server.com/script_to_run_every_night.php


man crontab will tell you how to run on different days, etc.

--Joe

On Tue, Jan 23, 2001 at 09:53:13AM -0300, Bruno Freire wrote:
 Hi ... 
 I'm having some problem's here
 I'm need to know  if my apache server is able to run scripts in a specific
 date and hour.
 
 For example: 
 
 Every month, in the 15th day, I need to run a script PHP that check my Mysql
 database for some cause.
 Is that possible???
 
 I'm realy thanks!!!
 
 
 Bruno  de F. F
 
 City: Belo Horizonte
 Estate: Minas Gerais
 Country: Brazil
-- 

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


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




Re: [PHP] -

2001-01-24 Thread Joe Stump

$Something is an instance of a class - so like this:

  class Foo
  {
var $test 

function echo_test()
{
  echo $this-test;
}
  }


  $foo = new Foo;
  $foo-test = 'this';
  $foo-echo_test();

--Joe

On Wed, Jan 24, 2001 at 12:05:17PM -0700, Karl J. Stubsjoen wrote:
 What does - do?
 As in:
 $Something-then_something_over_here
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

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


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




Re: [PHP] PHP - Interrupted Scripts,

2001-01-24 Thread Joe Stump

set_time_limit(0) sets the limit to 0 or inifinate. But it will end like any
other script (ie end of script or exit;)


--Joe

On Wed, Jan 24, 2001 at 09:41:44PM +0100, Timo Mika Gl??er wrote:
 and what does set_time_limit(0) do??? set it to infinity???
 
 i have some fucntion call in there which sets the time-limit each time a
 loop is called ... the documentation says that this does prolong the
 excution time... is that correct???
 
   - timO
 
 
 
 -Ursprngliche Nachricht-
 Von: Joe Stump [mailto:[EMAIL PROTECTED]]
 Gesendet: Mittwoch, 24. Januar 2001 21:43
 An: Timo Mika Gl??er
 Betreff: Re: [PHP] PHP - Interrupted Scripts,
 
 
 By default PHP cuts off execution at 30 seconds.
 
 --Joe
 
 On Wed, Jan 24, 2001 at 09:36:17PM +0100, Timo Mika Gl??er wrote:
  why setting time-limit to 0???
 
 
  - timo
 
  -Ursprngliche Nachricht-
  Von: Joe Stump [mailto:[EMAIL PROTECTED]]
  Gesendet: Mittwoch, 24. Januar 2001 21:37
  An: Timo Mika Gl??er
  Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Betreff: Re: [PHP] PHP - Interrupted Scripts,
 
 
  try set_time_limit(0) for starters. Otherwise I'm clueless.
 
  --Joe
 
  On Wed, Jan 24, 2001 at 09:31:17PM +0100, Timo Mika Gl??er wrote:
   Hi,
   I had this problem over and over again: A script takes a long time to
   execute and is interrupted in the middle of its action by either a
  IE-Crash
   or and Proxy-Error. Can one prevent or circumvent that problem???
  
   Thanks for your fast response in advance,
  
   Timo Mika Gler
  
   ___
  
   Timo Mika Gler (mailto:[EMAIL PROTECTED])
  
  
   GewinnIDEE AG
   Mexikoring 29
   D-22297 Hamburg
  
   Tel. ++49 (040) 631282-22
   Fax. ++49 (040) 631282-10
  
  
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
  --
 
  Joe Stump, PHP Hacker
  [EMAIL PROTECTED]
  http://www.miester.org/
 
 
 
 --
 
 Joe Stump, PHP Hacker
 [EMAIL PROTECTED]
 http://www.miester.org/
 
 
 

-- 

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


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




Re: [PHP] PHP - Interrupted Scripts,

2001-01-24 Thread Joe Stump

try set_time_limit(0) for starters. Otherwise I'm clueless.

--Joe

On Wed, Jan 24, 2001 at 09:31:17PM +0100, Timo Mika Gl??er wrote:
 Hi,
 I had this problem over and over again: A script takes a long time to
 execute and is interrupted in the middle of its action by either a IE-Crash
 or and Proxy-Error. Can one prevent or circumvent that problem???
 
 Thanks for your fast response in advance,
 
 Timo Mika Gler
 
 ___
 
 Timo Mika Gler (mailto:[EMAIL PROTECTED])
 
 
 GewinnIDEE AG
 Mexikoring 29
 D-22297 Hamburg
 
 Tel. ++49 (040) 631282-22
 Fax. ++49 (040) 631282-10
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

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


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




Re: [PHP] strange PHP/MySQL problem

2001-01-27 Thread Joe Stump

Are you adding slashes beforehand (or running magic quotes) ? Also I always do
a stripslashes() on the text fields I print out.

--Joe

On Sat, Jan 27, 2001 at 11:06:03PM -0500, [EMAIL PROTECTED] wrote:
 if you goto
 http://downloads.moddingcentral.com/add.php
 you will see a simple form
 
 this form takes the info and a PHP script processes it and places it into a 
 mysql table. now the problem
 
 if i put Cynical Saint's Video Tutorial in the name it will display 
 Cynical Saint\ in the dbase (also seen @ downloads.moddingcentral.com)
 
 but if you place it in the description it is fine..
 
 here is my sql query
 
 $rst = mysql_query("INSERT INTO tablename(id, game, section, name, size, 
 description, dllink, creator, creatoremail, date, website, score, downloads) 
 VALUES ('$id', '$game', '$section', '$modname', '$size', '$description', 
 '$dllink', '$creator', '$creatoremail', now(), '$website', '0', '0') ") or 
 die(mysql_error());
 
 Whats wrong with this?
 its driving me nuts!
 
 - Thanks
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

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


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




Re: [PHP] string length?

2001-01-30 Thread Joe Stump

if you just want to know how many numbers are in it you can do this:

$num_of_numbers = sizeof(explode(';',$string));

--Joe

On Tue, Jan 30, 2001 at 04:46:50PM -0800, Jon Jacob wrote:
 Kevin Connolly wrote:
  
  Hi,
  I am quite new to PHP scripts and I have run into a little problem with my string!
  I have a string called $numbers which is 5;6;12;21;36;42 (for example, it can be 
any 6 numbers between 1 and 42).
  Is there an easy way that I can find out how many numbers there are in the string 
without the five semi-colons??
  I was playing around with count_chars but had no success!
  then i tried converting it to an array and counting the number of elements in the 
array but unfortunatley it put the whole string in as the first element of the array 
and returned a size of 1!
  I would appreciate any help you can give me,
  Cheers,
  Kevin.
 
 Use split.
 
 (@ArrayName) = split (":", $numbers);
 $ElementsNum = count(@ArrayName);
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




[PHP] feature that should be there and isn't

2001-01-30 Thread Joe Stump

in php to have a "optional" parameter in a function you can do:

  function foo($var='')
  {


  }

To have it be default to 'bar' you can do:

  function foo($var='bar')
  {


  }

BUT you can't do this:

  function foo($var=date("Y-m-d"))
  {


  }

Why? This would be a kick ass little trick!

--Joe



-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Pricing for PHP programming???

2001-02-01 Thread Joe Stump

You are taking this WAY to seriously. What you are talking about is the Sherman
Act that developed our current antitrust laws. Specifically you are talking
about "price fixing", which is illegal in the US. If EVERY PHP coder in the US
got together at a trade show and said "We will all demand $150.00 an hour no
matter what" then THAT would be illegal. Me mentioning to you how much I charge
is totally legal.

This mainly applies to big businesses and large manufacturers - OPEC for example
would be TOTALLY illegal in the US.

--Joe

On Thu, Feb 01, 2001 at 08:49:00AM -0500, Brian V Bonini wrote:
 Isn't it illegal in the US to discuss
 rates in this manner?
 
 It's always been my understanding that
 The U.S. law specifically makes discussion
 of pricing between competitors (all or some)
 a federal offense. 
 
 Am I taking this too literally?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Calendar help

2001-02-02 Thread Joe Stump

Search for "php calendar" on freshmeat.net

--Joe

On Fri, Feb 02, 2001 at 04:28:37PM -0500, Fang Li wrote:
 Hello
 
 Has anyone coded a calendar using PHP? when click a date in the calendar,it
 will sotre the date in a database.
 Thanks.
 
 Fang
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Change Password script

2001-02-02 Thread Joe Stump

DB password or unix password?

--Joe

On Fri, Feb 02, 2001 at 03:38:15PM -0600, enthalpy wrote:
 
 anyone have example code of a change password script in php?
 
 -CoreComm-Internet-Services--http://core.com/-
 (Jon Marshall CoreComm Services Chicago)
 ([EMAIL PROTECTED] Systems Engineer II)
 ([EMAIL PROTECTED]   Network Operations)
 -Enthalpy.orghttp://enthalpy.org/-
 ([EMAIL PROTECTED] The World of Nothing)
 --
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] getting STDIO

2001-02-02 Thread Joe Stump

  #!/path/to/php -q
  ?

  $fp = fopen('/dev/stdin','r');

  if($fp)
  {
while(!feof($fp))
{
  $line = trim(fgets($fp,4096));
}
  }

  ?

  chmod +x script.php


--Joe

On Fri, Feb 02, 2001 at 04:36:48PM -0300, Martin A. Marques wrote:
 I want to use PHP to build a script that would run from the comand line. Now 
 me problem is how do I make PHP interpretate a chunk of text that is piped to 
 it?
 Lets say my script is named script1.php and I do:
 
 $ less file1 | script1.php
 
 just like if I send variables with info with a put in the apache module 
 version.
 How do I get that output?
 
 Saludos... :-)
 
 -- 
 System Administration: It's a dirty job, 
 but someone told I had to do it.
 -
 Martn Marqusemail:  [EMAIL PROTECTED]
 Santa Fe - Argentina  http://math.unl.edu.ar/~martin/
 Administrador de sistemas en math.unl.edu.ar
 -
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] XML Parsing with PHP

2001-02-04 Thread Joe Stump

phpbuilder.com - there are a few articles on the site about XML

--Joe

On Sun, Feb 04, 2001 at 05:02:43PM +0100, Steve Haemelinck wrote:
 Where can I find some info on parsing XML with PHP?
 I am not looking for functions, but examples and explanations !
 
 Thx
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] db paging with MS Sql

2001-02-04 Thread Joe Stump

I was just meaning plain SQL - can't microsoft say ANSI? All I ask for is a
simple little standard and for people to follow it - I'm not asking for every
feature of the standard - just a following.

--Joe

On Sun, Feb 04, 2001 at 10:43:37PM -0300, Manuel Lemos wrote:
 Hello Joe,
 
 On 04-Feb-01 21:18:55, you wrote:
 
 AFAIK this is more of a SQL thing than a DB specific thing. Just look up the
 LIMIT equivilent in MS SQL (should just be LIMIT) and use that for paging,
 once you get the hang of it it's quite easy.
 
 You can look through my paging class at www.miester.org/software - it goes
 one deeper and does [ prev ] [1] [2] [3] [ next ] and then only shows X
 ammount of pages so when you get to page 10 it would show [9] [10] [11]
 
 I suppose you mean MySQL and not MS (MicroSoft) SQL .  They are not
 compatible.
 
 
 Regards,
 Manuel Lemos
 
 Web Programming Components using PHP Classes.
 Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
 --
 E-mail: [EMAIL PROTECTED]
 URL: http://www.mlemos.e-na.net/
 PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
 --
 

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Bug or what?

2001-03-12 Thread Joe Stump

We had NASTY problems with cookies on different servers. I've even seen code
work on one linux/apache machine and not another. This is usually due to the 
fact that the server's clock is off from the browsers clock (or vice versus)
and the browser sees that the cookie has passed and destroys it without setting
it.

--Joe

On Mon, Mar 12, 2001 at 01:08:37PM -0600, Fabio Ottolini (EDB) wrote:
 First File - index.php
 
 ?php
 header("Pragma: no-cache");
 header("Cache-Control: no-cache, must-revalidate");
 if(empty($check)) {
 $page = "index.php?check=1";
 header("Location: $page");
 setcookie("testcookie", "1");
 }
 else {
 if(empty($testcookie)) {   
 echo ("font face=arial size=4 color=redProblem detected!/fontbrbr" .
 "bYour browser does not support cookies!/bbrbr" .
 "font size=2Enable cookies and try again./font");
 die;
 }
 else {
 $page = "login.php";
 header("Location: $page");
 }
 }
 ?
 
 Second File - login.php
 
 ?php
 header("Pragma: no-cache");
 header("Cache-Control: no-cache, must-revalidate");
 ?
 html
 head
 titleForecast Tool - ATL Key Account/title
 /head
 body
 form method="post" action="temp.php" name="form_login"
 table
 trtdfont size="2" face="Arial, Helvetica, sans-serif"Login:/font/td
 tdinput type="text" name="login" size="8" maxlength="8"br/td/tr
 trtdfont size="2" face="Arial, Helvetica, sans-serif"Password:/font/td
 tdinput type="password" name="senha" size="8" maxlength="8"/td/tr
 trtdinput type="reset" name="botao" value="Clear"/td
 tdinput type="submit" name="submit" value="Login"/td/tr
 /table
 /form
 /body
 /html
 
 Everything works fine when I use these two files with Apache running on Solaris, RH, 
Windows 98, Windows ME and Windows NT 4.0. The main objective is to test if the 
browser supports cookies of course. But... If I use Microsoft IIS with these two 
files it never works! The cookie is NEVER sent to the browser (this was verified 
using Netscape's option to warn about new cookies coming in) and obviously I always 
receive the error message stating that my browser doesn't support cookies! 
Impossible! The same application running on two different servers produces different 
results? Is it a bug? 
 Thanks in advance!!!
 
 Best regards,
 
 Fbio Ottolini
-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.geekshare.com http://www.care2.com http://www.miester.org/\\
"Those who can, create. Those who can't, complain."_\_V
---


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




Re: [PHP] I want this magic directory

2001-03-14 Thread Joe Stump

Read up on forcetype'ing on phpbuilder.com - it will do just what you want it
to do.

--Joe

On Wed, Mar 14, 2001 at 06:08:18PM +0800, Alex wrote:
 I just want every customer on my site get his own unique id as his directory
 name but the pages requested are all processed by the root.
 Such as: customer1's url is http://www.mysite.com/2000123/
  customer2's url is http://www.mysite.com/2000124/
   ^^^UID
 and the pages requested are actually processed by http://www.mysite.com/
 
 I want it to implement security and personalization. I don't want to use
 .php?uid=XXX because of lazy. :)
 thanks.
 
 
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.geekshare.com http://www.care2.com http://www.miester.org/\\
"Those who can, create. Those who can't, complain."_\_V
---


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




Re: [PHP] random letters and numbers

2001-03-24 Thread Joe Stump

Sure - use md5()

--Joe

On Sat, Mar 24, 2001 at 12:05:49PM -0500, Randy Johnson wrote:
 Is there an easy way to create random numbers and letters for a file example
 
 
 http://www.mydomain.com/1w2e3rff.txt  
 
 and then after they download it have it be deleted off the server?
 
 
 thanks
 
 randy
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
/*\
 *Joe Stump  *
 *www.Care2.com  *   
 *Office: 650.328.0198   *
 *Extension: 122 *
\*/
www.miester.org

-BEGIN GEEK CODE BLOCK-
Version: 3.12 
GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
--END GEEK CODE BLOCK--


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




[PHP] New PHP-GTK Site

2001-03-27 Thread Joe Stump

I've noticed there isn't really a jumping off point for the PHP-GTK beginners
and users. I spent the last few hours throwing a site together that has the
basics to fill this void.

It has:

1.) An application archive
2.) News 
3.) Discussion
4.) Helpful Links

I've put up one of my initial apps and plan to put up a few others and maybe
a small HOWTO. I'd like the people who have been posting apps to take a few 
minutes to post their apps here as well. Also, anyone who was thinking of 
posting their apps it might be better served if we posted them in a more
central location. Finally, if anyone wants to help out (admin, howtos, etc.)
please feel free to contact me. 

As for me, I'm tired and plan on working on it more tomarrow :o)

--Joe


/*\
 *Joe Stump  *
 *www.Care2.com  *   
 *Office: 650.328.0198   *
 *Extension: 122 *
\*/
www.miester.org

-BEGIN GEEK CODE BLOCK-
Version: 3.12 
GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
--END GEEK CODE BLOCK--


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




[PHP] Re: [PHP-GTK] New PHP-GTK Site

2001-03-27 Thread Joe Stump

So tired I forgot to put in the URL:

http://gtk.php-coder.net

--Joe

On Tue, Mar 27, 2001 at 10:32:26PM -0500, Joe Stump wrote:
 I've noticed there isn't really a jumping off point for the PHP-GTK beginners
 and users. I spent the last few hours throwing a site together that has the
 basics to fill this void.
 
 It has:
 
 1.) An application archive
 2.) News 
 3.) Discussion
 4.) Helpful Links
 
 I've put up one of my initial apps and plan to put up a few others and maybe
 a small HOWTO. I'd like the people who have been posting apps to take a few 
 minutes to post their apps here as well. Also, anyone who was thinking of 
 posting their apps it might be better served if we posted them in a more
 central location. Finally, if anyone wants to help out (admin, howtos, etc.)
 please feel free to contact me. 
 
 As for me, I'm tired and plan on working on it more tomarrow :o)
 
 --Joe
 
 
 /*\
  *Joe Stump  *
  *www.Care2.com  *   
  *Office: 650.328.0198   *
  *Extension: 122 *
 \*/
 www.miester.org
 
 -BEGIN GEEK CODE BLOCK-
 Version: 3.12 
 GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
 N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
 5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
 --END GEEK CODE BLOCK--
 
 
 -- 
 PHP GTK Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
/*\
 *Joe Stump  *
 *www.Care2.com  *   
 *Office: 650.328.0198   *
 *Extension: 122 *
\*/
www.miester.org

-BEGIN GEEK CODE BLOCK-
Version: 3.12 
GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
--END GEEK CODE BLOCK--


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




Re: [PHP] file deletions ....

2001-03-28 Thread Joe Stump

Make sure that the PHP user (usually nobody) has the access to delete those
files - I usually just do `rm -fr /path/to/file.foo`; and it works fine.

--Joe

On Wed, Mar 28, 2001 at 09:42:36AM +0100, Steve Brett wrote:
 hi,
 
 i need to delete files in my web folder so i can 'tidy' them up. i have a
 username and password that has ftp access and so far i've tried system(),
 unlink() and setting up an ftp connection (they use php 4.03 whihc seems to
 have ftp access closed).
 
 i have no problem listing the files i want to delete but seem unable to
 delete them.
 
 can anyone help ?
 
 Steve
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
/*\
 *Joe Stump  *
 *www.Care2.com  *   
 *Office: 650.328.0198   *
 *Extension: 122 *
\*/
www.miester.org

-BEGIN GEEK CODE BLOCK-
Version: 3.12 
GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
--END GEEK CODE BLOCK--


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




Re: [PHP] New PHP-GTK Site

2001-03-28 Thread Joe Stump

PHP-GTK, for those who don't know, is an implementation of GTK using the PHP
language. It basically allows you to program GUI applications in PHP on Windows,
Linux, and basically any other OS that GTK and PHP will compile on.

To find out more information check out:

http://www.gtk.org
http://gtk.php.net
http://gtk.php-coder.net

--Joe

On Wed, Mar 28, 2001 at 11:19:24AM -0800, elias wrote:
 What is PHP-GTK?
 Can you just write me a short list of what it can do?
 
 "Joe Stump" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I've noticed there isn't really a jumping off point for the PHP-GTK
 beginners
  and users. I spent the last few hours throwing a site together that has
 the
  basics to fill this void.
 
  It has:
 
  1.) An application archive
  2.) News
  3.) Discussion
  4.) Helpful Links
 
  I've put up one of my initial apps and plan to put up a few others and
 maybe
  a small HOWTO. I'd like the people who have been posting apps to take a
 few
  minutes to post their apps here as well. Also, anyone who was thinking of
  posting their apps it might be better served if we posted them in a more
  central location. Finally, if anyone wants to help out (admin, howtos,
 etc.)
  please feel free to contact me.
 
  As for me, I'm tired and plan on working on it more tomarrow :o)
 
  --Joe
 
 
  /*****\
   *Joe Stump  *
   *www.Care2.com  *
   *Office: 650.328.0198   *
   *Extension: 122 *
  \*/
  www.miester.org
 
  -BEGIN GEEK CODE BLOCK-
  Version: 3.12
  GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
  N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
  5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
  --END GEEK CODE BLOCK--
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
/*********\
 *Joe Stump  *
 *www.Care2.com  *   
 *Office: 650.328.0198   *
 *Extension: 122 *
\*/
www.miester.org

-BEGIN GEEK CODE BLOCK-
Version: 3.12 
GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
--END GEEK CODE BLOCK--


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




Re: [PHP] Cookie not getting set in IE 5 but no problem in Netscape

2001-03-28 Thread Joe Stump

Ah yes, the infamous IE cookie problem - look at the expire time - I be it
destroys the cookie as soon as it gets it because the expire time is either on
or before the time the cookie was sent.

--Joe

On Wed, Mar 28, 2001 at 07:16:52PM +0800, Floyd Piedad wrote:
 My program works really well with Netscape.  But with some Internet Explorer
 installs, the cookie does not get remembered?  I already set the Security
 options to Allow Cookies (both).  When I set it to prompted, it even asked me if
 I wanted to accept the cookie, replied yes, but still the cookie cannot be read
 by the PHP program?
 
 Thanks,
 
 Floyd
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
/*\
 *Joe Stump  *
 *www.Care2.com  *   
 *Office: 650.328.0198   *
 *Extension: 122 *
\*/
www.miester.org

-BEGIN GEEK CODE BLOCK-
Version: 3.12 
GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
--END GEEK CODE BLOCK--


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




Re: [PHP] Curious

2001-03-28 Thread Joe Stump

This is where I implement a reversal of quotes depending on what kind of 
quotes I'll be using in it - the draw back is hitting the . key a lot to
concat with variables, but it makes the my code more readable (IMO - no \'s all
over the place.

So like this :

echo 'a href="http://'.$url.'"'.$title.'/a'."\n";

or

echo "This is Mike's Homepage";

--Joe

On Wed, Mar 28, 2001 at 12:10:02PM +0200, Christian Reiniger wrote:
 On Wednesday 28 March 2001 08:18, you wrote:
 
  in general, I avoid using quotes where possible (such as in the
  following) font size=3 face=Arial (instead of font size=\"3\"
  face=\"Arial\")
 
 Remember that XHTML *requires* quotes around every attribute value.
 
 -- 
 Christian Reiniger
 LGDC Webmaster (http://sunsite.dk/lgdc/)
 
 /* you are not expected to understand this */
 
 - from the UNIX V6 kernel source
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
/*\
 *Joe Stump  *
 *www.Care2.com  *   
 *Office: 650.328.0198   *
 *Extension: 122 *
\*/
www.miester.org

-BEGIN GEEK CODE BLOCK-
Version: 3.12 
GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
--END GEEK CODE BLOCK--


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




Re: [PHP] Passing Special Characters in Query String

2001-03-28 Thread Joe Stump

 try rawurlencode()

Or just plain urlencode() - remember to use urldecode() on the other side if
you plan on putting it in the DB.

--Joe


 
 -- 
 Christian Reiniger
 LGDC Webmaster (http://sunsite.dk/lgdc/)
 
 /* you are not expected to understand this */
 
 - from the UNIX V6 kernel source
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
/*\
 *Joe Stump  *
 *www.Care2.com  *   
 *Office: 650.328.0198   *
 *Extension: 122 *
\*/
www.miester.org

-BEGIN GEEK CODE BLOCK-
Version: 3.12 
GB/E/IT d- s++:++ a? C UL++$ P+ L+++$ E! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D() G++@ e+@ h@ r+! z(+**)!
--END GEEK CODE BLOCK--


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




Re: [PHP] Catagory list

2001-03-31 Thread Joe Stump

This is what I'd do:

  $sql = "SELECT disinct category FROM article ORDER BY category";
  $r = mysql_query($sql);
  while($cat = mysql_fetch_array($r))
  {
$id = $cat['id'];
$sql = "SELECT * FROM article WHERE category='$id'";
$x = mysql_query($sql);
while($row = mysql_fetch_array($x))
{
  // echo articles here
}
  }

The permanent solution is to make a separate table called "categories" and then
do a join on the categoryID from the two tables.

--Joe

On Fri, Mar 30, 2001 at 10:33:11PM +1000, Mark Bayfield wrote:
 I am trying to make a catagory list that displays a distinct catagory, and
 then listing titles under that catagory.
 Unfortunatly all the data is in one table, and the catagory field is not set
 catagories, so there is duplicates in that field.
 The code so far is (but I am probably going about it the wrong way, if you
 can see whats wrong with my code plase help, or point me in some direction),
 
  $query = mysql_query("SELECT DISTINCT catagory from article order by
 catagory");
  $query2 = mysql_query ("SELECT * from article ORDER BY catagory");
 
  for ($index = 0; $index  mysql_num_rows($query); $index++) {
   $Catagory = mysql_fetch_row ($query) or die (mysql_error());
   $name1 =  mysql_fetch_row ($query2) or die (mysql_error());
   $x = $name1;
   $result1 = array_unique($Catagory);
   $result = array_merge($Catagory, $name1);
 
print ("$result1[0]BR");
for ($x=0; $x == $result1[0]; $x++) {
print ("nbsp;nbsp;nbsp;nbsp;a
 href='update.php?passed=$name1[0]'$name1[2]/abr\n");
}
  }
 
 I am trying everything to get it do just print the following:
 
 Catagory
 title1
 title2
 Catagory1
 title3
 title4
 
 Please help me out
 
 thanks
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/******\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




[PHP] something of interest on the GTK front

2001-03-31 Thread Joe Stump

I've just finished a proof of concept tutorial about how to create a GTK app
to be your backend on a dynamic PHP site. It steps you through makeing the API,
the GTK app, and the frontend. You can check it out at:

http://gtk.php-coder.net/docs/joe2001_03_31.4.html

For you GTK users it also has a pretty comprehensive example of GtkText(), which
seemed to be lacking.

--Joe

/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] C and PHP

2001-04-01 Thread Joe Stump

You might want to look in the PHP source code at the README.EXT_SKEL file for
info on how to incorporate that stuff.

--Joe

On Sat, Mar 31, 2001 at 08:49:30PM +0200, Ft Karras wrote:
 Somebody knows if it is possible to link C and PHP?
 
 I have a C library and need to 'include' with PHP code, as it does PERL, 
 is it possible?
 
 Thanks
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] building a php based subscription site (not a porn site)

2001-11-18 Thread Joe Stump

What I usually do is set a cookie BEFORE sending them to the paypal site then
on the confirm page (which they click through to after they paid) check for the
cookie - if it's there then activate the account. If not then delete the 
account after 5 days (gives them plenty of time to bitch if they didn't click
through).

Make sure to put a LARGE notice on your signup form explaining exactly how to
activate their account.

Hope this helps - it's worked great for me in the past.

--Joe

On Fri, Nov 16, 2001 at 06:02:38PM -0500, Vincent Stoessel wrote:
 I am helping a client make a transition from a ad revenue based site
 to a membership based one and I was wondering if there was some commonly
 used mechanism for php based membership sites. I have made
 membership sites before but they were free. How does one :
 
 1. Have a person register a username
 2. pay for membership ( paypay, payflow)
 3. Verify that membership is payed for
 4. Allow user to log in and browse member only content.
 
 
 umber 1 and 4 I know how to do but I'm not sure if my list is in
 the correct order. Should they pay for membership, then select a username?
 
 Has someone done this before?
 -- 
 Vincent Stoessel [EMAIL PROTECTED]
 Java Linux Apache Mysql Php (JLAMP) Engineer
 (301) 362-1750 Mobile (410) 419-8588
 AIM, MSN: xaymaca2020 , Yahoo Messenger: vks_jamaica
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

Joe Stump [EMAIL PROTECTED]

How would this sentence be different if pi equaled 3? 




msg40405/pgp0.pgp
Description: PGP signature


Re: [PHP] Auto Thumbnail?

2001-11-18 Thread Joe Stump

All you need is the nifty little program called convert - I have a frontend
class called convert.php at my website. Check out http://www.miester.org 
in the code section.

BTW, this bypasses the need for compiling gd into your php compile. Also, you'll
want to make sure you have convert on your system (sometimes isn't installed).
It's part of the Image Magik utility pack.

--Joe

On Fri, Nov 16, 2001 at 11:16:57PM +, cosmin laslau wrote:
 I've got a website which will alllow users to upload photos (jpegs) and, 
 once approved, they'll be up for display. To do that, I need an 
 auto-thumbnail script, preferrably for on-the-fly thumb generation.
 
 Any ideas? Also, what kind of libraries would I need.
 
 Thanks. The site is http://www.flat-6.net/f6
 
 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

Joe Stump [EMAIL PROTECTED]

How would this sentence be different if pi equaled 3? 




msg40406/pgp0.pgp
Description: PGP signature


Re: [PHP] alzheimers and confused

2001-11-18 Thread Joe Stump

if(!eregi(\.jpg$,$image) || !eregi(\.jpeg$,$image))
  die(ERROR: doesn't appear to be a JPeg image!);

--Joe

On Fri, Nov 16, 2001 at 09:45:07PM -0500, jtjohnston wrote:
 OK kids, I'm not 19 ... my old brain gets tired easily and my wife is
 complaining that I stay up too late PHPing :)
 Putting the rest aside, why does AND work and not OR. OR was what I
 meant?
 I meant ... if the string doesn't contain .jpg or the string doesn't
 contain .jpeg ...  ERROR!
 
 John
 
 ?php
 $errorfound = 0;
 $yourimage =
 
http://callisto.si.usherb.ca/~ang96m04/cgi-bin/postcards/e.jpegstrie/sap_bucket.jpg;;
 
 // if((!strpos($yourimage, .jpg)) or (!strpos($yourimage, .jpeg)))
  if((!strpos($yourimage, .jpg)) and (!strpos($yourimage, .jpeg)))
  {
   $errorfound++;
   echoYour image \font color=\00\$yourimage/font\br did
 not contain .jpg or .jpeg/b;
  }else{
   echoYour image \font color=\00\$yourimage/font\ contains
 .jpg or .jpeg/b;
  }
 
 ?
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

Joe Stump [EMAIL PROTECTED]

How would this sentence be different if pi equaled 3? 




msg40407/pgp0.pgp
Description: PGP signature


Re: [PHP] Question on variable variables

2001-11-18 Thread Joe Stump

This would be the logical way to do it (as I see it):

define('MY','pre_');
$a = dog;
$new_var = MY.$a;

$$new_var and $pre_dog are the same :)

--Joe


On Fri, Nov 16, 2001 at 09:47:12PM -0500, Jeff Lewis wrote:
 I've a question regarding variable variable I was hoping someone could help me with:
 
 All the examples in the manual have the entire variable name being variable e.g.
 $a = hello   and
 $$a being the same as $hello
 
 What I need to do, however, is append a variable portion to a constant prefix.  So I 
have a set of variables that are named $MYdog, $MYcat etc. and I need to do
 
 $a = dog
 ${MY$a} being the same as $MYdog
 
 Can this be done, and if so - how? I can't get it to work.
 
 Jeff

Joe Stump [EMAIL PROTECTED]

How would this sentence be different if pi equaled 3? 




msg40409/pgp0.pgp
Description: PGP signature


Re: [PHP] comma-formatting numbers

2001-11-18 Thread Joe Stump

Here is an example of number format:

?

  $foo = 10;

  echo number_format($foo,2); // displays 100,000.00

?

--Joe


On Sat, Nov 17, 2001 at 01:45:16PM -0800, Paul Wolstenholme wrote:
 You can do this using the number_format function or probably sprintf.
 /Paul
 
 On Saturday, November 17, 2001, at 01:36  PM, Scott Dudley wrote:
 
 
 i'm new to php and am having difficulty translating this tiny awk
 function that i use to comma format numbers.  can someone assist?  my
 stumbling block thus far have been the fact the the php regex matching
 functions don't return the byte offset within the haystack and the regex
 replace functions don't support the awk and perl-like ampersand  in
 the replacement pattern.  please help and thanks.
 
 function commas(num) {
   while (num ~ /[0-9][0-9][0-9][0-9]/)
 sub (/[0-9][0-9][0-9]$|[0-9][0-9][0-9][,]/, ,, num)
 
   return num
 }
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

Joe Stump [EMAIL PROTECTED]

How would this sentence be different if pi equaled 3? 




msg40412/pgp0.pgp
Description: PGP signature


Re: [PHP] PHP Backing up a Database?

2001-11-18 Thread Joe Stump

This is what you'll want to do:

0 0 * * * /path/to/mysqldump -u[username] -p[username] [database]  /path/to/backup.sql

Put that above in your crontab (you might want to tar/gzip it too if it's big)
then download it via cron to your local box.

You could also look into rsync.

--Joe

On Sat, Nov 17, 2001 at 10:25:04PM +, cosmin laslau wrote:
 Hi,
 
 Say I'm not really confident in the prowess of my server, and I want to 
 download my database onto my computer. Can that be done? What can I look 
 (FTP access) in the directory structure. I guess, where is it usually 
 located?
 
 Thanks.
 
 Cosmin Laslau
 
 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

Joe Stump [EMAIL PROTECTED]

How would this sentence be different if pi equaled 3? 




msg40413/pgp0.pgp
Description: PGP signature


Re: [PHP] extract() question

2001-11-18 Thread Joe Stump

You may want to do something like this instead:

?

  function my_extract($arr)
  {
if(is_array($arr)  sizeof($arr))
{
  while(list($key,$val) = each($arr)
  {
$new_var = str_replace(' ','_',$key);
global $$new_var;
$$new_var = $val;
  }
}
  }

?

--Joe


On Sun, Nov 18, 2001 at 04:21:46PM -0500, David Bernier wrote:
 There is this array which I would like to convert into a series variables using the 
extract function: 
 
 ?
 $oz = array(
  lion = courage, 
  dorothy = kansas, 
  scarecrow = brain
  tin man = heart); 
 
 extract($oz);
 ?
 
 now, I would like to access my new variables. it is obviously easy for $lion, 
$dorothy, and $scarecrow but it isn't for tin man.
 
 from this, I have 3 or 4 questions:
 1) has $oz[tin man] been passed into a variable?
 2) if yes, how do I access the variable that came out of $oz[tin man]?
 3) let's pretend that I have no control over the names of the keys for $oz, how 
should I have called extract() to tell it to replace the space between tin and 
man by a underscore character?
 4)  finally, is there a way to access and retrieve that values of the symbol table 
without knowing their names?
 
 David
 

Joe Stump [EMAIL PROTECTED]

How would this sentence be different if pi equaled 3? 




msg40414/pgp0.pgp
Description: PGP signature


Re: [PHP] relative paths

2001-11-18 Thread Joe Stump

An easy way to fix this common problem is this:

define('BASE_INCLUDE_PATH','/var/www/includes/');

include(BASE_INCLUDE_PATH.'my_include.inc');

Just make sure to include the file with the BASE_INCLUDE_PATH define using a
relative path ... ie.

?

  include('./init.inc');


?

--Joe


On Sat, Nov 17, 2001 at 05:15:02PM +0100, Mitja Pagon wrote:
 Hi!
 
 I want to know if there is a way to include(require) a file using a path
 relative to web server root.
 
 I'm aware of the fact that you can specify include path, but I believe that
 this is not the best solution, since applications written that way aren't
 easily portable.
 
 What I'm looking for is something similar to what / does in HTML paths and
 SSI include directives.
 
 Thanks,
 
 Mitja Pagon
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

Joe Stump [EMAIL PROTECTED]

How would this sentence be different if pi equaled 3? 




msg41133/pgp0.pgp
Description: PGP signature


Re: [PHP] server alias

2001-05-14 Thread Joe Stump

Works great - thanks!

--Joe

On Tue, May 15, 2001 at 11:51:35AM +1000, Jason Brooke wrote:
  $SERVER_NAME only gives me foober.com (since that is the servername), but not
  the alias someone typed in to get there ...
 
  --Joe
 
 Give HTTP_HOST a go
 Check here for more
 http://www.php.net/manual/en/language.variables.predefined.php or use phpinfo()
 to see exactly what you have available
 
 jason
 
 

Joe Stump [EMAIL PROTECTED]

There is no remedy for sex but more sex. (contributed by 
Chris Johnston) 

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




Re: [PHP] XML Parsing with PHP

2001-02-05 Thread Joe Stump

If you're talking about my article on PHPBuilder 

Found at: http://www.phpbuilder.com/columns/joe2907.php3

You can feel free to ask me any questions you like in private (I write them
because I like supporting a community that has helped me so much)

--Joe

 
On Mon, Feb 05, 2001 at 10:19:17AM -0800, Chris Lee wrote:
 PHPbulder.com classically has terrible tutorials. I myself am trying to
 learn this XML deal. PHPbuilders code, cut and paste is filled with parse
 errors. after fiddling Ive got his example to work, but I havent a clue how?
 he posts this stupid two page article, page one is nothing, page two is
 nothin plus broken code. He doesn explain what even one of his four
 functions are for. completely confused. I hate to ramble, but phpbuilder is
 a terrible site that ruins php for many newbies.
 
 
 --
 
 
 
 Chris Lee
 Mediawaveonline.com
 [EMAIL PROTECTED]
 
 
 
 "Joe Stump" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  phpbuilder.com - there are a few articles on the site about XML
 
  --Joe
 
  On Sun, Feb 04, 2001 at 05:02:43PM +0100, Steve Haemelinck wrote:
   Where can I find some info on parsing XML with PHP?
   I am not looking for functions, but examples and explanations !
  
   Thx
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
  --
 
  ------
 -
  Joe Stump, PHP Hacker,
  -o)
  http://www.miester.org http://www.care2.com
 /\\
  "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
 _\_V
  --
 -
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] MySQL --- OR in a select statement ???

2001-02-05 Thread Joe Stump

You could do this:

users   admins
-   --
userID  userID
fname
lname

select U.* from users U, admins A where A.userID=U.userID  (U.userID=100 ||
U.userID=101)

you could also use the IN () function ...

select U.* from users U, admins A where A.userID=U.userID  U.userID 
in (100,101,400,500)

Hope this helps!

--Joe


On Mon, Feb 05, 2001 at 11:34:21PM -0600, Dallas Kropka wrote:
 
 
   Is it possible to include an OR condition in a MySQL select on 2 different
 tables?
 
   I have 1 table of basic customers and one table of Admins, both tables
 "Relate" to the UserNum table containing UserNumber login password and
 privs, I want to select one field from the correct table based on the
 usernumber which is unique to all users and stored in the root User
 table trying to do something like this
 
 SELECT first_name FROM admin_table, user_table WHERE userNum = 1000
 
   The info will only be in one or the other but what (if any) is the
 correct syntax?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] [Newbie] PHP Variables

2001-02-08 Thread Joe Stump

That should work just fine.

Make sure that HOME doesn't have any spaces and is urlencode()'d

--Joe

On Thu, Feb 08, 2001 at 09:49:18PM +0100, Steve Haemelinck wrote:
 I thought you can pass variables in PHP as in CGI.
 
 http://www.xy.com/index.php?contents=HOME
 
 contents should be available as variable, but it does not seem to work. Doe
 anyone has an idea why not?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Cron + PHP

2001-02-08 Thread Joe Stump

#!/path/to/php -q
?

  mail('[EMAIL PROTECTED]','foo','foo');

?

chmod +x foo.php

0 0 * * * /path/to/foo.php  /dev/null

--Joe

On Thu, Feb 08, 2001 at 07:36:57PM -0300, GAYTAN BAHAMONDEZ DANIEL EDUARDO wrote:
 How can i make a crontab run a  php file???
 should i add something like this in the file:
 
 path/to/file.php 
 
 
 Thanks in advance...
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] afraid !

2001-02-11 Thread Joe Stump

Heaven forbid you use a command line. I wouldn't trade my *NIX prompt for 
anything. Once you learn it you're set. MySQL's prompt is much like Oracle's
prompt and we all know Access has NO business anywhere near "enterprise" 
software.

I'd recommend learning the command prompt (which an hour's read on linuxdoc.org
can fix). If you decide to move to PHPMyAdmin (ack!) I'd be willing to bet you
move right back to the power of the prompt.

My $0.02

--Joe aka "Lover of the Prompt"



On Sun, Feb 11, 2001 at 07:17:50PM -, php php wrote:
 Hi!
 i've just joined ur mailing list!
 i used to work on asp with oracle and access!
 i'm working on windont NT but i want to publish my site at a provider that 
 has linux? do i have to change my code for that ?
 do u know any provider that accepts acces and mysql with php4?
 i'm afraid of using mysql with php cause i'm in hurry and that i discovered 
 that mysql interface is not as good and easy as of oracle and access! is it 
 true that if i want to insert data to a table i have to do it from the 
 commend line?
 Thanks   a lot
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Using PHP to process forms

2001-02-12 Thread Joe Stump

These are really basic functions of PHP and you should probably start out
with some of the beginner tutorials found on php.net

--Joe

On Mon, Feb 12, 2001 at 04:54:30PM -0500, Don wrote:
 Does anyone have examples of using PHP to process forms?  I'd also like
 to know if I can embed the code in my html file or do I have to write a
 CGI server side script to do it?
 
 Thanks,
 Don
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Structuring large PHP programs

2001-02-14 Thread Joe Stump

The way I normally do it is I have ONE main include (usually init.inc)
and then all files that I might need throught my page I put in init.inc 

I works nicely for me.

--Joe

On Wed, Feb 14, 2001 at 09:15:35PM +0100, Ben Peter wrote:
 John,
 
 part of this is a matter of taste - I would personally rather split this
 into functions.
 
 BUT: even if you _are_ using functions, you should only include() the
 file with the function when you need it, IF this part of the code is
 getting large. This way, php will not need to parse code that it won't
 need anyway.
 
 Ben
 
 
 John McCreesh wrote:
  
  What is the best practice for structuring a PHP program which is
  becoming too large to manage as a single file? Should it be broken into
  a number of includes, e.g.:
  
  switch ($whatever) {
  case 0:
  include('case0.php');
  break;
  case 1:
  include('case1.php');
  break;
  case 2:
  include('case2.php');
  break;
  }
  
  or a number of functions:
  
  require('mylib');
  switch ($whatever) {
  case 0:
  case0();
  break;
  case 1:
  case1();
  break;
  case 2:
  case3();
  break;
  }
  
  Any thoughts, references to articles (couldn't find anything in
  PHPBuilder), etc gratefully received...
  
  Thanks - John
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Structuring large PHP programs

2001-02-14 Thread Joe Stump

Declaring the functions is minimal. Either your ISP has the memory allocations
set unbearably low or you aren't coding things very well ...

--Joe

On Thu, Feb 15, 2001 at 04:16:22AM +0100, Ben Peter wrote:
 Hi Joe,
 
 the reason I changed to 'include on demand' was a rather large
 application which would not work, as the memory limit that my isp had
 set wouldn't suffice.
 
 I have files that are included all the way, yes: DB connection, some
 common helpers, etc. But I would not include files that the current
 state of an application (or part of the site) does not need to keep
 things small. 
 This is especially true for some classes which before included both user
 access and 'admin' function (for, say, user authentication and
 administration). I split all of these up into two classes, so that the
 part that is accessed when a regular user hits the site is minimal, and
 the administrative functions won't be loaded in that case.
 
 Ben
 
 Joe Stump wrote:
  
  Normally, yes. The chances of a page NOT accessing the db is slim at best. I
  generally keep them there because the speed lost on parsing function
  definitions is minute and I don't have to worry about including numerous
  files in each page - or worse going through 100's of pages and adding an
  include I need when I add new functionality!
  
  --Joe
  
  On Wed, Feb 14, 2001 at 05:16:52PM -0800, Jonathan Sharp wrote:
   do you include EVERY file in init.inc even if that script doesn't use it? So
   if you have a db.inc and it doesn't use the db at all...is it included?
  
   -Jonathan
  
-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 5:11 PM
To: Ben Peter
Cc: John McCreesh; [EMAIL PROTECTED]
Subject: Re: [PHP] Structuring large PHP programs
   
   
The way I normally do it is I have ONE main include (usually init.inc)
and then all files that I might need throught my page I put in init.inc
   
I works nicely for me.
   
--Joe
   
On Wed, Feb 14, 2001 at 09:15:35PM +0100, Ben Peter wrote:
 John,

 part of this is a matter of taste - I would personally rather split this
 into functions.

 BUT: even if you _are_ using functions, you should only include() the
 file with the function when you need it, IF this part of the code is
 getting large. This way, php will not need to parse code that it won't
 need anyway.

 Ben


 John McCreesh wrote:
 
  What is the best practice for structuring a PHP program which is
  becoming too large to manage as a single file? Should it be
broken into
  a number of includes, e.g.:
 
  switch ($whatever) {
  case 0:
  include('case0.php');
  break;
  case 1:
  include('case1.php');
  break;
  case 2:
  include('case2.php');
  break;
  }
 
  or a number of functions:
 
  require('mylib');
  switch ($whatever) {
  case 0:
  case0();
  break;
  case 1:
  case1();
  break;
  case 2:
  case3();
  break;
  }
 
  Any thoughts, references to articles (couldn't find anything in
  PHPBuilder), etc gratefully received...
 
  Thanks - John
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
[EMAIL PROTECTED]

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
   
--
   
--
-
Joe Stump, PHP Hacker, [EMAIL PROTECTED]
  -o)
http://www.miester.org http://www.care2.com
  /\\
"It's not enough to succeed. Everyone else must fail" -- Larry
Ellison _\_V
--
-
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
   
   
  
  
  --
  
  -------
  Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
  http://www.miester.org http://www.care2.com /\\
  "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
  ---
  
  --
  PHP Genera

Re: [PHP] Using PHP from the command line

2001-02-15 Thread Joe Stump

use $argv and $argc just like C/C++ :O)

--Joe

On Thu, Feb 15, 2001 at 03:50:54PM -0600, Diego Fulgueira wrote:
 Hi!! I was wondering if anyone knows how to pass parameters to PHP.EXE when
 invoked from the command line (DOS prompt).
 
 I know this shouldn't differ too much from the Linux version, so anyone who
 has scheduled scripts to run using CRON should have an idea, i guess.
 
 In particular, I don't know how to pass the URL and other parameters needed.
 
 THANKS A LOT!!!
 Cheers, Diego.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Using PHP from the command line

2001-02-15 Thread Joe Stump

Yeah - like I said 

php foo.php -url http://www.mydomain.com/myfile.php

in foo.php

echo $argc;// should be 3
echo $argv[0]; // will be the filename
echo $argv[1]; // will be -url
echo $argv[2]; // will be the url

--Joe


On Thu, Feb 15, 2001 at 04:47:48PM -0600, Diego Fulgueira wrote:
 Yes, but the problem is not to receive the arguments inside PHP.EXE but to
 call PHP.EXE passing it those arguments
 I was thinking of something like:
 
 c:\php c:\mysite\myfile.php -url "http://mydomain.com/myfile.php"
 
 If you have any ideas THANKS A LOT.  DIEGO.
 
 
 -Original Message-----
 From: Joe Stump [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 15 February, 2001 4:08 PM
 To: Diego Fulgueira
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Using PHP from the command line
 
 
 use $argv and $argc just like C/C++ :O)
 
 --Joe
 
 On Thu, Feb 15, 2001 at 03:50:54PM -0600, Diego Fulgueira wrote:
  Hi!! I was wondering if anyone knows how to pass parameters to PHP.EXE
 when
  invoked from the command line (DOS prompt).
 
  I know this shouldn't differ too much from the Linux version, so anyone
 who
  has scheduled scripts to run using CRON should have an idea, i guess.
 
  In particular, I don't know how to pass the URL and other parameters
 needed.
 
  THANKS A LOT!!!
  Cheers, Diego.
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 --
 
 ----
 ---
 Joe Stump, PHP Hacker,
  -o)
 http://www.miester.org http://www.care2.com
 /\\
 "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
 _\_V
 
 ---
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] crontab help

2001-02-22 Thread Joe Stump

BTW when it sleeps PHP takes up no noticable resources. Also I'm running the
php binary to send out these messages (that way I can use screen and make sure
that my browser doesn't crash, os freeze, etc.)

--Joe

On Fri, Feb 22, 2002 at 03:36:33PM +0800, Arnold Gamboa wrote:
 thanks for the comment
 
 let's just say i have 100k emails to send... don't you think that will drain
 the system resources if i send it all at once even if you have usleep(300)
 on each while?
 
 your comment please.
 
  put a sleep(300); at the end of your while() loop - I did this on my mass
  mailer and it worked like a charm.
 
  --Joe
 
  On Fri, Feb 22, 2002 at 02:53:10PM +0800, Arnold Gamboa wrote:
   hi there.
  
   is there a way to tell crontab to do:
  
   "run script every 5 mins for 1 hour"..
  
   i have this mass email script that is so huge that i need it to chunk
 into
   records and make sure that it will run every 5 mins for 1 hour.
  
   Thanks for any help.
  
 
  --
 
  --
 -----
  Joe Stump, PHP Hacker,
  -o)
  http://www.miester.org http://www.care2.com
 /\\
  "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
 _\_V
  --
 -
 
 
 
 

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] crontab help

2001-02-22 Thread Joe Stump

1.) sleep() is in seconds - plain old seconds - so sleep(300) == 5 minutes.

2.) yes - send, sleep, send, ...

--Joe


On Thu, Feb 22, 2001 at 11:09:05PM +0800, Arnold Gamboa wrote:
 hi,
 
 thanks again. questions:
 
 1. sleep(300) would mean pause by 300 mins, right?  That's why i thought you
 mean usleep(300) - 300 microseconds. please comment
 2. what you mean is i will send 5000 emails, then pause and send again?
 
 Thanks for your help.
 
  I send roughly 1M of these and put a sleep() (not usleep - that's
 microseconds)
  into the while loop - I've come up with a decent balance that sends out a
 good
  number (like 5000) and then sleeps just long enough to get them out of
 qmail's
  queue, then it sends another 5000 (and so on).
 
  Usually takes about 24 hours to send out 1M messages.
 
  --Joe
 
  On Fri, Feb 22, 2002 at 03:36:33PM +0800, Arnold Gamboa wrote:
   thanks for the comment
  
   let's just say i have 100k emails to send... don't you think that will
 drain
   the system resources if i send it all at once even if you have
 usleep(300)
   on each while?
  
   your comment please.
  
put a sleep(300); at the end of your while() loop - I did this on my
 mass
mailer and it worked like a charm.
   
--Joe
   
On Fri, Feb 22, 2002 at 02:53:10PM +0800, Arnold Gamboa wrote:
 hi there.

 is there a way to tell crontab to do:

 "run script every 5 mins for 1 hour"..

 i have this mass email script that is so huge that i need it to
 chunk
   into
 records and make sure that it will run every 5 mins for 1 hour.

 Thanks for any help.

   
--
   
  
  --
   -----
    Joe Stump, PHP Hacker,
-o)
http://www.miester.org http://www.care2.com
   /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison
   _\_V
  
  --
   -
   
   
   
  
 
  --
 
  ------
 -
  Joe Stump, PHP Hacker,
  -o)
  http://www.miester.org http://www.care2.com
 /\\
  "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
 _\_V
  --
 -
 
 
 
 

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] isset()

2001-02-22 Thread Joe Stump

I stand firm on strlen() for the following reasons ...

if(!$var) will sometimes act strangely (has for me in the past) when variables
are set to something other than what you are expecting.

if(isset($var)) will return true if your text field is declared but not filled
in.

if(empty($var)) will return true if $var is set to 0 (for obvious reason) so is
only good for certain instances.

strlen() on the other hand converts the variable to a string and returns a count
of characters. It's never failed or acted funky. For this reason I use it 
religiously. 

Others might say "well it's extra overhead" to which I reply "I'll take an extra
bazillionth of a second to know for sure I have what I need"

--Joe

On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
 I would do this:
 
 if (!$AgeChild) $AgeChild = 'NA';
 
 More compact, easier to read (to me, anyway). This presumes that a 
 value of '' (empty string, interpreted by PHP as false) is NOT a 
 valid value here.
 
 As far as your sniplet goes, it is possible that there may be some 
 PHP type-casting issues here, depending on: whether $AgeChild is 
 numeric or string; the fact that the STRING "false" isn't equivalent 
 to the CONSTANT false, the use of == vs. ===.
 
 Time to check out the docs - specifically the types and variables 
 sections (also the functions-variables section)...
 
   - steve
 
 
 
 At 5:07 PM -0600 2/22/01, Jacky@lilst wrote:
 People
 I tried to check if teh field has set a vaule in it before submit 
 using isset with the sniplet below
 
 if ((isset($AgeChild))=="false") {
 $AgeChild = "NA";
 }
 
 The resule is that it always displays NA whether or not it has vaule 
 in the field, what is the correct way of using isset for this 
 purpose? Or should I use empty() ?
 Jack
 [EMAIL PROTECTED]
 "There is nothing more rewarding than reaching the goal you set for yourself"
 
 
 -- 
 +--- "They've got a cherry pie there, that'll kill ya" --+
 | Steve Edberg   University of California, Davis |
 | [EMAIL PROTECTED]   Computer Consultant |
 | http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
 +-- FBI Special Agent Dale Cooper ---+
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Download PHP from Linux machine?

2001-02-23 Thread Joe Stump

lynx -source 
http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gzsource_site=www.php.net
  php-4.0.4pl1.tar.gz will work - also try wget

--Joe

On Fri, Feb 23, 2001 at 03:28:14PM -0600, Jorge Alvarez wrote:
 Hi there,
 
 I want to download PHP from my Linux server, but I can't just type "lynx
 http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gzsource_
 site=www.php.net"
 
 This is the link in the PHP downloads page, but the shell gets confused by
 the  character.
 
 What should I do?
 
 Best Regards,
 
 Jorge.
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Order by Date (Newbie)

2001-02-23 Thread Joe Stump

To order by dates use SQL

select * from news order by PostDate DESC;

and then make sure that PostDate is a date or datetime - hell even an int with
a unix timestamp (aka time()) will work.

--Joe

On Fri, Feb 23, 2001 at 07:52:54PM -0500, Brian S. Drexler wrote:
 Ok, I must be missing something, but does anyone have a script that will
 order by the closest date in the future that hasn't been here yet.  Did that
 make sense?
 
 Brian
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Help INSERTing to MySQL

2001-02-23 Thread Joe Stump

Before your VALUES you need to have a list of the fields ie:

insert into table (id,fname,lname) values ('$id','$fname','$lname')

--joe

On Fri, Feb 23, 2001 at 08:00:30PM -0500, Clayton Dukes wrote:
 Hello,
 This is my first attempt, so I'm prolly doing something stupid, but can someone tell 
me why this doesn't work?
 All it returns is "Unable to INSERT to database"
 
 
 
 ---BEGIN---
 ?
$time = time();
$rand = Random_Password(5);
$docid = $time . $rand;
 
 if (isset($email)  isset($docid)) {
 mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
 
$query = "INSERT INTO documents VALUES ('$docid', '$category', '$subcategory', 
'$date', '$subject', '$title', '$author', '$email', '$language', '$gr
 ade', '$level', '$city', '$state', '$county', '$zip', '$authors_comments', 
'$teachers_comments', 'N', '$docdata')";
 
$result = mysql_db_query("$DATABASE", $query) or die("Unable to INSERT to 
database");
 
 if ($result) {
 echo "p$docid was added to the database/p";
 }
 }
 ?
 
  h1Submit a new document to the database/h1
  form
  Email Address: input type=text name=emailbr
  Category: select name=category? print "$CATEGORIES" ?/selectbr
  Sub Category: select name=subcategory? print "$SUBCATEGORIES" 
?/selectbr
  Date Document was written: input type=text name=date (xx-xx-)br
  Document Subject: input type=text name=subjectbr
  Document Title: input type=text name=titlebr
  Document Author: input type=text name=authorbr
  Document Language: input type=text name=language value=Englishbr
  Grade Received (Percentage): input type=text name=grade size=3 
(xx/100)br
  Grade Level of Paper: select name=leveloptionHigh 
School/optionoptionCollege/optionoptionOther/option/selectbr
  City in which paper was submitted: input type=text name=city 
value=Jacksonvillebr
  State in which paper was submitted: input type=text name=state 
value=FLbr
  County in which paper was submitted: input type=text name=county 
value=Duval b(County, not Country!)/bbr
  School at which paper was submitted: input type=text name=school 
value="Mandarin High School"br
  ZIP code: input type=text name=zip size=5 value=32257 b(Put your ZIP 
code in if you don't know your school's)/bbr
  Author's Comments: input type=text name=authors_commentsbr
  Teacher's Comments: input type=text name=teachers_commentsbr
  Document (ASCII TEXT ONLY):br
  textarea name=docdata cols=80 rows=30Paste document text here/textarea
  pinput type=submit value="Submit for verification"
  /form
 
 -END-
 
 
 
 TIA!
 Clayton
 

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

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] special characters with perl,mysql,php

2001-02-23 Thread Joe Stump

What type of special characters?

--Joe

On Fri, Feb 23, 2001 at 08:54:09PM -0600, Mitchell Hagerty wrote:
 Hey All,
 
 What would be a good method for inserting data into a blob field
 that contained special characters using perl then retrieving that
 data with php?
 
 URI::Escape has worked well with perl but now that php has
 gotten into the picture I need a new method.
 
 any suggestions?
 
 tks
 mitch
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] isset()

2001-02-23 Thread Joe Stump

You're wrong in saying that you "usually know what the variable will be" - you
never know what it's going to be. You aren't entering it you need to 
remember that mostly idiots are inputting the data :O)

--Joe

On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
 have I said it won't work, Joe?
 
 I said that using strlen() might not be necessary. (re-read my post)
 On my own opinion the same things could be done without using the string
 functions.
 Am I wrong in something there? then thanks for correcting me - will know it
 for the feature.
 
 
 Sincerely,
 
  Maxim Maletsky
  Founder, Chief Developer
 
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com
 
 
 
 
 -Original Message-----
 From: Joe Stump [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, February 24, 2001 4:17 PM
 To: PHPBeginner.com
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] isset()
 
 
 You are COMPLETELY wrong here. isset() is designed to check if a variable is
 SET - NOT if it has something in it. empty() is designed for strings NOT for
 ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
 problems
 when you do checks and variables aren't set.
 
 I do this, like I said before, because the extra 1 billionth of a second is
 worth the overhead. I've programmed for sites ranging from a few hundered
 hits
 a day to a few million hits a day and this works ALL the time.
 
 --Joe
 
 On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
  I don't agree with you in here,
 
  you usually know what kind of variable you're checking, so strlen() will
  work just as well as
 
  $var ? 'OK' : 'Empty'
 
  will work or the isset() - common, it was made for checking the
 variables -
  use it.
 
  strlen() is in fact an overhead, why would you allow your design to be
 some
  sort of untraditional? I don't think there's any necessity for it
 
  a "good design" often would be something like this:
 
  $var = 'whatever';
 
  if($var)
  ...do this
  else
  ERROR('no var') // some your func to output the error mess or to continue
  with debugging
 
  in most cases it will work better and simpler for you without spending
 these
  bazillions of important for every developer seconds.
 
 
 
  Sincerely,
 
   Maxim Maletsky
   Founder, Chief Developer
 
   PHPBeginner.com (Where PHP Begins)
   [EMAIL PROTECTED]
   www.phpbeginner.com
 
 
 
 
 
  -Original Message-----
  From: Joe Stump [mailto:[EMAIL PROTECTED]]
  Sent: Friday, February 23, 2001 3:07 AM
  To: Steve Edberg
  Cc: Jacky@lilst; [EMAIL PROTECTED]
  Subject: Re: [PHP] isset()
 
 
  I stand firm on strlen() for the following reasons ...
 
  if(!$var) will sometimes act strangely (has for me in the past) when
  variables
  are set to something other than what you are expecting.
 
  if(isset($var)) will return true if your text field is declared but not
  filled
  in.
 
  if(empty($var)) will return true if $var is set to 0 (for obvious reason)
 so
  is
  only good for certain instances.
 
  strlen() on the other hand converts the variable to a string and returns a
  count
  of characters. It's never failed or acted funky. For this reason I use it
  religiously.
 
  Others might say "well it's extra overhead" to which I reply "I'll take an
  extra
  bazillionth of a second to know for sure I have what I need"
 
  --Joe
 
  On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
   I would do this:
  
   if (!$AgeChild) $AgeChild = 'NA';
  
   More compact, easier to read (to me, anyway). This presumes that a
   value of '' (empty string, interpreted by PHP as false) is NOT a
   valid value here.
  
   As far as your sniplet goes, it is possible that there may be some
   PHP type-casting issues here, depending on: whether $AgeChild is
   numeric or string; the fact that the STRING "false" isn't equivalent
   to the CONSTANT false, the use of == vs. ===.
  
   Time to check out the docs - specifically the types and variables
   sections (also the functions-variables section)...
  
 - steve
  
  
  
   At 5:07 PM -0600 2/22/01, Jacky@lilst wrote:
   People
   I tried to check if teh field has set a vaule in it before submit
   using isset with the sniplet below
   
   if ((isset($AgeChild))=="false") {
   $AgeChild = "NA";
   }
   
   The resule is that it always displays NA whether or not it has vaule
   in the field, what is the correct way of using isset for this
   purpose? Or should I use empty() ?
   Jack
   [EMAIL PROTECTED]
   "There is nothing more rewarding than reaching the goal you set for
  yourself"
  
  
   --
   +--- "They've got a cherry pie there, that'll kill
 ya" --+
   | Steve Edberg   University of California, Davis
 |
   | [EMAIL PROTECTED]   Computer Consultant
 |
   | http://aesric.ucdavis.edu/  http://pgfsun

Re: [PHP] isset()

2001-02-24 Thread Joe Stump

For the last time - put an input box on a page and submit with NOTHING in the
box. Now I want SOMETHING in that box (like a name) - isset() will return true
even though it's empty.

--Joe

On Sat, Feb 24, 2001 at 04:32:11PM +0900, PHPBeginner.com wrote:
 Whatever they input is not the objects, right?
 
 then (I've just double-checked it, to be sure I am not saying some 'BULL')
 
 
 $var = 0;
 
 if($var)
   echo 'Pvar matched';
 
 if(isset($var))
   echo 'Pvar is set';
 
 
 when the $var is 0 the second condition will return true, the first will be
 false instead...
 Obviously if they enter anything else then 0 and NULL (I mean nothing) it
 will return true in both cases, if($var.., if(isset($var... if(strle($var
 ...
 
 What's wrong with isset() in here?
 I am on PHP4.0.4!
 
 explain me again, why on user input strlen() would do better then isset() ?
 
 
 Sincerely,
 
  Maxim Maletsky
  Founder, Chief Developer
 
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com
 
 
 
 
 
 -Original Message-
 From: Joe Stump [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, February 24, 2001 4:25 PM
 To: PHPBeginner.com
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] isset()
 
 
 You're wrong in saying that you "usually know what the variable will be" -
 you
 never know what it's going to be. You aren't entering it you need to
 remember that mostly idiots are inputting the data :O)
 
 --Joe
 
 On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
  have I said it won't work, Joe?
 
  I said that using strlen() might not be necessary. (re-read my post)
  On my own opinion the same things could be done without using the string
  functions.
  Am I wrong in something there? then thanks for correcting me - will know
 it
  for the feature.
 
 
  Sincerely,
 
   Maxim Maletsky
   Founder, Chief Developer
 
   PHPBeginner.com (Where PHP Begins)
   [EMAIL PROTECTED]
   www.phpbeginner.com
 
 
 
 
  -Original Message-
  From: Joe Stump [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, February 24, 2001 4:17 PM
  To: PHPBeginner.com
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] isset()
 
 
  You are COMPLETELY wrong here. isset() is designed to check if a variable
 is
  SET - NOT if it has something in it. empty() is designed for strings NOT
 for
  ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
  problems
  when you do checks and variables aren't set.
 
  I do this, like I said before, because the extra 1 billionth of a second
 is
  worth the overhead. I've programmed for sites ranging from a few hundered
  hits
  a day to a few million hits a day and this works ALL the time.
 
  --Joe
 
  On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
   I don't agree with you in here,
  
   you usually know what kind of variable you're checking, so strlen() will
   work just as well as
  
   $var ? 'OK' : 'Empty'
  
   will work or the isset() - common, it was made for checking the
  variables -
   use it.
  
   strlen() is in fact an overhead, why would you allow your design to be
  some
   sort of untraditional? I don't think there's any necessity for it
  
   a "good design" often would be something like this:
  
   $var = 'whatever';
  
   if($var)
 ...do this
   else
 ERROR('no var') // some your func to output the error mess or to
 continue
   with debugging
  
   in most cases it will work better and simpler for you without spending
  these
   bazillions of important for every developer seconds.
  
  
  
   Sincerely,
  
Maxim Maletsky
Founder, Chief Developer
  
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
  
  
  
  
  
   -Original Message-
   From: Joe Stump [mailto:[EMAIL PROTECTED]]
   Sent: Friday, February 23, 2001 3:07 AM
   To: Steve Edberg
   Cc: Jacky@lilst; [EMAIL PROTECTED]
   Subject: Re: [PHP] isset()
  
  
   I stand firm on strlen() for the following reasons ...
  
   if(!$var) will sometimes act strangely (has for me in the past) when
   variables
   are set to something other than what you are expecting.
  
   if(isset($var)) will return true if your text field is declared but not
   filled
   in.
  
   if(empty($var)) will return true if $var is set to 0 (for obvious
 reason)
  so
   is
   only good for certain instances.
  
   strlen() on the other hand converts the variable to a string and returns
 a
   count
   of characters. It's never failed or acted funky. For this reason I use
 it
   religiously.
  
   Others might say "well it's extra overhead" to which I reply "I'll take
 an
   extra
   bazillionth of a second to know for sure I have what I need"
  
   --Joe
  
   On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
I would do this:
   
if (!$AgeChild) $AgeChild = 'NA';
   
More compact, easier to read (to me, anyway). This presumes that a
value of '' (empty string, interpreted by PHP

Re: [PHP] comparing numbers

2001-02-24 Thread Joe Stump

just replace the [] with ()

if($id = 59)
{
  $id = 81;
}

--Joe

On Sat, Feb 24, 2001 at 09:54:08PM -0500, Clayton Dukes wrote:
 
 How can I do something like the following shell script, in PHP? (I know this won't 
work normally, but you get the idea).
 
 if [ $id = 59 ]; then
 $id=81
 
 TIA!
 Clayton Dukes
 

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Unwanted Characters

2001-02-24 Thread Joe Stump

Look at the chr() function - figure out what the character is (number wise) and
then do an ereg_replace(chr(),'',$string) (from the hip - you can do a replace
with chr() on one of the replaces, I've done it before)

--Joe

On Sun, Feb 25, 2001 at 12:34:21AM -0500, Clayton Dukes wrote:
 
 How do I remove unwanted/unprintable characters from a variable?
 
 $sometext = "The car ran over my dog"
 needs to be filtered and reprinted as:
 "The car ran over my dog"
 
 
 
 
 Thanks :-)
 Clayton Dukes
 

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Escaping double quotes?

2001-02-24 Thread Joe Stump

addslashes() usually works for me...

--Joe

On Sun, Feb 25, 2001 at 01:46:30AM -0500, Ben Cheng wrote:
 How do you escape double quotes?  I have the following which is 
 supposed to make any " in a string into \" but it doesn't seem to 
 work.  What's wrong with it?
 
 $tmp_string = str_replace ("\"", "\\\"", $tmp_string);
 
 -Ben
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] isset()

2001-02-25 Thread Joe Stump

 you do not want to use strlen() for the following reasons:
 1) makes code unreadable - very sloppy

Yeah and your if(isset($var)  $var != '') is pretty

 2) overhead

You call one function and do two comparisons - vs an age old C function 
I'd like to run some numbers on that.

 3) it will give a warning when $var is not set (error_reporting 15 
 only).

I run on the default error_reporting setting and it's never complained so far.

--Joe


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

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] crontab help

2001-02-25 Thread Joe Stump

Didn't you just ask this a few days ago?

In your while loop put a sleep(300) which will sleep for 300 seconds after
processing X amount of emails.

--Joe

On Fri, Feb 22, 2002 at 02:53:10PM +0800, Arnold Gamboa wrote:
 hi there.
 
 is there a way to tell crontab to do:
 
 "run script every 5 mins for 1 hour"..
 
 i have this mass email script that is so huge that i need it to chunk into
 records and make sure that it will run every 5 mins for 1 hour.
 
 Thanks for any help.
 

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] isset()

2001-02-25 Thread Joe Stump

empty() fails when $var == 0

--Joe

On Sun, Feb 25, 2001 at 10:50:15AM -0800, Chris Adams wrote:
 On 25 Feb 2001 00:01:30 -0800, Mark Maggelet [EMAIL PROTECTED] wrote:
 On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger 
 ([EMAIL PROTECTED]) wrote:
 On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
  in my preceding email I've written:
 
  if($var!='')
 
  will fix your all your worries without an intervention of a 
 strings
  function.
 
 Except that it will throw a warning in PHP4 if $var is not set.
 = isset () should be used.
 
 man, this is like the thread that will not die. isset() will return 
 true for an empty string, which is not what he wants. the right thing 
 to do is use
 
 if((isset($var))($var!=""))
 
 Isn't this a bit more legible:
 
 if (!empty($var))
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] mySQL table joins are slow, need rebuild?

2001-02-27 Thread Joe Stump

You need to remember a few things when it comes to joins:

the joined fields must be the EXACT same definition
- example: a join on id int(9) and id int(3) will NOT be optimized
- more: a join on id char(9) and id int(9) is REALLY NOT optimized :O)

We have an accounts table with userID as the key char(15) (don't ask, it's an
old design made by a former employee) which has roughly 1.6 million rows in it.
We regularily do joins on it with other tables that have thousands of records
in less than .05 seconds.

This sounds like a table structure problem to me.

--Joe

On Tue, Feb 27, 2001 at 02:21:53PM -0800, Jason wrote:
 hi,
 
 i have a query that is comparing a table with 1235 rows with another that
 has 635 rows. The query looks like this:
 
 $res = mysql_query("select cust_info.ID, cust_info.first_name,
 cust_info.last_name, cust_info.address, cust_info.datestamp from cust_info,
 cust_order_info where cust_info.ID=cust_order_info.cust_id order by
 $mainsort" . $order . ";");
 
 The parse time with the join is 19 seconds. I have to do a join because
 there a different methods that the user must be able to sort by. The parse
 time on the cust_info table alone, with a order by is .95 seconds.
 
 Now, we have a RPM binary of mySQL, and when performing the query, not only
 is it slow, but sometimes will dump its core.
 
 Does anyone see anything wrong with the query, or should we consider
 building the source on our box.. or?
 
 Thanks.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Direction Help!

2001-02-27 Thread Joe Stump

I've, I guess, graduated to more complex PHP programs mainly through projects
at work. I'd challenge myself to do EVERYTHING in PHP. I've created everything
from large scale, targeted, mailing lists to search engines based on DMOZ with
PHP - with great results. 

I suppose the best way to move on to "advanced features" is to challenge 
yourself and have a good understanding of programming concepts, UNIX, and the
various protocols you work with.

Just my $0.02

--Joe

On Tue, Feb 27, 2001 at 04:01:22PM -0700, Web master wrote:
 Hello Php Gurus,
 
 Need help on direction. I am using PHP for a while now, I was able to 
 develop very nice sites using PHP/MySql. Now I very comfortable in using 
 PHP and I want to learn more advanced features of PHP. Can anyone tell 
 me go from here??
 I have used PHP for tradtional query based application so far.
 
 Thanks in advance.
 -Unni
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Double Click

2001-02-27 Thread Joe Stump

Make the id field on the db entry unique - the second query will fail. You 
should also be doing error checking on whether or not the record exists already.

--Joe

On Wed, Feb 28, 2001 at 12:15:38AM -0600, Fabian Fabela wrote:
 Hi,
 
 I have a page, and when I have to add a product I use a form, many people are used 
to make double click in every task, so when the product is sent with a double click 
in the send button, the program send it twice to the data base.
 
 What can I do to prevent this?
 
 Thank you.
 
 Fabian Fabela
 [EMAIL PROTECTED]
 www.vacagorda.com
 

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] How to convert a date to an int?(Need help as soon as possible)

2001-03-02 Thread Joe Stump

Well if you have a consistent format (like Month Day, FullYear) then you could
do this:

  function get_unix_stamp($date)
  {
$months = array('Jan' = 1,'Feb' = 2,
'Mar' = 3,'Apr' = 4,
'May' = 5,'Jun' = 6,
'Jul' = 7,'Aug' = 8,
'Sep' = 9,'Oct' = 10,
'Nov' = 11,'Dec' = 11);
$foo = explode(' ',$date);
$month = $months[$foo[0]];
$day = str_replace(',',$foo[1]);
$year = $foo[2];

return mktime(0,0,0,$month,$day,$year);
  }

--Joe

On Fri, Mar 02, 2001 at 06:58:45PM -0500, Fang Li wrote:
 Hi, All,
 I am stucked here.Would you please help as soon as you can?
 
 LiveDate = "Mar 12,2001"
 
 how to convert it to a int?
 
 mktime(0,0,0,?,?,?)
 Because the LiveDate is changable, I could't put a 3,12,2001 in the mktime.
 
 Thanks a lot.
 
 Fang
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


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




Re: [PHP] Building an array from a URL

2001-04-04 Thread Joe Stump

FYI you can send data like this on the url:

http://www.foo.com/script.php?test[joe]=stumptest[harry]=bartest[jane]=scott

Then $test will be an array that translates to this in PHP:

?

  $test = array(
joe = 'stump',
harry = 'bar',
jane = 'scott');

?

--Joe

On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote:
 Hello,
 
 I'm trying to build an array out of data submitted from a URL.  
 
 Essentially, I want to pull certain records out of a database which have been
 selected on another form.  
 
 The URL presently looks like this:
   superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188
 
 I'd like to take these independent variables and merge them into a single array:
   $array_superRSS = implode (":", $superRSS[]);
 
 So I can then pipe these values directly into another function:
 
 while ($array_superRSS) {
   display_superRSS($array_superRSS[]);
 }
 
 Obviously I'm missing a step or two here, but would really appreciate someone
 filling in some of the gaps.
 
 Thanks!
 
 Mike
 -- 
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://www.aboriginalrightscoalition.ca/
 If a book doesn't make us better, then what on earth is it for? - Alice Walker
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *        Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Monthly Drawing Winner!

2001-04-04 Thread Joe Stump

You have to give the spammers credit - why compile huge lists of people when 
you can just spam precompiled lists (ie the php-general list) and let them do
all the work of distributing the spam. This is a tricky loophole as well - I 
know using relays to distribute spam isn't legal, but what about lists?

--Joe

On Wed, Apr 04, 2001 at 10:04:53AM -0700, Rasmus Lerdorf wrote:
 Done.  Anything from mail.thecasino.com and thecasino.com is now blocked.
 
 -Rasmus
 
 On Wed, 4 Apr 2001, TV Karthick Kumar wrote:
 
  Can't we just get rid of this spam: [EMAIL PROTECTED] and not allow to
  continue.
  I am sure the list master (in php.net) can do it, for the sake of the list.
  Hope he's hearing !.
  It's a requisition.
 
  Thanks in adv.
 
  ~ Karthick
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Monthly Drawing Winner!

2001-04-04 Thread Joe Stump

 - I
 know using relays to distribute spam isn't legal, but what about lists?
 
 Most listsoftware (as far as I know) will allow the admin to block 
 non-members from sending to a list.. Not completely foolproof.. but it can 
 be much help.. certainly if you can add a blacklist to prevent these 
 spammers from coming back..

True, ezmlm (wich kicks ass), allows all of these. I suggest anyone who hasn't
checked out qmail on the list to check it out. It works great with PHP and I've
even made my own mailing list using qmail with PHP :O)

--Joe


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


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] filename into variable.

2001-04-04 Thread Joe Stump

Something like this would work ...

let's say your path is http://www.server.com/images/screenshot_1.php

?

  $junk = explode('/',$REQUEST_URI);
  list(,,$file) = $junk;
  list($picture) = explode('.',$file);

?

That should do it just fine  I might be off on my commas


On Wed, Apr 04, 2001 at 01:26:27PM -0500, Michael Roark wrote:
 How would i go about building a page which could use the name of the page 
 less .php as a variable.
 For example:
 
 Say I have a file called screenshot_1.php and another called 
 screenshot_2.php . Inside each of those files I want to have code which 
 will take the name of the file from the url and assign that value to a 
 variable.  So $picture would get the value screenshot_1 from 
 screenshot_1.php  and so on.
 
 
 
 
 Michael Roark
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Building an array from a URL

2001-04-04 Thread Joe Stump

It works for me in production.

On Wed, Apr 04, 2001 at 08:56:53PM -0400, Mike Gifford wrote:
 I tried this, but it converted [ and ] to url friendly codes.  Does this still
 work?
 
 Mike
 
 Joe Stump wrote:
  FYI you can send data like this on the url:
  
  http://www.foo.com/script.php?test[joe]=stumptest[harry]=bartest[jane]=scott
  
  Then $test will be an array that translates to this in PHP:
  
  ?
  
$test = array(
  joe = 'stump',
  harry = 'bar',
  jane = 'scott');
  
  ?
  
  --Joe
  
  On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote:
   Hello,
  
   I'm trying to build an array out of data submitted from a URL.
  
   Essentially, I want to pull certain records out of a database which have been
   selected on another form.
  
   The URL presently looks like this:
 superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188
  
   I'd like to take these independent variables and merge them into a single array:
 $array_superRSS = implode (":", $superRSS[]);
  
   So I can then pipe these values directly into another function:
  
   while ($array_superRSS) {
 display_superRSS($array_superRSS[]);
   }
  
   Obviously I'm missing a step or two here, but would really appreciate someone
   filling in some of the gaps.
  
   Thanks!
  
   Mike
   --
   Mike Gifford, OpenConcept Consulting, http://openconcept.ca
   Offering everything your organization needs for an effective web site.
   Featured Client: http://www.aboriginalrightscoalition.ca/
   If a book doesn't make us better, then what on earth is it for? - Alice Walker
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
  /**\
   *        Joe Stump - PHP/SQL/HTML Developer  *
   * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
   * "Better to double your money on mediocrity than lose it all on a dream."   *
  \**/
 
 -- 
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://www.aboriginalrightscoalition.ca/
 If a book doesn't make us better, then what on earth is it for? - Alice Walker


/**\
 *        Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Building an array from a URL

2001-04-04 Thread Joe Stump

Ok - say you have this:

$foo = array(
0 = 'joe',
1 = 'stump',
2 = 'there');

while(list($key,$val) = each($foo))
  $args[] = 'array['.$key.']='.$val;

$url = 'http://www.server.com/script.html';
$url .= '?'.implode('',$args);

header("Location: $url");
exit;

That has worked for me before and will most likely work again.

--Joe

On Wed, Apr 04, 2001 at 09:42:20PM -0400, Mike Gifford wrote:
 Hi Joe,
 
 I don't doubt that at all..  However, my strings aren now looking like this.
 
 
http://openconcept.ca/rabble/superRSS.phtml?Title%5B1000%5D=RBC+Dominion+Securities+investigates+URL%5B1000%5D=http%3A%2F%2Fcbc.ca%2Fcgi-bin%2Ftemplates%2Fview.cgi%3F%2Fnews%2F2001%2F04%2F04%2Frbcds_010404Abstract%5B1000%5D=RBC+Dominion+Securities+said+Wednesday+morning+it+is+launching+an++investigation+of+some+suspicious+trading.+%0D%0ATitle%5B1184%5D=Indigenous+Peoples+Critical+of+The+Human+Genome+ProjectURL%5B1184%5D=http%3A%2F%2Fwww.wtowatch.org%2Fwtowatch%2Fnews%2Findex.cfm%3FID%3D2113Abstract%5B1184%5D=aanew_superRSS=new_superRSS
 
 I've got the $Title[1000]=, but it looks like Title%5B1000%5D=
 
 Also, I'm having trouble extracting arrays from arrays..  I just want to insert
 the new values (for articleID 1000, etc.) into a table..
 
 Any suggestions?
 
 Mike
 
 Joe Stump wrote:
  It works for me in production.
  
  On Wed, Apr 04, 2001 at 08:56:53PM -0400, Mike Gifford wrote:
   I tried this, but it converted [ and ] to url friendly codes.  Does this still
   work?
  
   Mike
  
   Joe Stump wrote:
FYI you can send data like this on the url:
   
http://www.foo.com/script.php?test[joe]=stumptest[harry]=bartest[jane]=scott
   
Then $test will be an array that translates to this in PHP:
   
?
   
  $test = array(
        joe = 'stump',
harry = 'bar',
jane = 'scott');
   
?
   
--Joe
   
On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote:
 Hello,

 I'm trying to build an array out of data submitted from a URL.

 Essentially, I want to pull certain records out of a database which have been
 selected on another form.

 The URL presently looks like this:
   
superRSS.phtml?150=1150superRSS166=1166superRSS168=1168superRSS175=1188

 I'd like to take these independent variables and merge them into a single 
array:
   $array_superRSS = implode (":", $superRSS[]);

 So I can then pipe these values directly into another function:

 while ($array_superRSS) {
   display_superRSS($array_superRSS[]);
 }

 Obviously I'm missing a step or two here, but would really appreciate someone
 filling in some of the gaps.

 Thanks!

 Mike
 --
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://www.aboriginalrightscoalition.ca/
 If a book doesn't make us better, then what on earth is it for? - Alice 
Walker

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

/**\
 *        Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   *

\**/
  
   --
   Mike Gifford, OpenConcept Consulting, http://openconcept.ca
   Offering everything your organization needs for an effective web site.
   Featured Client: http://www.aboriginalrightscoalition.ca/
   If a book doesn't make us better, then what on earth is it for? - Alice Walker
  
  /******\
   *Joe Stump - PHP/SQL/HTML Developer  *
   * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
   * "Better to double your money on mediocrity than lose it all on a dream."   *
  \**/
 
 -- 
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://www.aboriginalrightscoalition.ca/
 If a book doesn't make us better, then what on earth is it for? - Alice Walker


/**********\
 *Joe Stump - PHP/SQL/HTML Developer  

Re: [PHP] current location

2001-04-05 Thread Joe Stump

on a unix system type: 

$path = `pwd`;

--Joe

On Thu, Apr 05, 2001 at 04:28:50PM +0800, Paul Juliano wrote:
 Hi,
 
 What's the php function to find out what server a php page is located?
 For example, the php page is at www.myserver.com.  The php page should be able
 to display "Welcome to www.myserver.com".  If the same php page is at
 www.yourserver.com, it should be able to display "Welcome to www.yourserver.com".
 
 __
 www.edsamail.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *        Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] array speed

2001-04-05 Thread Joe Stump

You can do some test with microtime() and see how long it takes. 350 elements
isn't really a large array. I've seen PHP chew through arrays of 250k plus in
only a second or so. It will take longer for 350 elements to be shoved out to
the output buffer than it would to actually loop through it. 

--Joe

On Thu, Apr 05, 2001 at 10:41:10PM +0300, Rouvas Stathis wrote:
 I wouldn't worry about that. Although it all depends by what do you mean
 by "speed":-)
 Anyway, you can always test your page with "ab" (part of the Apache
 installation, at least on Linux)
 -Stathis.
 
 Kurth Bemis wrote:
  
  i'm concerned about the speed at which httpd (with php4.0.1pl1 compiles in
  as a static mod) can "chew" through a 350 element 2d array.  Can anyone
  offer any information?
  
  ~kurth
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/******\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] array speed

2001-04-05 Thread Joe Stump

let me be more clear about the microtime() - do something like:

?

  $start = microtime();
  while(list($key,$val) = each($array))
  {
// do something
  }
  $end = microtime();

  echo "It took ".($end - $start)." microseconds do loop through the array.\n";
?

--Joe

On Thu, Apr 05, 2001 at 02:43:40PM -0500, Joe Stump wrote:
 You can do some test with microtime() and see how long it takes. 350 elements
 isn't really a large array. I've seen PHP chew through arrays of 250k plus in
 only a second or so. It will take longer for 350 elements to be shoved out to
 the output buffer than it would to actually loop through it. 
 
 --Joe
 
 On Thu, Apr 05, 2001 at 10:41:10PM +0300, Rouvas Stathis wrote:
  I wouldn't worry about that. Although it all depends by what do you mean
  by "speed":-)
  Anyway, you can always test your page with "ab" (part of the Apache
  installation, at least on Linux)
  -Stathis.
  
  Kurth Bemis wrote:
   
   i'm concerned about the speed at which httpd (with php4.0.1pl1 compiles in
   as a static mod) can "chew" through a 350 element 2d array.  Can anyone
   offer any information?
   
   ~kurth
   
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 /******\
  *Joe Stump - PHP/SQL/HTML Developer  *
  * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
  * "Better to double your money on mediocrity than lose it all on a dream."   * 
 \**/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**********\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] PHP and CVS

2001-04-05 Thread Joe Stump

This is what we use at work - it's a web frontend to RCS. It works great and 
we have employees all over the country (and world) using it from one location.
It even publishes to the main server via rsync once you want to make your 
changes live (based on web editing ... but would work for other applications)

http://sourceforge.net/projects/publishtron

We just released it open source ... it's hackers only right now, but someone is
working on making it all pretty and easy to install.

--Joe

On Thu, Apr 05, 2001 at 05:17:51PM -0400, ..s.c.o.t.t.. [gts] wrote:
 do any of you know of any nice web-interfaces to CVS
 done in PHP?
 
 since i write code at home and at work, i wanted to maintain
 a single repository for files/code that i frequently use... 
 
 thanks for any suggestions.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Directory(parent) Structure

2001-04-05 Thread Joe Stump

../../../../../../../ - ../n

or 

chdir();

--Joe

On Mon, Apr 02, 2001 at 06:44:30PM -0400, Chris Anderson wrote:
 I know using ../ in a path moves to the parent directory. But is there a way to move 
back farther then that?


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] MySql PHP - Looking for the right command

2001-04-05 Thread Joe Stump

This is how you can do it (just tried it on my news with my news categoryID's)

i'll modify slightly for your purpose with psuedo code ...

SELECT carType,count(carType) FROM cars GROUP BY carType;

--Joe

On Fri, Apr 06, 2001 at 11:28:00AM +1200, YoBro wrote:
 Hello,
 
 I have a site that lists cars in a MySql database.
 I want to display on a page how many makes of each are in the database
 (Under the feild make)
 Like:
 Honda (30)//Then links to the honda page etc
 Toyota (25)
 Ford (7)
 
 Do you know what I mean. I know how to produce results from MySql, but I
 don't know how to get it to count how many hondas, toyotas etc on the same
 page from within the database.
 
 
 help!
 
 --
 Regards,
 
 
 YoBro
 -
 DO NOT REPLY TO THIS VIA EMAIL
 PLEASE USE THE NEWSGROUP
 All emails sent to this address are automatically deleted.
 This is to avoid SPAM!
 -
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Read one word in file

2001-04-05 Thread Joe Stump

This is how I would do it ...

?

  $fp = fopen('/path/to/file','r');
  while(!feof($fp))
  {
$line = trim(fgets($fp,4096));
if(strlen($line))
{
  $arr = explode(' ',$line);
  $numbers[] = $arr[0];
  // if you want to make it remove the .'s then
  // do $numbers[] = str_replace('.','',$arr[0]);
}
  }

  for($i = 0 ; $i  sizeof($numbers) ; ++$i)
echo $numbers[$i]."\n";

?

--Joe

On Thu, Apr 05, 2001 at 04:50:37PM -0700, Andrew V. Romero wrote:
 I have a php script that reads a file that looks something like this:
 
 1.  Question One goes here:
 2.  Question two goes here:
 
 I need someway to have the script just read either the 1. or just the 1
 When I first made the script I just had the program read the line using
 $questionBuffer = fgets($wq, 4096);  and then I got the number by using
 a substring message: $currentQuestion = substr("$questionBuffer",0,1);
 and this works fine until I hit questions like 10 11...
 So how should I go about just getting the question number, ideally I
 would like to just read up until the first space is encountered.   Is
 there a function to do that or will I need to create a for loop that
 goes through and compares each substring of 1 character to " ", and then
 once that " " is found, create a substring up until that " " character
 was found?  Any ideas?
 --Andrew V. Romero
 To reply personally, remove all numbers from my address.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/******\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] better functionality in query ?

2001-04-05 Thread Joe Stump

NOTE(!): LIKE '%foo%' DOES NOT SCALE. It looks like you are making a phone book,
which could get to be a lot of numbers. On the other hand 'foo%' oddly scales to
hundreds of thousands of records without any problems (make sure it's key'd!).

Which should work fine in your instance - just have people type in the first
4 letters of the persons name.

--Joe

On Thu, Apr 05, 2001 at 04:51:47PM -0700, Jerry Lake wrote:
 Damn, if I'd a known it was that easy ;)
 Thanks for the help, works great now.
 
 Jerry Lake- [EMAIL PROTECTED]
 Web Designer
 Europa Communications - http://www.europa.com
 Pacifier Online   - http://www.pacifier.com
 
 
 -Original Message-
 From: Jason Lotito [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 05, 2001 7:09 PM
 To: Jerry Lake; [EMAIL PROTECTED]
 Subject: RE: [PHP] better functionality in query ?
 
 
 
  I'm in process of creating a online whitepages directory for
  a small town phone company and I am having a little difficulty
  in refining my selection. My search form has two fields; last
  and first name. I would like to be able to have more of a wild
  card approach and some refinement when a user enters both a
  first and last name. I am unsure how to go about this, should
  I restructure my query, or make changes to my PHP. here is the
  query I am currently using. and the site is located at
  http://whitepages.maadtelco.com/ any assistance/direction is certainly
  appreciated.
 
  snip
  $query = "select * from whitepages WHERE last_name LIKE '$last_name' ORDER
  BY last_name" or die("Nothing to see here");
  /snip
 
 
 $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' ORDER
 BY last_name" or die("Nothing to see here");
 
 Question, why are you 'die'ing on a variable assigntment? Wouldn't you want
 to 'die' on the actualy db_query()?
 
 Note the added '%', this is assuming you are using MySQL, though they are
 generally the same, I believe, with other DB's.  The % is essentially
 wildcard of any amount.  So, if the last_name was BOB
 
 it would find
 
 BOBBY
 BOBBER
 ADOBOB
 
 $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%'
 $andor first_name LIKE '%$first_name' ORDER
 BY last_name" or die("Nothing to see here");
 
 In this query, we are including the First Name.  In this, we are also using
 the $andor variable, which you can define as AND, or OR, or allow the user
 to define it by using a radio box or the like when making the search.  I
 suggest setting a default of OR for the variable $andor.
 
 Jason Lotito
 www.NewbieNetwork.net
 Where those who can, teach;
 and those who can, learn.
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**********\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] drop-down menu variables

2001-04-05 Thread Joe Stump

You should all check out libHTMLForm at http://www.nirvani.net/software - it
has all sorts of functions for writing HTML forms easily and painlessly. I use
it all the time now (shameless plug - my roommate wrote it a while back).

--Joe

On Fri, Apr 06, 2001 at 02:35:11AM +0200, Richard wrote:
 You must set:
 
 optionsome text/option
 
 
 if it's a SELECT list. Use input type="select" value="DEFAULT TEXT GOES
 HERE" to set an initialized text.
 
 Use .VALUE to check if it's empty or not... But beware, sometimes it forgets
 the contents... If you would use the JavaScript "alert(text)" function...
 
 
 - Richard
 ""Joao Monteiro"" [EMAIL PROTECTED] wrote in message
 9aahf3$bph$[EMAIL PROTECTED]">news:9aahf3$bph$[EMAIL PROTECTED]...
  when i edit variables with a form the ones wich are simple text get
  corrected ok, but the ones chosen from drop-down menus only get added to
  existing variables...
  what am i doing wrong?
 
  Thanx
 
  Joao Monteiro
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/******\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Array problem

2001-04-06 Thread Joe Stump

This would work ...

?

  $arrA = array(1,2,3,4,5,6);
  $arrB = array(9,8,7,6,5);

  // pick an arbitrary one to start with ...
  for($i = 0 ; $i = sizeof($arrB) ; ++$i)
if(!in_array($arrB[$i],$arrA))
  $arrA[] = $arrB[$i];

?


--Joe


On Fri, Apr 06, 2001 at 09:19:52AM +0100, Alexis Antonakis wrote:
 Hi,
 
 I am having big problems with merging two arrays. I just can't seem to get
 my head around it.
 
 I have two arrays which I wish to merge, but I want to EXCLUDE duplicate
 values.
 
 Any suggestions, as my numerous attempts have proved unsuccessful.
 
 BTW I'm using PHP4.
 
 Many thanks
 Alexis
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Date formatting

2001-04-06 Thread Joe Stump

You need a UNIX timestamp for the second argument in date() - thus you need
to first convert your $even into a timestamp (number of seconds past 1970).

?
  $event = '2001-03-15 24:03:34';
  list($date,$time) = explode(' ',$event);
  list($year,$month,$day) = explode('-',$date);
  list($hour,$min,$sec) = explode(':',$time);

  $foo = mktime($hour,$min,$sec,$month,$day,$year)."\n";
  echo date("D j M",$foo);

?

That would work ...

--Joe

On Fri, Apr 06, 2001 at 01:13:59PM +0100, Matt Davis wrote:
 Hi I am trying to format a date extracted from my DB. I have run my query
 and then have used the following to get my row data
 
   while ($row = mysql_fetch_array($sql_result)) {
  $title = $row["message_title"];
  $message = $row["message"];
  $event = $row["date_of_event"];
 
  $shortevent = date ("D j M", $event);
 
 I am trying to take $event and make it diplay like this "FRI 06 APR" using
 the date function. Although $event outputs like this "2001-04-06 00:00:00"
 $shortevent outputs "Thu 1 Jan" which is unix epoch date.
 
 Does anybody know what I am doiing wrong its probably something really
 simple but I cant see what.
 
 Matt.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/******\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Nested for() loops?

2001-04-06 Thread Joe Stump

A copy and paste into foo.php and then a php -q foo.php yielded results for
me.

--Joe

On Fri, Apr 06, 2001 at 10:44:59AM -0600, [EMAIL PROTECTED] wrote:
 Howdy Y'all!
 
 I'm trying to figure out why I'm having so much difficulty with
 nested for loops.
 
 As a test, I did this and it doesn't work. The script simply doesn't 
 give any output.
 
 ?
  error_reporting(E_ALL);
 
  for( $i=0; $i10; $i++ )
   for( $j=0; $j10; $j++ )
   {
 $res = $i * $j;
 print(" result = $res br");
   }
 ?
 
 If I remove the inner loop then it works fine but that's useless.
 
 I am hoping to figure out how to make this work since I need to 
 populate a 2 dimensional array with results from multiple database
 queries.
 
 Any ideas? Anything obviously wrong?
 
 Thanks in advance!
 John
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *        Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Nested for() loops? - Now Multi Dimension Arrays

2001-04-06 Thread Joe Stump

You just do something like this:

?

  $arr = array(0,23,4,2,1);
  for($i = 0 ; $i  10 ; ++$i)
$arrB[] = $arr;
 
  while(list(,$my_array) = each($arrB))
while(list($key,$val) = each($my_array))
  echo $key.' - '.$val."\n";

?

Just throw arrays into arrays :O)

--Joe

On Fri, Apr 06, 2001 at 11:18:19AM -0600, [EMAIL PROTECTED] wrote:
 
 
 Joe Stump wrote:
  
  A copy and paste into foo.php and then a php -q foo.php yielded results for
  me.
 
 Yeah, it's giving me results too today. I don't know what went wrong
 yesterday.
 
 To extend my question, I'm trying to work with multidimensional arrays.
 
 For example, I would like to do this:
 
 ?
  error_reporting(E_ALL);
 
  $target_array = array();
 
  echo "starting br";
 
   for( $i=0; $i5; $i++ )
for( $j=0; $j5; $j++ )
{
  $res = $i * $j;
  $target_array[$i][$j] = $res;
  print("result = $target_array[$i][$j] br");
}
   echo "done";
 ?
 
 And this is my result today:
 starting 
 result = Array[0] 
 result = Array[1] 
 result = Array[2] 
 result = Array[3] 
 result = Array[4] 
 result = Array[0] 
 result = Array[1] 
 result = Array[2] 
 result = Array[3] 
 result = Array[4] 
 result = Array[0] 
 result = Array[1] 
 result = Array[2] 
 result = Array[3] 
 result = Array[4] 
 result = Array[0] 
 result = Array[1] 
 result = Array[2] 
 result = Array[3] 
 result = Array[4] 
 result = Array[0] 
 result = Array[1] 
 result = Array[2] 
 result = Array[3] 
 result = Array[4] 
 done 
 
 My thinking is that PHP ought to be like C when doing simple stuff like
 this.
 I must have something wrong with the declaration of the array. 
 
 How do you declare a multidimensional array??!!??
 How do you work with it then???
 
 Thanks in advance!!
 
 John


/**********\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Print or Echo.

2001-04-06 Thread Joe Stump

 Than why the two different commands? 

Simple - some people come from C which uses print ... others come from languages
that use echo. It fosters adaptation by other programmers.

--Joe


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


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] lowest number in field

2001-04-07 Thread Joe Stump

SELECT * FROM table ORDER BY number LIMIT 1

--Joe

On Sat, Apr 07, 2001 at 05:36:04PM +0100, george wrote:
 
  Is it possible to be able to query the DB find the lowest numebr in the
 table and then display it on the page.
 
 
 TIA
 George
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] getting commandline ?

2001-04-08 Thread Joe Stump

$argv and $argc - also put #!/usr/local/bin/php -q at the top of your script
(above the top ?) and then chmod +x it to run it like a regular script.

--Joe

On Sun, Apr 08, 2001 at 11:13:34PM +0200, NoSpeed wrote:
 Hi
 
 I want to write a small application that will change something in databases
 on various locations.
 
 I can do this in Perl, but being used to the grace and simpleness of doing
 DB's with PHP, DB's with Perl became a real super drag :
 
 So what i would like to know is the following.
 
 I know you can make a php executable and let it function as a script.
 (by adding the correct shebang)
 
 But how can i make commandline parameters visible in the php script ?
 
 lets say we have this :
 
 $
 /usr/bin/changeinfo.php -database=test -table=testtable -row=changethis -dat
 a=replaceforthis.
 
 How can i get these parameters in the script so i can work with them ?
 
 Thanks
 
 --
 - NoSpeed
 --
 - Carpe Noctem
 
 "The stickers on the side of the box said "Supported Platforms: Windows 98,
 Windows NT 4.0, Windows 2000 or better", so clearly Linux was a supported
 platform."
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *        Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] anything wrong with php.net?

2001-04-08 Thread Joe Stump

I'm on it right now.

--Joe

On Sun, Apr 08, 2001 at 09:02:54PM -0300, Christian Dechery wrote:
 Is there anything wrong with www.php.net?
 
 I can't access it for two days now...
 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Row colors

2001-04-08 Thread Joe Stump

tr bgcolor="? $cell_color; ?"

--Joe

On Mon, Apr 09, 2001 at 12:08:10AM +, Mike P wrote:
 I can change the column sof a table with the following code but how do I 
 change the row colors instead.With the columns I have "i" to manipulate but 
 not with rows.
 
 while ($row = mysql_fetch_row($result))
 {{
   echo "TR\n";
   for ($i =1;$imysql_num_fields($result);$i++)
   {$cell_color = "#C0C0C0";
   $i % 2  ? 0: $cell_color = "#CC";
   echo "td bgcolor=\"$cell_color\"$row[$i]/td";
 Thanks 
 Mike P
 [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/******\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] Inputing data to a relational database

2001-04-08 Thread Joe Stump

www.mysql.com - Documentation - is you know how to insert data using SQL 
already then just make the PHP script.

--Joe

On Mon, Apr 09, 2001 at 01:11:57AM +0100, Nathan Roberts wrote:
 I am a nebie to Mysql/php and am currently working on an urgent project, a
 on-line catalogue. I have been using phpmyadmin, to create the tables in
 MySQL. However I now want to add data into the tables. I am reluctant to
 program a php page to do this, as I do not (yet) have sufficient php
 knowledge. As far as I can see phpMyadmin doesn't do all I need it to, which
 is:-
 
 The tables reference each other, for example
 
 The categories are stored in a categories table
 The products table includes a field category
 
 to ensure referential integrity, when adding a product to the products
 table, I want to have a combo box that will let me select one of the
 categories from the categories table.
 
 Is there anything like phpmyadmin that will let me do this without me having
 to write code.
 
 Any advice much appreciated
 
 Nathan Roberts
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] parse error

2001-04-08 Thread Joe Stump

Worked for me, but I had to make sure that $messagearray was in fact an array.
So wrap that block of code in this:

  if(is_array($messagearray)  sizeof($messagearray))
  {


  }

--Joe

On Mon, Apr 09, 2001 at 01:13:00AM +0100, kenny.hibs wrote:
 I am getting a parse error in the following line of code
 
 **
 foreach ($messagearray as $value) {
   //print("strlen:  " . strlen($value));
   if (strlen($value) = 22) {
   ?
   script
alert('Your post is too long...use the forum for longer stories.')
   /script
 
?
 $message="";
break;
   }
  }
 *
 can anyone see whats causing the problem
 
 kenny
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *        Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




Re: [PHP] uninstalling PHP4

2001-04-08 Thread Joe Stump

I think the more important question is:

Why would you want to uninstall it?

;o)

--Joe

On Sun, Apr 08, 2001 at 08:40:57PM -0400, David Loszewski wrote:
 how do I tell?
 
 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, April 08, 2001 8:32 PM
 To: David Loszewski
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] uninstalling PHP4
 
 
  I just uninstalled MySQL, now how do i uninstall PHP4, I installed it from
 a
  .tar file.
 
 Just remove the LoadModule line from your httpd.conf assuming you built
 PHP as a DSO.  If you compiled it into your Apache as a static module you
 will need to recompile Apache.
 
 -Rasmus
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


/**\
 *Joe Stump - PHP/SQL/HTML Developer  *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\**/

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




  1   2   >