RE: [PHP] key pairs

2002-12-17 Thread Cal Evans
Possible but a single table with all addresses and an addressType (SHIP_TO
or BILL_TO) linked back to the main order table will allow you to retrieve
both addresses with a single select:

select * from address where orderID=x

=C=


*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Brad Bonkoski [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 3:50 PM
To: 1LT John W. Holmes
Cc: [EMAIL PROTECTED]; PHP-General List
Subject: Re: [PHP] key pairs


What about a master table like:

Order ID | Ship_TO | BILL_TO

Then an address table:
ID | NAME | ADDR | CITY | STATE | ZIP

Then you could have many addresses, and IFFthe Bill to and Ship to were the
same
then the master table would reflect that.  Many sites provide a check box to
indicate that the Bill to and Ship to are the same, which you would key off
of
and if so, assign the same Unique Address ID to both fields in the master
table.  Many ways to do this, but those are my thoughts

-Brad

"1LT John W. Holmes" wrote:

> > >Hopefully the other solution worked for how to parse the data. If not,
> post
> > >back. What I wanted to comment on is why would you use two tables, one
> for
> > >SHIP_TO and one for BILL_TO? Why not just add a column to one table set
> set
> > >it to BILL or SHIP. You won't be repeating data that way and it'll be
> easier
> > >to find things overall. Plus you can just have a column that flags
> whether
> > >the SHIP_TO and BILL_TO addresses are the same.
> > >
> > >
> > I haven't gotten that far yet.  BILL_TO and SHIP_TO aren't always
> > the same people, hence my initial thought of creating two tables and
> > keep things separate.  However, you're right, I could dump it all into
> > one table - if they're different, then populate the rest of the fields,
> > if not, don't bother.
>
> What I was thinking is that you have one table with
>
> Order_ID
> Name
> Address
> Flag -> Here you flag this as SHIP_TO or BILL_TO
> etc...
>
> Your order_ID could be a key, but it will not be unique, since if the
> bill_to and ship_to address are different, the order_id will appear in the
> table twice. So an order with different shipping and billing addresses
would
> have two rows in the table. An order where they are the same would only
have
> one row.
>
> That layout would be better than:
>
> Order_ID
> Ship_name
> Ship_address
> Bill_name
> Bill_address
> etc...
>
> Which is what I got from you last email.
>
> Does anyone agree?
>
> ---John Holmes...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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



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




RE: [PHP] Media library

2002-12-18 Thread Cal Evans
since you've not indicated that you've looked around and not found one, I
suggest starting your search at www.freshmeat.net.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: GWAD Mailinglist [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 8:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Media library


Hi!

I'm looking a (good) PHP source for media library

reg (eg.).

- user authentication
- user groups
- store pictures / video / audio (database or file)
- easy upload
- php / mysql / apache

and maybe

- simple picture edit, video / audio edit??

Anyone to know something good source?




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



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




RE: [PHP] forms

2003-01-13 Thread Cal Evans
yes but it's more of an HTML/JavaScript thing.

use INPUT Type='BUTTON' to put a second button on your form.  Then use the
onClick method to assign an action to it.  If you want it to submit your
form then call document.formName.submit();

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: cj [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 7:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] forms


G'day All
Just a quick question
This is really a html more than a php question.

Is it possible to have two buttons and have different actions for each
button in the same form?

Thanks
CJ





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



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




RE: [PHP] x12 837

2003-01-16 Thread Cal Evans
I've created an 850 and a base class x12. It's not terribly hard. I did not
find much in the way of useful classes already built though.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 3:39 PM
To: Php-General@Lists. Php. Net
Subject: [PHP] x12 837


Ok, I know this is a longshot but does anyone on this list work in the
healthcare industry and have created an 837 with php?  I am thinking of
attempting to create one in php and didn't want to reinvent the wheel.

Thanks,
Eddie


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



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




RE: [PHP] x12 837

2003-01-16 Thread Cal Evans
yea, mine is all array based.  I pull the data from a FoxPro table via XML
(and jump through several hoops.)  Then I have a main loop that spins
through the data (which is ordered) and

* creates a new PO if the PO number has changes (PO Object)
* Create a PoLineItem for each line in the PO (POLineItemObject)
* repeat.

* PO's own POLineItems
* All PO's are owned by the X12_850 object.

Once everything is nicely sliced and diced into objects I call
X12_850->generateX12(). This spits out all the necessary headers and then
calls generateX12() on each PO. Each PO spits out all the necessary headers
and then calls generateX12() on each POLine Item.  Then it spits out the
necessary trailers and bumps control back up the line.

Once it's finished, I have a (honkin' big) string that represents the 850
document. Currently, I dump this out to a file for ftping but you could just
as easily use CURL to call a SOAP process somewhere if your X12 partner had
a brain. (mine does not, the company I was a consultant for in the medical
insurance industry did not either)

Anyhow, I'm happy to share what I know if you have questions.

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
* http://www.calevans.com
*


-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 3:55 PM
To: Php-General@Lists. Php. Net
Subject: RE: [PHP] x12 837


Cal,

You used php for this?  I am pretty sure that an 850 is on our list of
things to do somewhere.

Eddie

-Original Message-
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 4:22 PM
To: Edward Peloke; Php-General@Lists. Php. Net
Subject: RE: [PHP] x12 837


I've created an 850 and a base class x12. It's not terribly hard. I did not
find much in the way of useful classes already built though.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 3:39 PM
To: Php-General@Lists. Php. Net
Subject: [PHP] x12 837


Ok, I know this is a longshot but does anyone on this list work in the
healthcare industry and have created an 837 with php?  I am thinking of
attempting to create one in php and didn't want to reinvent the wheel.

Thanks,
Eddie


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



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



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



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




RE: [PHP] More OOP

2003-01-16 Thread Cal Evans
personally, I would ditch the Error class and put raise_error in Base.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Jordan Elver [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 3:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] More OOP


Hi guys,
After your previous advice. I have been looking at some more OOP for my
application. Is this the sort of way a proper OOP application should be
constructed?

I want to use smarty as my template language as well, how could I integrate
that?

";

// get connections details
list($host, $username, $password, $type) = $details;

// connect to the database
if($connection = mysql_connect($host, $username, $password)) {

$this->raise_error();
}
}
}

class Login extends Database {

function Login() {

echo "Hello, I'm the Login class";

// connect to the database
$this->connect();
}
}

$c = new Database;
$c->connect();

Any pointers would be great :)

Cheers,
Jord
--
Jordan Elver
You don't have to be mad to work here, but you do have to be on time, well
presented, a team player, customer service focused and sober!! -- David
Brent
(The Office)


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



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




RE: [PHP] Result in the same page

2003-01-18 Thread Cal Evans
Yes, just user $_SERVER['PHP_SELF'] as the action of your form. This will
cause the page to call itself. Then you can branch your processing on the
existence of a SUBMIT button (or whatever) and handle the query.

I do all my pages this way because it keeps all the code in a single page.
It's easier for me to find it that way.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Ezequiel Sapoznik [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 6:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Result in the same page


It is possible to run a query in php when the user press a button an return
the result in the same page?

Thanks!

Ezequiel



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



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




RE: [PHP] Ever complained about lousy PHP programmers?

2003-01-18 Thread Cal Evans
Since no one else has asked, I'll bite.  Why not just use str_rot13()?


The biggest problem I have with your code is that you didn't learn enough
about the language to know that this was already in the code. As a newb, you
need to set down with your favorite version of the manual (I keep the
windows help version open at all times) and familiarize yourself with the
language.  You do not need to memorize each function' signature but it would
help if you read the description of each function.  You'll be surprised what
you find in there.


=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Peter Hutnick [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 10:40 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Ever complained about lousy PHP programmers?


Well, here's your chance to criticize a newbie.

As an exercise in learning PHP I have written a rot-13 script.  It is at
http://hutnick.com/rot13/index.html?show_content=1 .

I'm soliciting comments on style, technique, etc.  Be brutal, but don't
get your feelings hurt if I don't take your comments as gospel.
References will help me take comments to heart.

It will be easier on me if you send or CC comments to [EMAIL PROTECTED]

Thanks a million!

-Peter



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



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




RE: [PHP] Select multiple boxes

2003-01-18 Thread Cal Evans
use [] in your select box name. When it comes back in the $_POST array you
will have an array of options.  It breaks HTML standard therefore it is a
Bad Thing (tm) but it does work.


Don't pick me
Pick me


Selecting both results in:

$_POST['mySelect'][1] == "Don't pick me"
$_POST['mySelect'][2] == "Pick me"

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Select multiple boxes


Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



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



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




RE: [PHP] Select multiple boxes

2003-01-18 Thread Cal Evans
whoops. Sorry, didn't read the question. Wrong answer. John gave the correct
answer.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 8:41 AM
To: Gregory Chagnon; [EMAIL PROTECTED]
Subject: RE: [PHP] Select multiple boxes


use [] in your select box name. When it comes back in the $_POST array you
will have an array of options.  It breaks HTML standard therefore it is a
Bad Thing (tm) but it does work.


Don't pick me
Pick me


Selecting both results in:

$_POST['mySelect'][1] == "Don't pick me"
$_POST['mySelect'][2] == "Pick me"

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Select multiple boxes


Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



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



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



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




RE: [PHP] Select multiple boxes

2003-01-18 Thread Cal Evans
What you are describing is a "2 List Mover". PHP is a server-side language
and as such knows nothing about what is going on on the client. Therefore
you have limited options. My favorite is :

In your form's onSubmit() put code to load all the values into a hidden
field. (Assuming you have defined the hidden field)



in your JavaScript put things like

document.mainForm.storeStuffHere.value += "storeStuffHere[1]='Value1'";
document.mainForm.storeStuffHere.value += "storeStuffHere[2]='Value2'";
document.mainForm.storeStuffHere.value += "storeStuffHere[3]='Value3'";

Then, when the form is submitted use:

parse_str($_POST['storeStuffHere']);

This will create the array storeStuffHere with the 3 values.

HTH,
=C=
*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 9:31 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Select multiple boxes


The problem is I have 2 seelect boxes...it's for creating a user and adding
them to a list of available groups...so I have one select box that is
initially empty called memberOf and another box that has all of the
available groups listed in it called availableGroups.  I have a script that
can move items back and forth and when the form is submitted I want to be
able to get all the items that are in the memberOf box..anyh ideas on how to
to this?  THanks.
-Greg


"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
000501c2bf01$46464cc0$7c02a8c0@coconut">news:000501c2bf01$46464cc0$7c02a8c0@coconut...
> > Is there any way to get all of the elements in a SELECT MULTIPLE box,
> not
> > just the ones that are selected?  Thanks!
>
> No. You create the box, so you should know all of the possible values.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>



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



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




RE: [PHP] 2 Qs: Passing current URL with session and how to avoid session timeout???

2003-01-18 Thread Cal Evans
I guess I'm dense this morning. In response to 1:

$_SESSION['mother']=$_SERVER['PHP_SELF'];

and then

Go Back

or better yet...
Go Back

as to #2:
I usually just pass this kind of info around on the URL.

http://mypage.com/mypage.php?prevURL=http://mypage.com/lastpage.php

if I have to pass a full query string then I urlencode() it first and
urldecode() it on the other side.

This survives sessions expiring.
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: -<[ Rene Brehmer ]>- [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 10:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] 2 Qs: Passing current URL with session and how to avoid
session timeout???


Hi gang

Been trying to figure out this session stuff, but since I was unable to
make the manual sample into something workable, I instead decided to
actually try and make the session do what I need it for: Passing the URL
of the caller page to the page that's being called.

1. Only I can't figure out if there's a function to just pull the current
URL and plop it into a session variable. The thing is that these pages are
all built by using a bunch of GET variables in the URL, so it would be
easiest to just do something like:

  $_SESSION['mother'] = $currentURL;

And then in the called, daughter, page do this:

>Get back to where you
came from

As the only other way I've found is to have it use the string-functions
and re-build the current URL throughout the if-tree that builds the page.
I need to pass the mother URL to the daughter pages because there's two
main entry-points into the daugther pages, and one of them can have 10-15
different states...

But how do you pull the current url? ParseURL just smacks it into an
array, and I'll then have to rebuild it anyway ... which makes it about
just as simple as running it through the if-tree. Whether or not the
session-id is inside the URL is not essential to me, but dunno if php
cares about it.

2. Since the above is required to function at all times, I need to
override the expiration time. I can't do it in the ini file, 'cause I
can't modify the server where it's to run, and it's set to 0 there... (not
sure if that means it expires right away, or not at all)

Anyway to do this???

TIA

Rene
--
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



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




RE: [PHP] Can I use php to load a icon?????(.ico .exe .....)

2003-01-18 Thread Cal Evans
exactly how do you "load" an icon?  What are you loading it into?

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*
 

-Original Message-
From: hei [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 3:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Can I use php to load a icon?(.ico .exe .)


Can I use php to load a icon?(.ico .exe .)



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



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




RE: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Cal Evans
Scott,

Because "8" != 8. "8" (and "08") is a string with the numerals representing
the number eight. It is not the number eight. (think back to basic math, the
difference between a number and a numeral)

PHP does some conversions for you automatically but that just saves you from
yourself. (Personally, I wish it wouldn't. People have more trouble
*because* of the automatic conversions than they would if they had to do the
converting themselves.)

To keep from running into this simply do the conversions yourself before you
do comparisons.

intval("08")==8

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 2:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Found a PHP bug!


I don't see why a string wouldn't work when I use "08" (string) and match it
against the integer 8, or 08.


"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
>
> > -Original Message-
> > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> >
> > Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> > struggling with
> > why PHP code failed to work with the month is August or
> > September
>
> I stumbled into this one a short while ago myself. It is not a bug, but a
> feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP interprets
> them as octal numbers (because of the leading 0). However, 08 and 09 are
> invalid octal numbers, so PHP converts them to zero.
>
> The fixes are numerous:
>  - remove the leading zero;
>  - add zero to them before passing (addition forces a type conversion to
> int);
>  - force a type conversion to integer using (int);
>  - quote them (when PHP converts a string to an integer, it removes the
> leading zero);
>
> Kirk



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



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




RE: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Cal Evans
John.

> Actually, "08" is equal to 8 in PHP. PHP will convert the string to an
>integer and the two will compare as equal.

No they are not equal. Yes, PHP will do the conversion so that they are
equal. That does not refute the fact that logically '08' != 8.


> Someone already posted why the problem was happening, because the numbers
> were being converted to invalid octal numbers and being set to zero.

I understand the problem at hand. (and did when I posted) However, if Scott
had been doing the conversions manually, he would never have run across this
problem.  It is a bad idea to rely on the language (whatever the language)
to do automatic variable conversions.

=C=


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




RE: [PHP] if (a == b) ...

2003-01-29 Thread Cal Evans
Stephen,

"Friday August 22" evaluates to the number 0. (check the docs for intval())
Therefore the condition would be true.

I stated in an earlier thread this week. It is bad for to allow PHP todo
your conversions for you.  At the least it's lazy, at the most it will cause
unpredictable results. (as is your case below.)

If you really MUST compare a string and a number, do an explicit cast first.

if ($a==intval("Friday August 22"))
or
if (strval($a)=="Friday August 22")

In both cases above, since we are explicitly casting, it is easy to predict
the results and explain them.

(In the above, the first should be true and the second should be false.)

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Webapprentice [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 7:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] if (a == b) ...


Hi,
I have a conditional:
if (a == b)

a is the number 0, but b is a string "Friday August 22".

The condition is evaluating as true, which is not what I want.
What am I misunderstanding?

Thanks,
Stephen




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



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




RE: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

2003-02-13 Thread Cal Evans
Hey Vern,

PHP does not think you have the MySQL module installed. none of the mysql_*
commands are going to work. check the output of phpinfo() to verify. What
version of PHP are you running? Since you are using RPMs the only (helpful)
advice I can give is try re-installing the PHP rpm. Possibly it needs to
refresh itself. (I can offer some unhelpful advice like quit using RPMs and
compile from source...switch to gentoo linux instead of RedHat for a better
package manager...you know, stuff like that. But that's not helpful at the
moment!)  :)

=C=


* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com


-Original Message-
From: Vernon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 6:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2


After upgrading to MySQL 4.0.1.2 I ma getting the message :

Fatal error: Call to undefined function: mysql_connect() in
/home/penpals/pub/mysql.php on line 3

Please help my production server is down!



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



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




RE: [PHP] Result in the same page

2003-02-16 Thread Cal Evans
John,

header(location:) is the way I'm doing it. I check for the Submit button, if
it was pressed and the processing succeeded, I redirect.  If processing
fails (validation, error in connecting to the database, etc.) I redisplay
the same page with all the same variables that the user just input.  I give
them a message telling them what went wrong and allow them to fix it.

If you find a better way, please share. It would be nice to have something
like 
=C=


-Original Message-
From: John Hicks [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 15, 2003 11:56 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Result in the same page


Cal--

I just posted this reply to your reply on php.general.

--John


From: [EMAIL PROTECTED] (John Hicks)
Newsgroups: php.general
Subject: Re: [PHP] Result in the same page
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
NNTP-Posting-Host: 68.165.13.138
Message-ID: <[EMAIL PROTECTED]>

I, too, like the idea of keeping my processing code in the same file
as the form being processed. But I'm trying to figure out how to
transfer control to the next page based on the result of the forms
processing.

In JSP, i would use , which is basically a "Go to"
command. The only reference I can find to "transfer of control" in PHP
is the header(location: ) function. But that requires a complete
server/browser/server interchange.

There must be a more direct way to transfer control in PHP. Would
someone please tell me what it is?

Thanks in advance,

Frappy

[EMAIL PROTECTED] (Cal Evans) wrote in message
news:<[EMAIL PROTECTED]>...
> Yes, just user $_SERVER['PHP_SELF'] as the action of your form. This will
> cause the page to call itself. Then you can branch your processing on the
> existence of a SUBMIT button (or whatever) and handle the query.
>
> I do all my pages this way because it keeps all the code in a single page.
> It's easier for me to find it that way.
>
> =C=
>
> *
> * Cal Evans
> * Stay plugged into your audience.
> * http://www.christianperformer.com


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




RE: [PHP] Cannot find php.ini

2003-02-21 Thread Cal Evans
find / -iname php.ini

or create a page with





Untitled









Save it and then call it form your webserver. It'll tell you where the ini
is.

=C=
* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com


-Original Message-
From: Kevin Paz [mailto:[EMAIL PROTECTED]
Sent: Friday, February 21, 2003 1:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Cannot find php.ini



I've taken over a redhat server with apache/php4.1.  I need to enable
register_argc_argv but I can't find the php.ini file (I've searched the
entire system).

Would creating a new php.ini file with only register_argc_argv line work?
Where's the default location for php.ini?


Thanks in advance,

Kevin



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



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



RE: [PHP] browser dialog boxes

2003-02-24 Thread Cal Evans
php=backend
alert boxes=front end

checkout JavaScript. You can use php to dynamically generate JavaScript.

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Sunfire [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 2:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] browser dialog boxes


hi

was just wondering if there is something with php that will let you create a
browser dialog box when someone pushes a submit button or something like
that...

tnx




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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



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



RE: [PHP] general question ?

2003-02-24 Thread Cal Evans



* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Jonas Geiregat [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 3:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP] general question ?


http://kemu.ath.cx/intranet/login.phps
when I press submit everything is OK it works like I want it to work but 
I'm not happy with the result I see in my url window
I see this
http://localhost/intranet/login.php?user=kemu&passwd=test&submit=login
I don't like it that you can know the passwd
is there a way to just make this login.php and not with all the vars I 
send with it


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



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



RE: [PHP] page shown, but browser keeps doing something

2003-02-25 Thread Cal Evans
are you preloading graphics using JavaScript?

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Chris Hayes (SENSE) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 9:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] page shown, but browser keeps doing something


hi list,
i'm working on my local WAMP on a PHP module to fit in a cms, and i fail to
understand what is taking the browser so much time _after_ the page is
completely visible. Statusbar says still loading the page. Javascript links
and the refresh function of the browser are reluctant.

When i stop downloading, and look at the source, the page is in untill the
last tag.


This is what i checked:
* with Phoenix (small version of mozilla) i loked at 'page info': as far as
i can tell all images seem to exist.
* the table and page structure is ok, Dreamweaver has no complaints.
* it happens also when i turn off javascript in the internet explorer, so
it is not a javascript on-the-run.

If i save the entire page to disk and open it as a file:, it is very quick.


Any ideas where to look now?

Chris

PS OT but while i tried to debug this situation, i changed several IE
security settings and options and now it wants to download files from
localhost in stead of show them. it starts asking whether want to open it,
then choice open/save  and then it asks with what i want to open it. Pretty
annoying!


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



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



RE: [PHP] Submit buttons

2003-02-25 Thread Cal Evans
using JavaScript you can use an  and in the onClick call
a function that sets the form's target and then calls
document.formname.submit();

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Greg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 2:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Submit buttons


Is there any way that I can have a form submit to different pages depending
on the submit button that is pressed?  Thanks!



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



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



RE: [PHP] Newbie Question

2003-02-25 Thread Cal Evans
you have 2 functions named DBField.  This was ok until 4.3. After 4.3 you
couldn't re-declare a function like this.

PHP does not allow for overloading like Java and C++ (It looks like that's
what you are trying to do)

Check the docs for overloading.  There is some support for it but it's a bit
of a kludge. (IMHO, etc.)

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 9:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie Question


Can someone explain why this code works on the hosting company's server,
but won't run on my local server? I'm not sure what version is on the
host server, but I'm running 4.0.5 locally on winXP Pro. The error says:
Fatal error: Cannot redeclare dbfield() in
c:\inetpub\wwwroot\livinginnaples\database.php on line 30

7.class DBField
8.{
9.  var $name;
10. var $type;
11. var $table;
12. var $title;
13.
14. var $size;
15. var $rows;
16. var $maxlength;
17. var $value;
18. var $prefix;
19. var $postfix;
20. var $display;
21.
22. function DBField()
23. {
24. $name = "";
25. $table = "";
26.
27. $this->display = true;
28. }
29.
30. function DBField( $name, $table, $size, $value )
31. {
32. if( $size == "" ) $size=20;
33.
$this->display = true;
$this->name = $name;
$this->table = $table;
$this->size = $size;
$this->rows = 5;
$this->value = $value;
$this->title = ucwords( $name );
}

function display()
{
if( !$this->display ) return;

$prefix = str_replace( "[TITLE]", $this->title,
$this->prefix );
echo $prefix;

switch( $this->type )
{
case "blob": ?>
value ?>value != "" ) $time =
strtotime( $this->value );
else $time = strtotime( "now" ); ?>
">/">/">
postfix . "\r\n";
}
}



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



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



RE: [PHP] newbie: installing gd in php4

2003-02-26 Thread Cal Evans
did you bounce the service after uncommenting the line?

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Anthony Ritter [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 10:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] newbie: installing gd in php4


Using MS Win 98 / PHP 4 and Apache.

I tried running the following script but got an undefined call to:

ImageCreate()

The following copy is located in my php.ini file...one of which is:

..
;extension=php_gd.dll
..

I tried uncommenting this line to no avail.

What is the best way to install php_gd.dll so that I can make use of the
image library.
Many thanks.

Tony Ritter



;;
; Dynamic Extensions ;
;;
; if you wish to have an extension loaded automaticly, use the
; following syntax:  extension=modulename.extension
; for example, on windows,
; extension=msql.dll
; or under UNIX,
; extension=msql.so
; Note that it should be the name of the module only, no directory
information
; needs to go here.  Specify the location of the extension with the
extension_dir directive above.


;Windows Extensions
;extension=php_mysql.dll
;extension=php_nsmail.dll
;extension=php_calendar.dll
;extension=php_dbase.dll
;extension=php_filepro.dll
;extension=php_gd.dll
;extension=php_dbm.dll
;extension=php_mssql.dll
;extension=php_zlib.dll
;extension=php_filepro.dll
;extension=php_imap4r2.dll
;extension=php_ldap.dll
;extension=php_crypt.dll
;extension=php_msql2.dll
;extension=php_odbc.dll

--





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



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



RE: [PHP] Newbie look for some content specific tutorials

2003-02-27 Thread Cal Evans
take a look at the database abstraction layer ADODB at php.weblog.com  Even
if you are like me and never use more than just MySQL, it makes like a lot
easier.

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Hunter, Jess [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 2:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie look for some content specific tutorials


Greets all,

First time poster here and a 1 week old PHP/Mysql programmer

I have bought several books and scoured the net for any and all PHP/MySQL
tutorials. Here is the problem I am running into:

1. The docs tell how to access MySql through the MySql monitor
2. any docs that tutor how to make PHP interact with MySql has you doing all
the functions directly on the page
3. All the rest are written like VCR instructions (Mine still blinks
"12:00")

What I am looking for is a tutorial that talks specifically about the
interaction of PHP forms with MySql

I have figured out how to add records using PHP, and have even figured out a
crude search function, but being able to update or delete records are
eluding me.

Does anyone know of a site that has this type of information with some
extremely well commented samples?

Thanks

Jester

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



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



RE: [PHP] crontab

2003-03-04 Thread Cal Evans
1: yes you can.
2: You can use either print or echo. I use echo when I actually want
something output, most of my scripts don't output anything. If there is some
output of import, I use mail() to send it to myself.
3: Yes, I am.

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 2:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] crontab


Can I run a php script in crontab?
Do I echo or print?
Anyone doing it?


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



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



RE: [PHP] crontab

2003-03-04 Thread Cal Evans
I've not seen anything to indicate to me that running php scripts in a cron
job (via php compiled as a CLI) is any less secure than running cron jobs
written in any other language.

All of mine are 700 root, the cron process runs as root and I understand
that. Since I'm the root on the box, it's ok.

PHP does not 'run as root'. The CLI will run as whomever is executing the
script.

My $.02 worth.
=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 3:07 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] crontab


Cal, Liam, Jimmy,
Thanks. If this is a serious security hazard, could you show me some code
that is more secure? I am the "root". Mind you I've never worked with
crontab before. I want to run /var/www/backup_mysql.php I suppose I should
start by putting it somewhere not publicly accessible?

Thanks,
John

Liam Gibbs wrote:

> > Can I run a php script in crontab?
> > Do I echo or print?
> > Anyone doing it?
>
> This is a serious security hazard. However, what you could do is have a
PHP
> page set cron settings (such as name of file, location, frequency, and
> importance), then have another cron job (running at a decent frequency) do
> the organization. However, this is still a security flaw, as hackers can
> just take a look at your cron jobs and get in and run their own in place
of
> yours. Probably no more a flaw than normal, though, as if a hacker can get
> in to replace your cron job, they can get in and run any number of things
> anyway. Make sure to hard code your cron jobs, as having a downloadable
page
> is a bigger security hazard. You don't want the PHP page to do this
itself,
> because it will have to run as root.
>
> I did this one time, and if I'm allowed some time to get my page up, I can
> e-mail you some instructions. What you'll need is a PHP page, a txt file
> (for the settings) and a cron job that will read the file and do the
> necessary steps to arrange the cron jobs itself.


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



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



RE: [PHP] Valid Email Question

2003-03-11 Thread Cal Evans
The only way to do that would be to open a connection to the SMTP server
directly and try and send the email. (Instead of using the mail function)
This way the mail server would give you an error code if it didn't work.

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 8:05 PM
To: PHP List
Subject: [PHP] Valid Email Question


Is there anyway you can email a certain email a user enters, see if it
bounces back, and if it does, tell the user to enter a valid username? I've
always wanted to do this but I'm not sure how to see if it bounces back.

Thanks,
Stephen Craton
http://www.melchior.us


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



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



Re: [PHP] PHP CLI question

2003-06-06 Thread Cal Evans
http://www.php.net/manual/en/function.ini-set.php

* Cal Evans
* http://www.christianperformer.com
* Stay plugged into your audience
* The measure of a programmer is not the number of lines of code he writes
but the number of lines he does not have to write.
*

- Original Message -
From: "Monte Ohrt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 9:22 AM
Subject: [PHP] PHP CLI question


> Hi,
>
> A couple of questions:
>
> 1) Is there a way to make the CLI version of PHP ignore certain settings
> in the php.ini file? For instance, I don't want the ioncube accelerator
> invoked when using PHP from the command line. My current work around is
> to use two separate init files, php.ini and php-cli.ini ... and this
> brings me to my second question:
>
> 2) Is there a way to specify a different name for the php.ini file,
> apart from hacking php_ini.c ? It seems I can only change the _path_ to
> the file, but not the filename itself.
>
> TIA
> Monte
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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



Re: [PHP] Form Generators

2003-05-29 Thread Cal Evans
check www.freshmeat.net. There are several.

=C=
* Cal Evans
* http://www.christianperformer.com
* Stay plugged into your audience
* The measure of a programmer is not the number of lines of code he writes
but the number of lines he does not have to write.
*

- Original Message -
From: "Clint" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 28, 2003 9:59 AM
Subject: [PHP] Form Generators


> Does anyone know of a form generator that will look at a MySQL table and
> generate an add/edit form off of that table?
>
> Thanks,
> Clint
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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



Re: [PHP] Netbilling PHP Script

2003-05-30 Thread Cal Evans
Mike,

I'm glad you vented. Now let me. I say none of this in anger and quite a lot
of it in amusement. Please don't take this the wrong way. (By saying that
I'm insuring that you WILL take it the wrong way!)  :)

Why is it helpful to give a person the answer to a question that has been
answered before?  Why is it not more helpful to show them how to find the
answer to their question and possibly to the next one...and the net
one...and the next one. All of us at one point or another have gotten mad
because they've been told to RTFM. (UTFG, UTFW, etc.) But the fact of the
matter is if you get told that a couple of time, you may actually start
doing it.  Jason's search google answer is very appropriate for many
questions asked on this list.

The people who answer questions here do it of their own free will, for no
pay, and in the case of independent consultants, at the expense of their
paying work. (Those of you who are employed and posting from work are just
slacking!)  :) Therefore, it is their right to answer in the way that they
feel most helpful. If RTFM is the quickest way to get a newb to start
reading the manual instead of asking (yet again) how the mail() function
works then that's what will be posted.

Telling people like Jason off as you have done feels really good. But at
some point Jason will decide that it's no longer worth while to bother to
read this list and drop. Then you can tell off someone else who knows what
they are talking about because they don't follow your rules of
etiquette...and maybe they will leave.  At some point, you will  find
yourself in the list all by yourself. (except for the newb over in the
corner still twiddling with the mail() function)

It boils down to this. mailing lists have been around longer than you or I
have been on the Internet. (Unless you are Vint Cerf and if you are I HUMBLY
apologize and bow at your feet!) The rules of mailinglist etiquette
(especially for technical lists, which this is) have matured over the years
and are not really up for discussion. If you don't like them, go elsewhere,
start your own list. Otherwise, play nice.

most humbly,
=C=


- Original Message -
From: "Mike Morton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 8:49 AM
Subject: Re: [PHP] Netbilling PHP Script


> I have to get this off my chest, and I tried to send it directly to Jason
> off list, but the email bounces back.  Why?  Probably because he gets a
lot
> of these emails.  Don't like what I have to say?  Tough luck, I am sick of
> unconstructive emails hitting the list putting people down.  If you cannot
> or will not answer someone, just don't answer them at all.  Be helpful,
not
> hurtful.  Oops, should take my own advice and not post this at all, but I
> need to get it off my chest, I am sure that I am not the only one thinking
> it:
>
> Jason:
>
> Why do you bother to answer on the php list at all?  90% of the messages
> from you are 'search google'  if you do not have constructive info to
offer,
> why bother to answer at all.  I am directing this to you because the list
> does not need to see my crap about it, but it just makes me sick to see
you
> over and over putting people down who are just asking for help.
>
> Really, I have been a member of MANY lists over the years, and I truly
have
> never seen anyone as negative as you.  If you do not have a useful answer
to
> the question just don't answer- you clutter the list and my inbox.
>
> And no, 'search google' is not a good answer - at the best of times it is
> tough to wade through all the crap that google spits at you, at the worst
of
> times, most people do not even know what to search for to narrow it down!
> Never mind searching the list archive - half the time all I get back is
your
> emails saying 'search google'!
>
> Geeze, look what you have made me do, get pissed of and waste my time
> flaming you. What a waste of our time.
>
>
> On 5/29/03 5:43 AM, "Jason Wong" <[EMAIL PROTECTED]> wrote:
>
> > On Thursday 29 May 2003 17:36, Ralph wrote:
> >> I have to setup credit card verification/processing with
Netbilling.com,
> >> does anybody know of a PHP based Netbilling gateway script or class?
> >
> > Have you searched google?
>
> --
> Cheers
>
> Mike Morton
>
> 
> *
> * Tel: 905-465-1263
> * Email: [EMAIL PROTECTED]
> *
> 
>
> "Indeed, it would not be an exaggeration to describe the history of the
> computer industry for the past decade as a massive effort to keep up with
> Apple."
> - Byte Magazine
>
> Given infinite time, 100 monkeys could type out the complete works of
> Shakespeare. Win 98 source code? Eight monkeys, five minutes.
> -- NullGrey
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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



Re: [PHP] 3 entries going into 1 field

2003-06-01 Thread Cal Evans
have 3 select boxes bdMonth, bdDay, bdYear.

Then when processing the $_POST, simply contact them in the format you want.

$bdString = $_POST['bsMonth'].'/'.$_POST['bsDay'].'/'.$_POST['bsYear'];

HTH,
=C=
* Cal Evans
* http://www.christianperformer.com
* Stay plugged into your audience
* The measure of a programmer is not the number of lines of code he writes
but the number of lines he does not have to write.
*

- Original Message -
From: "Vicky" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Saturday, May 31, 2003 9:05 AM
Subject: [PHP] 3 entries going into 1 field


Hi,

I have a registration form, but I would like to add a Date of Birth section.
Now, because of the different formats of writing it I want to have 3
seperate drop down boxes, Date, Month and Year.

However, I then want those 3 dropdowns to go into one field in a mySQL
database, in DD/MM/ format.

How can I acheive this, in simple language as I'm a newbie to this stuff ^_~

Thanks!
Vicky


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



Re: [PHP] HTML...

2003-06-16 Thread Cal Evans
in page to try

var_dump($_POST['email_recipients']);

=C=
* Cal Evans
* http://www.christianperformer.com
* Stay plugged into your audience
* The measure of a programmer is not the number of lines of code he writes
but the number of lines he does not have to write.
*

- Original Message -
From: "Johnny Martinez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 16, 2003 11:26 AM
Subject: [PHP] HTML...


> Hi all,
> I'm trying to send an email to multiple recips but for some reason the
>  isn't passing "multiple" ...Does anyone see a problem
with
> this code? Do I an array or something to handle the passed multiples?
>
> Johnny
>
> 
>
> page_1.php:
> 
> 
> 
> 
> NONE
> Andreas
> Doreen
> Elvin
> 
> 
> 
> 
> 
>
> =
>
> page_2.php
>  $email_recipients = $_POST['email_recipients'];
> print "" . $email_recipients;
> ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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



RE: [PHP] Banner Ad Serving...

2002-07-23 Thread Cal Evans

Tell apache that .html files are to be served through php

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
 

-Original Message-
From: Dave at Sinewaves.net [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 11:00 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Banner Ad Serving...


That works fine for files with .php extensions, but I need something to add
code to html pages as well...  Any ideas???

Dave



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 8:55 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Banner Ad Serving...


On Wednesday 24 July 2002 11:47, Dave at Sinewaves.net wrote:
> Is there any way of automatically adding a certain bit of code to every
> page on a web server (or within a given directory)?

php.ini --> auto_prepend_file, auto_append_file

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
An eye in a blue face
Saw an eye in a green face.
"That eye is like this eye"
Said the first eye,
"But in low place,
Not in high place."
*/


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


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



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




RE: [PHP] security login

2002-08-12 Thread Cal Evans

If it's simple security then you might want to use an .htaccess file instead
of coding something.

More complex solutions involve asking the user for credentials, validating
those credentials and then storing something in the $_SESSION that indicates
that this user has been validated.

It can be something as simple as $_SESSION['isOK'] = true; to creating a
Person object with various credentialling information and storing it.
$_SESSION['currentMember'] = new Person();
$_SESSION['currentMember']->setLogin('myUserName');
$_SESSION['currentMember']->setPassword('someSillyPassword');
$_SESSION['currentMember']->load();
if !$_SESSION['currentMember']->isA('SYSADMIN){
die("Begone form here you freakin' script-kiddie!");
} // if !$_SESSION['currentMember']->isA('SYSADMIN)

// normal code goes here.

In the above example it is assumed that you have created a Person object to
deal with everything.

HTH,

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Pag [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 12, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] security login



Well, first off sory for a very basic question, but i really dont know
where else to look for the answer. Heres my dilemma:

I need to code a backend for this site i am building, the backend will
manage the news for the front page. The database stuff is pretty straight
forward (so far!), but i need to validate who does the managing, i mean,
some sort of login for only a few people. I am thinking of using
username/pass from a table and all that but the thing is, how do i do the
validating itself? Sure i know how to check for valid user/pass, but then
what happens for the rest of the pages inside the backend, how do i keep
the user validated and make sure only he can browse inside that "secure"
mini site?
Dont know if i am explaining things right, hmm, ok, any of you guys are
familiar with gryematter? It validates the user at the start and then we
can do whatever we want inside. I want to prevent users from skipping the
login and just typing the other page url and go on from there.
I use sessions, cookies? what? can you provide me with some urls for my
research, or at least what to look for?
Thanks a lot, really appreciate all the help.

Pag



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



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




RE: [PHP] OO code and private functions

2002-08-16 Thread Cal Evans

not yet (Zend engine 2.0 I believe has this)  Currently the convention is to
name private functions _* (variables the same) This denotes to other coders
that you intended this to be a private function.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Richard Black [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 16, 2002 9:24 AM
To: Php-General
Subject: [PHP] OO code and private functions


Can I make a function private in PHP, so that it can only be called from
within an object of that class???

Just discovering the wonders of OO PHP... :-)

==
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: [EMAIL PROTECTED]


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



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




RE: [PHP] MySQL Current Row??

2002-09-18 Thread Cal Evans

In (most) SQL servers there is no concept of 'row number'. Most DA's design
tables with a unique primary key. This can be used to identify the row form
all of the other rows but it is not the same as a 'row number'.

Since you are using PHP you can set a counter to 1 before your loop and then
increment it at each loop. This will give you the semblance of a row number
but be aware it is not the same.  These are row numbers within the cursor
you are looking at.  If your cursor is a subset of the table's data then the
numbers you are counting do not correspond to the data in the table.

HTH,
=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Beeman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 8:30 AM
To: php
Subject: [PHP] MySQL Current Row??


What function/array index should I use to determine the current row of a
MySQL query when outputting using a do..while.. Loop?


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




RE: [PHP] about $_post

2002-09-19 Thread Cal Evans

Yes.

$_POST[ID]
Since there are no quotes around the variable name ID and no dollar sign in
front of it, PHP will look for a constant named ID and if one is not found
it will blow chow.

$_POST['ID']
Should work find, assuming a variable named ID came from your form. However,
I wouldn't get in the habit of writing my arrays like this.  It's confusing
to say the least.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Meltem Demirkus [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 19, 2002 6:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP] about $_post


Hi,
I just want to learn if there is any differen between

$_POST[ID]   and  $_POST['ID']  ..If there is.. does it cause a
problem ?..

thanks

meltem


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



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




RE: [PHP] File Random Access

2002-10-30 Thread Cal Evans
Rick,

If you have a file that is to large to simply read into memory, do your
inserts and then write back out then you need to move it to a database.
Cluttering up the main code base with random flat-file reads and writes is
not necessary.

If you seriously need it then you can do as suggested, create a new file,
read from the old file, insert at the proper place, close, delete, rename,
rinse, repeat. If you think about it, that's what the php developers will
have to do to accommodate your request. (assuming again that your file is
too large to simply fit in memory.)

It may be a need for you but in my 2 years of using PHP, you are the first
person I've seen ask for it.  Therefore I don't think it qualifies as a
serious flaw.

IMHO, etc.
=C=
*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 30, 2002 7:46 AM
To: PHP
Subject: [PHP] File Random Access


I never noticed before...there is no easy way to perform random-access read
and WRITE on a
file.

I vote/recommend/suggest that this most basic functionality be added to the
next release
of PHP.  This would not be an enhancement; rather, it is correcting a
serious flaw.

Or am I missing something

- Original Message -
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 6:28 AM
Subject: Re: [PHP] write on the begin of a file


There is no insert in fputs, you need to make a new file and then rename
it to
your old one, or build it in the memory and then overwrite it.

Sébastien Eckert -- Netika wrote:




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



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




RE: [PHP] open a new html page

2002-06-05 Thread Cal Evans

store the user's preference in a database.  Once they have logged in, use
their login or userID to retrieve it form the database and redirect to the
appropriate page.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Renaldo De Silva [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 1:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] open a new html page


is there a simple way to automatically load a new page according  to a
choice made by a user.

If one persons logs in they go to one page, If another peson logs in they go
to another page?

Any help appreciated.




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



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




RE: [PHP] E-Commerce and "small" intranet solution

2002-06-05 Thread Cal Evans

have you searched freshmeat.net? google.com? both of those can give you the
examples you are looking for.

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Jay Fitzgerald [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 2:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] E-Commerce and "small" intranet solution


Does anyone know where I can find the best (not just good) shopping cart
solution that
also has small intranet functionality?

Im not too worried about the intranet aspect right now, but I really need
examples of some
of the best carts that are out there.

--
Should you have any questions, comments or concerns, feel free to call me at
318-338-2034.

Thank you for your time,

Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A
=
Bayou Internet..(888)
30-BAYOU...http://www.bayou.com
Mississippi Internet...(800)
MISSISSIPPIhttp://www.mississippi.net
Vicksburg Online..(800)
MISSISSIPPIhttp://www.vicksburg.com
Bama Online.(877)
GETCONNECTED...http://www.bamaonline.net
=
Tel: (318) 338-2034ICQ: 38823829Fax: (318) 323-5053




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



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




RE: [PHP] HTTP1.1

2002-06-27 Thread Cal Evans

It's not so much a no-no as it is bad form.  It makes it very difficult to
re-arrange your site at a later date or move that page.

For your own peace of mind and those who come behind you, absolute links in
the form of href="/correct/path/to/the/file.php" should be used.  You can
omit the http:// and the host name if you like.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 12:40 PM
To: php-gen
Subject: [PHP] HTTP1.1


Kinda off topic, but it deals with a php script Im writing.
Ive been using dynamic strings to create relative links like ->
somefile

I was wondering if this is a no no according to http 1.1 specs.
ie absolute links ->
http://host/correct_path_to_file.php";>somefile

I briefly looked through through the specs, but it didn't say that
links/urls shouldn't be formatted like the first example above...

Any insight, would be grateful.
Thanks

--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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



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




RE: [PHP] Why isn't this working?

2002-06-28 Thread Cal Evans

Have you tried:
$query = "UPDATE poll_options SET votes = votes + 1";

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*
 

-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 28, 2002 8:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Why isn't this working?


Here is my code:

$query = "UPDATE poll_options SET votes + 1";
mysql_query($query);

All where conditions have were removed to try and fix the problem



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



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




RE: [PHP] Populate Popup Menu from Database

2002-06-29 Thread Cal Evans

Hi Mike,

Check out ADODB. It's a database abstraction layer for PHP that has
functions to do this. (php.weblogs.com)  Otherwise it's kinda easy to do
this, here's some psuedo-code that shoudl get you going.




fields['departmentID']; ?>">fields['departmentName']; ?>
?>



=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Mike Tuller [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 29, 2002 10:42 AM
To: php mailing list
Subject: [PHP] Populate Popup Menu from Database


I have some popup menus and want the items in the menu to be populated from
a database. In this case I have a table that contains a listing of
departments. I have a page that I can go in and add/delete departments, and
want the changes to reflect in the menu the next time you go to the page.

I searched for examples and found this:

http://marc.theaimsgroup.com/?l=php-general&m=97628169623096&w=2

What is here is beyond my understanding, and seems like it is a little much
for what I need.

Here is what my database table looks like:

Departments
department_id
department_name

I just want to list the department name in the popup.


Thanks,
Mike


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



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




RE: [PHP] ASP style "application-level" variables

2002-06-29 Thread Cal Evans

Lee,

Please check the archives before posting questions like this.  As John
stated, this question has been asked and answered this week. (I think it was
a thread just yesterday.)

It would have been much quicker for you to get your answer by mining the
archives than by posting it again here.

Thanks for your cooperation,
=C=

p.s. I accomplish applicaiton level variables by storing them in a table
called application in my application's database.  This way I can change them
on the fly and all my pages can see them.  I have objects that read them in
on the pages that need them.


*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Lee [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 29, 2002 10:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] ASP style "application-level" variables


Hi,

Apologies if this question has already been asked in the past, but I have
only just registered for this list.

Does PHP in anyway support ASP style application-level variables in a
similair way to how standard sessions are used.

Though of implementing this as either files or database records but the
additional coding could be more error-prone or eat more system resources
than using a feature built into PHP itself.

I would be interested to hear other peoples views on this feature.

Lee


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



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




RE: [PHP] php & SMS (or phone contact)

2002-07-01 Thread Cal Evans

don't reinvent the wheel. (Unless you jsut REALLY want to) Try
www.nagios.org  It has support for SMS.
(Be prepared to spend about 3-4 hours setting it up)
=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Duncan [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 01, 2002 9:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php & SMS (or phone contact)


Hi,

i want to make a script, that monitors my server and if its down, sends an
SMS, pager message, or rings the phone (lol) to contact me.
Is it possible to send a message to a pager or an SMS to a handy with php?
Or are there any scripts already out there?
I tried to take a look around, but most scripts i found relied on services,
which don't exist anymore, of who changed their service, so that its not
possible to use from the outside.

Regards,

Hendrik



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




RE: [PHP] Re: MySQL fetch data

2002-07-01 Thread Cal Evans

Jeff,

Also, try php.weblogs.com ADODB if you absolutly MUST have all of your data
in an array.

I'll agree with Richard that it's not a great idea unless there is a
specific need.  While loops for displaying the contents of many records are
much better. (IMHO, etc...)

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 30, 2002 5:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: MySQL fetch data


In article <00e001c21db3$7b1b66a0$0a01a8c0@jcowart> , [EMAIL PROTECTED]
(Jefferson Cowart) wrote:

>Is there any way to return all the rows returned by a mysql query with
>one command. Currently I have to run through a for or while loop the
>same number of times as there are rows and take that row and copy it to
>an array. I end up with an array of arrays but it seems like it would be
>a common enough problem that the function would already exist.

Why do you think you need the data in an array?  Usually, you can just deal
with it immediately and discard it.

I think Oracle lets you snatch a whole array at once, but not MySQL.

If you screw up your SQL, you don't want to try to snatch the whole thing at
once anyway -- The potential for trashing your web/db-server by asking for,
oh, 10,000 records at once is just too high.

Better safe than sorry.

--
Like Music?  http://l-i-e.com/artists.htm


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



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




RE: [PHP] Authentication

2002-07-03 Thread Cal Evans

I agree with Ed.  Use sessions.

It's more secure that how you are doing it because theusername is not stored
in the page and retransmitted each page.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Peter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 03, 2002 2:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Authentication


On my site, when a user logs in, their password is encrypted using md5() and
the username and encrypted password is then passed from page to page using
hidden form inputs (clicking on a link submits the form using POST).
Does anyone have any comments on this method e.g. security wise? I know I
could use sessions or cookies but is it relly necessary?



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



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




RE: [PHP] function for size of array

2002-07-05 Thread Cal Evans

size_of()
(insert obligatory RTFM comment here)
=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
 

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 05, 2002 9:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] function for size of array


Is there PHP function that would get the total array count.

ie
--snip--
$array[0] = "zero";
$array[1] = "one";
$array[2] = "two";

$array_count = 
--snip--

And I would get 3 as an answer.

Thanks,
 FletchSOD



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



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




Re: [PHP] don't want to receive but email please

2002-07-08 Thread Cal Evans

only if user stupidity can be considered a virus.

=C=
- Original Message -
From: "Lazor, Ed" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, July 08, 2002 11:37 AM
Subject: RE: [PHP] don't want to receive but email please


> So is this a new virus?
>
> -Original Message-
> From: Rodolfo Contreras T. [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 05, 2002 6:30 PM
> To: [EMAIL PROTECTED]; PHP List
> Subject: [PHP] don't want to receive but email please
>
>
>  don't want to receive but email please don't want to receive but email
> please don't want to receive but email please don't want to receive but
> email please don't want to receive but email please don't want to receive
> but email please don't want to receive but email please don't want to
> receive but email please don't want to receive but email please don't want
> to receive but email please don't want to receive but email please don't
> want to receive but email please don't want to receive but email please
> don't want to receive but email please don't want to receive but email
> please don't want to receive but email please don't want to receive but
> email please don't want to receive but email please don't want to receive
> but email please don't want to receive but email please don't want to
> receive but email please don't want to receive but email please don't want
> to receive but email please don't want to receive but email please don't
> want to receive but email please don't want to receive but email please
> don't want to receive but email please don't want to receive but email
> please don't want to receive but email please don't want to receive but
> email please don't want to receive but email please don't want to receive
> but email please don't want to receive but email please don't want to
> receive but email please don't want to receive but email please don't want
> to receive but email please don't want to receive but email please don't
> want to receive but email please don't want to receive but email please
> don't want to receive but email please don't want to receive but email
> please don't want to receive but email please don't want to receive but
> email please don't want to receive but email please don't want to receive
> but email please don't want to receive but email please
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

> This message is intended for the sole use of the individual and entity to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you very
> much.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




RE: [PHP] html entry within XML "database"

2002-07-13 Thread Cal Evans

As a general rule of thumb you should ALWAYS validate the information posted
as a form before sending it on to whatever backend you are using.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: William S. [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 13, 2002 7:37 AM
To: php
Subject: [PHP] html entry within XML "database"


I am experimenting with using an XML file as a
database. One of the things I do is provide
a way of adding records to the database by an
html form.

This seems to work out well so far unless one
of the fields in a record contains an html
reference. The result is a Sablotron parse error.

What is the best way around this? Should I
validate the form before it is submitted so that
html references are rejected? How would I do this?

--
Bill
Amsterdam, NL

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



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




RE: [PHP] How come this will echo No or nothing?

2002-07-13 Thread Cal Evans

because $row['plevel'] is NEVER == '0'  It is probably == 0 though. (note
the missing quotes. ) :)

HTH,
=C=
*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How come this will echo No or nothing?


here is the portion of the script:

  if($row['plevel'] == '0'){
  echo 'No';
  } else {
  echo 'Yes';
  }

here is my table structure dump:

#
# Table structure for table `docs`
#

CREATE TABLE docs (
  id int(11) unsigned NOT NULL auto_increment,
  name varchar(200) NOT NULL default '',
  note varchar(200) NOT NULL default '',
  author varchar(200) NOT NULL default '',
  path varchar(200) NOT NULL default '',
  plevel tinyint(3) NOT NULL default '0',
  type char(3) NOT NULL default '',
  cat tinyint(3) NOT NULL default '0',
  file_size int(11) unsigned NOT NULL default '0',
  date int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM;

the row plevel is either 0 or 1.

why won't this script echo Yes?

The reason that the plevel is set in numbers is because I may add higher
ones later.

--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



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



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




RE: [PHP] How come this will echo No or nothing?

2002-07-13 Thread Cal Evans

Have you done a var_dump on $row to make sure that plevel exists?

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
 

-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:11 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How come this will echo No or nothing?


I tried that.

same result.

Here is my (new) snippet:

  if($row['plevel'] == 0){
  echo 'No';
  } else {
  echo 'Yes';
  }

"Cal Evans" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> because $row['plevel'] is NEVER == '0'  It is probably == 0 though. (note
> the missing quotes. ) :)
>
> HTH,
> =C=
> *
> * Cal Evans
> * The Virtual CIO
> * http://www.calevans.com
> *
>
>
> -Original Message-
> From: JJ Harrison [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 12, 2002 11:01 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How come this will echo No or nothing?
>
>
> here is the portion of the script:
>
>   if($row['plevel'] == '0'){
>   echo 'No';
>   } else {
>   echo 'Yes';
>   }
>
> here is my table structure dump:
>
> #
> # Table structure for table `docs`
> #
>
> CREATE TABLE docs (
>   id int(11) unsigned NOT NULL auto_increment,
>   name varchar(200) NOT NULL default '',
>   note varchar(200) NOT NULL default '',
>   author varchar(200) NOT NULL default '',
>   path varchar(200) NOT NULL default '',
>   plevel tinyint(3) NOT NULL default '0',
>   type char(3) NOT NULL default '',
>   cat tinyint(3) NOT NULL default '0',
>   file_size int(11) unsigned NOT NULL default '0',
>   date int(11) unsigned NOT NULL default '0',
>   PRIMARY KEY  (id)
> ) TYPE=MyISAM;
>
> the row plevel is either 0 or 1.
>
> why won't this script echo Yes?
>
> The reason that the plevel is set in numbers is because I may add higher
> ones later.
>
> --
> JJ Harrison
> [EMAIL PROTECTED]
> www.tececo.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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



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




RE: [PHP] Newbie question

2002-07-13 Thread Cal Evans

++ is an incrementor. 

$i=1;
$i++;
echo $i;

=C=

p.s. -- is a decrementor.

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
 

-Original Message-
From: Jay [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 13, 2002 8:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie question


I have just started to teach myself php so I am reading through several
scripts to see how the language is "spoken". I came across the following
at  phpworld.com


$i = 1;
while ($i <= 10) {
print $i++

Its a little script that counts from 1 to 10,  but what does $i++ mean.
What does the ++ do? Why ++ and not just one +

Thanks

-Jay



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



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




RE: [PHP] How come this will echo No or nothing?

2002-07-13 Thread Cal Evans

off the top of my head, I'd suggest :

if(intval($row['plevel']) == 0){

Grasping at straws here but you've moved beyond a simple question into a
debigging process. (Which doesn't work too well for email.)

Sorry I couldn't be of more help.
=C=
*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How come this will echo No or nothing?


The value of plevel is "0" according to var_dump.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

"Cal Evans" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Have you done a var_dump on $row to make sure that plevel exists?
>
> =C=
>
> *
> * Cal Evans
> * The Virtual CIO
> * http://www.calevans.com
> *
>
>
> -Original Message-
> From: JJ Harrison [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 12, 2002 11:11 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] How come this will echo No or nothing?
>
>
> I tried that.
>
> same result.
>
> Here is my (new) snippet:
>
>   if($row['plevel'] == 0){
>   echo 'No';
>   } else {
>   echo 'Yes';
>   }
>
> "Cal Evans" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > because $row['plevel'] is NEVER == '0'  It is probably == 0 though.
(note
> > the missing quotes. ) :)
> >
> > HTH,
> > =C=
> > *
> > * Cal Evans
> > * The Virtual CIO
> > * http://www.calevans.com
> > *
> >
> >
> > -Original Message-
> > From: JJ Harrison [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, July 12, 2002 11:01 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] How come this will echo No or nothing?
> >
> >
> > here is the portion of the script:
> >
> >   if($row['plevel'] == '0'){
> >   echo 'No';
> >   } else {
> >   echo 'Yes';
> >   }
> >
> > here is my table structure dump:
> >
> > #
> > # Table structure for table `docs`
> > #
> >
> > CREATE TABLE docs (
> >   id int(11) unsigned NOT NULL auto_increment,
> >   name varchar(200) NOT NULL default '',
> >   note varchar(200) NOT NULL default '',
> >   author varchar(200) NOT NULL default '',
> >   path varchar(200) NOT NULL default '',
> >   plevel tinyint(3) NOT NULL default '0',
> >   type char(3) NOT NULL default '',
> >   cat tinyint(3) NOT NULL default '0',
> >   file_size int(11) unsigned NOT NULL default '0',
> >   date int(11) unsigned NOT NULL default '0',
> >   PRIMARY KEY  (id)
> > ) TYPE=MyISAM;
> >
> > the row plevel is either 0 or 1.
> >
> > why won't this script echo Yes?
> >
> > The reason that the plevel is set in numbers is because I may add higher
> > ones later.
> >
> > --
> > JJ Harrison
> > [EMAIL PROTECTED]
> > www.tececo.com
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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



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




RE: [PHP] Alley-OOP! ... or not?

2002-07-15 Thread Cal Evans

Building off of what Jay said...

I'm a hardcore OOP developer but agree that you must use it judiciously.
Used in the correct way it makes maintaining/extending your applications
much easier.  There are times though when you don't want it.

I usually find myself coding pages that have PHP in them.  However, whenever
I can abstract a task from the page and move it into an object that can be
reused, I do.  ALMOST ALL of my database interaction goes through objects.
(I do some quickies where I'll code a mysql_query line in the page, but not
often.)

If it is a discrete task (database interaction) or an abstraction of a
physical object (Person, Invoice, Order) then I use object.  The code in the
page mainly creates objects and manipulates them.

HTH,
=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Martin Clifford [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 10:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Alley-OOP! ... or not?


Hey all,

I've seen quite a few programs that seem to greatly favor Object Orienting
Programming (OOP) in their code.  I don't mean to start a holy war or
anything of the sort, but as a burgeoning PHP developer, I would like the
opinions of my peers.

So how about it, ladies and gents?  Tell me about the Pros and Cons to OOP,
and why you prefer to use it/not use it!

Personally, I've always used regular functions to accomplish my repetetive
tasks, and OOP seems rather daunting for me, but I'm always open to new (and
hopefully, more efficient) ideas!  Thanks!

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/



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



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




RE: [PHP] Accessing Ports

2002-07-18 Thread Cal Evans

No. 

No. PHP runs on the server. It knows nothing of the client.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
 

-Original Message-
From: Thomas "omega" Henning [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 5:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Accessing Ports


Hello,

Can i access my paralel or USB port with PHP server side?

Thomas "omega" Henning



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



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




[PHP] Re: duplicating databases

2003-10-08 Thread Cal Evans
Check out sqlyog. (www.sqlyog.com) It has a structure sync tool.  After 
making the first change, you could generate a script to make the change 
to the next database and then take that script and parameterize it so 
that a PHP script could use it to update all of your database.

HOWEVER,

A better way to do this may be to re-think your entire schema.  Instead 
of keeping the data in separate but identical databases, put it all in 
one database but add a key (owner, database, etc) to each table. Then in 
your selects, simply add to your where clause "AND ownerID=x". This way 
you only have 1 database but your data is kept separate. (Until MySQL 
comes out with views, then it gets a lot easier.)

HTH,
=C=
* Cal Evans
* http://www.eicc.com
* We take care of your IT,
* So you can take care of your business.
*
* I think inside the sphere.
Steve Buehler wrote:
I am running PHP/MySQL for a program that I am writing.  We will 
have 100's or 1000's of databases that will be duplicates in structure.  
The problem is when I make a change to the database, I have to go to 
every database manually and make the change.  All of the databases start 
with "a_" and are on the same server.  I would like to be able to have 
one master database and then run a script when I make a change to it 
that will get the structure of the master database and check all of the 
other databases to make sure that their structures match.  If not, it 
will make the change to the other databases.  Does anybody know if there 
is all ready a program out there that would do this?  Can anybody point 
me in the right direction?  Or if it is only a few lines of script that 
somebody all ready has to do this, can you share it?

Thank You
Steve

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


RE: [PHP] looking for a PHP editor

2001-01-10 Thread Cal Evans

What extensions and where can you get them?

Cal
http://www.calevans.com

p.s. love homesite use it for everything from HTML to Java to php.


-Original Message-
From: Wacks, David [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 10:59 AM
To: 'Egan'; [EMAIL PROTECTED]
Subject: RE: [PHP] looking for a PHP editor


Personally, my team and I use HomeSite 4.5.x from Allaire.  It is PHP aware
and there are extensions you can add to allow PHP expression building. I
have used it for a coupe of years and fills my text building personality as
well as the graphical GUI ones with DW and browsing.

If you use DreamWeaver (DW), it usually comes as a freebie.

--Dave 

-Original Message-
From: Egan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 9:54 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] looking for a PHP editor


On Wed, 10 Jan 2001 10:50:40 -0400, Miles Thompson
<[EMAIL PROTECTED]> wrote:

> For a Windows environment I'll endorse jeremy's recommendation
> of Ultraedit -- my hammer of choice.

Am I the only one using HoTMetal Pro 6.0 on Windows?

Its PHP support has a very annoying bug when it encounters embedded
HTML output contained within PHP standard tags, but using PHP long
tags fixes that problem.  Long tags help in other ways too, because
they make HoTMetaL format your PHP script text as-is, letting you
control indenting of the PHP text the way you want.

And as long as you're not trying to embed HTML output inside your PHP
tags, you can use PHP short tags in contexts where they make the most
sense, like printing the contents of a single variable:

  VALUE=""

Notice the omission of the "print" command.  That's a neat little
trick I learned from Matt Zandstra's book.  Very helpful for quick
output of a single variable.

One thing I can no longer live without, is HoTMetaL's integrated FTP
support.  It's so good, the FTP site becomes part of your desktop.

I can open a remote FTP file for some quick changes, without even
storing it locally on my hard drive.  And then just as quickly, save
it back to the FTP site with the touch of one toolbar button.

OTOH, after an editing session where I make extensive changes to the
local copy of my project, its FTP file synchronization is everything I
could ask for.

And did I mention its excellent support for different HTML views like
tags-on, WYSIWYG, and raw source?

Did I mention its excellent table design and manipulation facilities?

Did I mention its project management?

Did I mention ...

Yes I could go on and on.  You get a screwdriver and some wrenches
with your hammer.  It's available at Amazon, discounted to about $70.


Egan




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




RE: [PHP] PHP simulator

2001-01-10 Thread Cal Evans

there's an implementation of PHP for IIS.

-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 4:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP simulator


Is there a PHP simulator for NT?  One that can be used for testing and
development?

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]



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



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




RE: [PHP] How can I get a random number

2001-01-10 Thread Cal Evans

Put a web cam on it and we've got a winner!  :)

Cal

-Original Message-
From: Monte Ohrt [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 4:21 PM
To: [EMAIL PROTECTED]; Brandon Orther
Subject: Re: [PHP] How can I get a random number


You can blow some ping pong balls around in an enclosure and pick one,
that's pretty random :)

For the next best thing to "random", you can use the rand() function in
PHP.

Brandon Orther wrote:
> 
> How can I get a random number
> 
> Thank you,
> 
> 
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.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]




RE: [PHP] Function -> Sending URL's

2001-01-11 Thread Cal Evans

There's a couple points here:

1: echo isn't what you want to do.  You want to RETURN the value from you
function.  Try this:
Click";
return "Click";
}

$url = 'asdfasdf.php3';
$newURL = testPassVar($url);

echo($newURL);

echo "This is a $name";
?>

2: in the last line, you try to echo $name.  $name is defined within the
function testPassVar() and goes out of scope when that function is done  At
this point in your script, $name does not exist.

Hope this helps,
Cal

http://www.calevans.com

-Original Message-
From: Abe [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 3:35 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Function -> Sending URL's


Hey there,
this is a strange one - I want to send a URL to a function that includes
varibles.  Those variables should be taken from within the function - as in
the example below the link I want is:

asdfasdf.php3?name=TEST  , but that is not what I get as you can see.

Does anybody know a way around this - The example is simpler than what I am
actually doing and the value of $company must come from the variable.

Thanks,
Abe



Click";
}

$url = 'asdfasdf.php3?name=$company';
testPassVar($url);
echo "This is a $name";
?>


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




RE: [PHP] Function -> Sending URL's

2001-01-11 Thread Cal Evans


Ok, what I would do is either pass in an array of key/value pairs OR pass in
2 variables, the key name and the value.

$keyValuePairs["name"]="Company1";
$keyValuePairs["address"]="123 Main Street";
$keyValuePairs["city"]="Anytown";
$newURL = testPassVar("http://www.calevans.com",$keyValuePairs)
function testPassVar($url, $keyValuePairs) {
 /*
  * There here in the function you unwind the array and add each to the URL
in the form of
  * $thisKey=$keyValuePairs[$thiskey]
  *
  */
  return $url
} // function testPassVar($url, $keyValuePairs)

A simpler method is to pass in a single key and value and let the function
add them and return you the newly munged URL.

function testPassVar($url, $key, $value) {
  //won't work if it's the first pair. need to test for that!
  return $url."&".$key."=".$value;

}

$newURL = testPassVar("http://www.calevans.com?test=one","name","Cal");


Cal
http://www.calevans.com

-Original Message-
From: Abe [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 3:51 PM
To: Cal Evans; [EMAIL PROTECTED]
Subject: Re: [PHP] Function -> Sending URL's


Hey Cal -

this makes sense but the thing is that different parts of the site will call
such a function and they will all want different variables attached to the
end -

I could do it some other way - but I wanted to know if there was some way of
doing it by sending the whole URL(incl. the variables) and letting them be
dealt with by the function.

Thanks,
Abe


- Original Message -
From: "Cal Evans" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 9:40 PM
Subject: RE: [PHP] Function -> Sending URL's


> There's a couple points here:
>
> 1: echo isn't what you want to do.  You want to RETURN the value from you
> function.  Try this:
>  function testPassVar($url) {
> $name = "TEST";
> echo "Click";
> return "Click";
> }
>
> $url = 'asdfasdf.php3';
> $newURL = testPassVar($url);
>
> echo($newURL);
>
> echo "This is a $name";
> ?>
>
> 2: in the last line, you try to echo $name.  $name is defined within the
> function testPassVar() and goes out of scope when that function is done
At
> this point in your script, $name does not exist.
>
> Hope this helps,
> Cal
>
> http://www.calevans.com
>
> -Original Message-
> From: Abe [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 11, 2001 3:35 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Function -> Sending URL's
>
>
> Hey there,
> this is a strange one - I want to send a URL to a function that includes
> varibles.  Those variables should be taken from within the function - as
in
> the example below the link I want is:
>
> asdfasdf.php3?name=TEST  , but that is not what I get as you can see.
>
> Does anybody know a way around this - The example is simpler than what I
am
> actually doing and the value of $company must come from the variable.
>
> Thanks,
> Abe
>
>
>
>  function testPassVar($url) {
> $name = "TEST";
> echo "Click";
> }
>
> $url = 'asdfasdf.php3?name=$company';
> testPassVar($url);
> echo "This is a $name";
> ?>
>
>
> --
> 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]




RE: [PHP] Making PHP Hold the hundreth place, instead of dropping the 0

2001-01-11 Thread Cal Evans

I think you are looking for printf.  Check the manual. it won't hold it, but
you can make it PRINT it. (Which, I'm asumming, is what you really want)

Cal
http://www.calevans.com

-Original Message-
From: JB [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 9:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Making PHP Hold the hundreth place, instead of dropping
the 0


Hey,

Simple question. Breifly rumaged through the PHP docs and couldn't find this
answer.

How do i force PHP to hold ending zero in a double?

Ie- if the price is 15.50, php will output it as 15.5 after it does the
math. how do i overcome this. thanks!

jason


-- 
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-DB] Autonomous Mass Mail List System (Broadcast Email)

2001-01-10 Thread Cal Evans

Don't reinvent the wheel. It will take you longer to write it than it will
to learn to admin majordomo or any of 10 other programs like it.

IMHO,
Cal

-Original Message-
From: Jason Beebe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 7:49 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Autonomous Mass Mail List System (Broadcast Email)


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.


-- 
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] mixing HTML and PHP code

2001-01-12 Thread Cal Evans

HAR!  :)

cal

-Original Message-
From: Tim Zickus [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 6:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mixing HTML and PHP code


> that's why I didn't implement one of those keyword things in binarycloud.
> ergh.

Pretty soon we're going to have to start limiting you to only mentioning
binarycloud 2 times per hour or less. :-) :-)

- Tim


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




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

2001-01-13 Thread Cal Evans

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]




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

2001-01-13 Thread Cal Evans

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




RE: [PHP] Refresh particular browser while updating another browser

2001-01-14 Thread Cal Evans

>From everything I know, this can't be done easily. The only way I can think
of to do it is to keep both sessions alive so that you still have a
connection to the browser from the server.  This is not real good.

I would instead, explore options using JavaScript.  I think I can see a
couple of ways that you could use JavaScript to force a refresh of a window
that it has a handle to, upon an event. (Like pressing the submit button in
a browser.)

Cal
http://www.calevans.com


-Original Message-
From: Hendry Sumilo [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 14, 2001 1:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Refresh particular browser while updating another browser


Dear Expert,

I would like how to refresh particular browser with a new updated data when
the user has updated it at another browser.
Purpose of doing this is particular user won't user overwrite new value if
he uses another browser to update it.

Thank you



Sincerely Yours

Hendry Sumilo
[EMAIL PROTECTED]
http://members.tripodasia.com.my/hsumilo

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



-- 
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-14 Thread Cal Evans

I agree. You've piqued my curiosity.  Can you go into details?

Cal
http://.calevans.com

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 13, 2001 10:19 PM
To: jeremy brand
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] load balancing with php/apache?


On Sat, 13 Jan 2001, jeremy brand wrote:

> Oh, BTW, we don't use PHP sessions, we use our own.  
That has got me hooked - what do you use?
do you mean you dont use 
1) PHP4 sessions 
OR
2) don't use PHP for session handling at all?

Tarique

-- 
=
   B2B Application Providers
http://www.sanisoft.com
 Vortal for Nagpur http://nagpurcity.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]



-- 
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 Cal Evans

Greetings Henti,

While I personally prefer working I PHP after having just finished leading a
team of developers on a large JSP project, I would advise you to use the
technologies that your client is most comfortable with. Especially if they
understand that it will cost more and are willing to pay the extra.

It is my experience that while JSP is more powerful, you pay for that power
in development time.  Since the Java API is so broad, you sometimes have to
hunt around for a while to find the right commands to do the job.  PHP will
do 75% of the job, do it fast enough to please most clients and developers
can usually do it quicker in PHP.

Does your client have overriding technical concerns about PHP?
Do they have specific reasons why they are insisting on Java? (technical or
otherwise?)

I worked a job once where we had to deploy Solaris on Sun HW just because it
was in the medical industry and the client did not feel that Linux would be
accepted.  It did not matter that it would eventually cost the client over 1
million on HW just to do the job. (We could have distributed a lot of low
cost Linux boxes, done the same job for about 1/3 of that)

Bottom line is some people just don' get it. If you want the contract then I
would go JSP.  If you don't want' it/need it, walk away.

Cal
http://.calevans.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 14, 2001 9:35 PM
To: PHP list
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

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




RE: [PHP] submit opens two windows/pages

2001-01-14 Thread Cal Evans

I'd do it with JavaScript. Dynamically composed JavaScript if need be. But
it seems to me that it would be easier to do this on the client side.

Cal
http://www.calevans.com


-Original Message-
From: Tom Beidler [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 14, 2001 2:33 PM
To: php list
Subject: [PHP] submit opens two windows/pages


Is there a way to have two windows open after a submit. I have a client that
would like to add a "thank you" pop up window after submitting an order. So
after entering there billing info and hitting the submit button the form is
directed to a summary page that summarizes the sale. I would also like a pop
up or junior window to open.

Thanks for any assistance,
Tom

>>.>>.>>>.>.>
Tom Beidler
Orbit Tech Services
805.455.7119 (cell)
805.682.8972 (phone)
805.682.5833 (fax)
[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]




RE: [PHP] PHP vs JSP

2001-01-14 Thread Cal Evans

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]




RE: [PHP] simple division.. but how?

2001-01-15 Thread Cal Evans

$a= intvalue(10/3)

echo($a)



Cal
http://www.calevans.com
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 15, 2001 12:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] simple division.. but how?


if you want to do
10 / 3 
i want it to show 3 and not 3.3

how do I control that?


- Thanks

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



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




[PHP] PDFLIB 3.0 PHP 4.04

2001-01-15 Thread Cal Evans

Has anyone gotten PHP 4.04 to compile with PDFLIB support?

I have successfully compiled pdflib and all of it's supporting libs. (It
runs the tests that come with it)

But when I ./configure php, I use:

./configure --with-pdflib=/usr/local/lib

And  in the output of configure I see:

...
checking whether to include Pdflib 3.x support... /usr/local/lib
no
...

I can't seem to figure out how to make it say YES!

Any help would be greatly appreciated.

Cal



Cal
http://www.calevans.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]




RE: [PHP] PDFLIB 3.0 PHP 4.04

2001-01-15 Thread Cal Evans

You sir (or madam), are a god among men!

Thanks for the assist.

Cal
http://www.calevans.com
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Jani Taskinen
Sent: Monday, January 15, 2001 3:59 PM
To: Cal Evans
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PDFLIB 3.0 PHP 4.04


On Mon, 15 Jan 2001, Cal Evans wrote:

>But when I ./configure php, I use:
>
>./configure --with-pdflib=/usr/local/lib

Leave the /lib part out..ie. use --with-pdflib=/usr/local
instead.

--Jani




-- 
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 locking up

2001-01-17 Thread Cal Evans

try a blank page with



as the only line.

Does that work?


Cal
http://www.calevans.com
 

-Original Message-
From: Phil Scopes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 5:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP locking up


I have installed PHP 4.0 with Apache 1.3 under Windows '95.  When I run a
PHP script, even the simplest script, the browser just sits there and never
displays any data.  Is there anything I might be doing wrong?  I'm sure the
scripts are valid, because I got them off sample code sites (although you
can't be too confident of that, I'm 99% sure the code is OK.)  Static pages
load fine from my web server.

-Phil


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




RE: [PHP] String to Variable converstion

2001-01-17 Thread Cal Evans

try:
http://www.zend.com/manual/function.eval.php

Cal
http://www.calevans.com


-Original Message-
From: Paul Cohen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 6:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] String to Variable converstion


Hello all,

I am trying to build an IRR calculator using PHP.  The number of cash flow
streams I will have at any time will vary, so I am using a loop to build the
formula.  Then I am iterating to solve the equation and output the solution.

As most of you know, I am solving the following for r:

0=SUM SERIES(CF(i)/{(1+r)^n))

I can build my formula sucessfully with the following;

$form="";
while ($row=mysql_fetch_array($result)){
$form.="$CF/pow((1+'$r'),$N)";
}

But it recognizes $form as a string, so when I put it in my "solution for r"
loop:

for($r=-1.00; $r<=1.00; $r=$r+.0001){
if($form>-.001 && $form < .001){
$IRR=round($r*100, 2);
}
}
echo "$IRR%";


BTW, I have also tried building the $form as a variable, but since I don't
have a value for $r it just puts in zero and sets $form equal to the right
side of the equation. Therfore, instead of inserting a formula into my
"solution for r" loop, it inserts a constant for $form.

I think my solution is to build the formula as a string and then insert it
into my "solution for r" loop, convert it back to a real formula and then
iterate for the solution.  Is this possible?  If not, 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]



-- 
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] check null value

2001-01-23 Thread Cal Evans

I would try:

if (isset($fieldname) && empty($fieldname)){
  // do something here with the variable
} else {
  $fieldname="na";
}  // if (isset($fieldname) && empty($fieldname))


Cal
http://www.calevans.com


-Original Message-
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 3:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] check null value


If I have one input text box that when it is submitted to next page, I want
to check first if it is nothing, then write "na" on next page, else just
echo whatever it is, is it correct to do this?

if ($fieldname == ""){
$fieldname ="na";
}
...
(then come to the html bit below)


I wonder specificly about the check if it is null part if it is corerct. Any
thoughts?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"


-- 
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] Non-existant folders??

2001-01-23 Thread Cal Evans

Yes, it can be done.

No it's not easy.

No, it's not advisable.

Mixing content like that is a recipe for disaster.

If you feel you absolutely must do it without creating dirs, consider
putting the content of the pages in a database.

Cal
http://www.calevans.com


-Original Message-
From: Adrian Murphy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 5:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Non-existant folders??


Hi,
I'm creating a little app whereby people will be able to create a simple
site for themselves (maybe 10 html pages).
here's the problem:
say their company is called "companyname" and my site is called
"www.mysite.com" i'd like their site to be located at

"http://www.mysite.com/companyname"

Is there a way i can do this without creating indivual folders for each
company.I'd like the whole creation process to be automated.
I'm sure the ftp functions in php would allow for the generation of new
folders for each,but since all content/style etc. will be pulled from a DB
it's seems to me a little pointless having all these folders with the same
php page in each.essentially i'd like a php script to run automatically each
time taking what looks like a folder name and making a call to the db using
this name as a variable.
easy,difficult or impossible?
thanx,
adrian


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




RE: [PHP] ->

2001-01-24 Thread Cal Evans

It's means that what's on the right is part of the object on the left.

i.e.

$myObject->myMethod();

fires the method myMethod() of the object $myObject.

echo $myObject->myAttribute;

displays the value of the attribute myAttribute of the object $myObject.

Clear as mud?  ;)

Cal
http://www.calevans.com
 

-Original Message-
From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 1:05 PM
To: PHP Mailing List
Subject: [PHP] ->


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]



-- 
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 Cal Evans

$generic is an object. Somewhere you've got a line in your code that
instantiates it. (i.e. $generic = new ...)

Cal
http://www.calevans.com


-Original Message-
From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 1:18 PM
To: Cal Evans; PHP Mailing List
Subject: Re: [PHP] ->


Aisch!  Hmmm... yep, clear as mud.  Let me describe what I we have going on:

We have a function called ToForm which looks like it verifies values coming
in from a POST.  This function is invoked like this:

$generic->ToForm("cart_id", NO_DEFAULT_VALUE);
$generic->ToForm("email_address", NO_DEFAULT_VALUE);

I don't understand the $generic-> and what happens when it "becomes"
something twice.  The ToForm function looks like this:

function ToFORM($val, $default, $makeuppercase=0) {
global $FORM, $$val;
if(!empty(${$val}))
$FORM[$val] = trim(${$val});
else if($default != NO_DEFAULT_VALUE)
$FORM[$val] = $default;
if($makeuppercase)
$FORM[$val] = strtoupper($FORM[$val]);
}

Thanks for the help!

Karl


- Original Message -
From: "Cal Evans" <[EMAIL PROTECTED]>
To: "Karl J. Stubsjoen" <[EMAIL PROTECTED]>; "PHP Mailing List"
<[EMAIL PROTECTED]>
Sent: Wednesday, January 24, 2001 12:08 PM
Subject: RE: [PHP] ->


> It's means that what's on the right is part of the object on the left.
>
> i.e.
>
> $myObject->myMethod();
>
> fires the method myMethod() of the object $myObject.
>
> echo $myObject->myAttribute;
>
> displays the value of the attribute myAttribute of the object $myObject.
>
> Clear as mud?  ;)
>
> Cal
> http://www.calevans.com
>
>
> -Original Message-
> From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 24, 2001 1:05 PM
> To: PHP Mailing List
> Subject: [PHP] ->
>
>
> 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]
>
>
>
> --
> 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]




RE: [PHP] how to rename a database

2001-01-24 Thread Cal Evans

Step 1:
Ask this question on the MySQL mailing list. :)

(Sorry, I couldn't resist)

The easiest way I can think of is to use MySQLDump to dump the schema and
data, delete the original database, change the output of mysqldump to
reflect the new database name and pump it back into mysql.  Depending on
your database size, this may or may not work.


Cal
http://www.calevans.com


-Original Message-
From: Fang Li [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 3:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how to rename a database



Does anyone know how to rename a database in MySQL?
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]



-- 
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] Function / syntax varying from version to version?

2001-01-24 Thread Cal Evans

Guessing here:

Define can't take a variable. It has to have a constant.

define("RUSER", 1);

would compile but not give you the results you want. I'm not sure you can do
what you want.

have you tried:

define("RUSER", '$REMOTE_USER');



Cal
http://www.calevans.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Steven Deaton
Sent: Wednesday, January 24, 2001 4:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Function / syntax varying from version to version?


Using the following snippet of code.

--

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]




RE: [PHP] sessions and objects

2001-02-22 Thread Cal Evans

Why is this good design?

If I create a user object, populate it, kill the connection to the database
(or return it to the pool) and cache the object then I can retrieve it any
time I want without having to hit the database.

Not arguing, just curious as to your perspective.

Cal
http://www.calevans.com


-Original Message-
From: jeremy brand [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 11:46 AM
To: Kevin Beckford
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] sessions and objects


Don't store your object in the session, that is just bad design.
Store a lookup value, then grab your object from your DB only when you
need it.

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

On Thu, 22 Feb 2001, Kevin Beckford wrote:

> Date: Thu, 22 Feb 2001 12:36:29 -0500
> From: Kevin Beckford <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [PHP] sessions and objects
>
> Hello all,
> I've been away from php for a while, ( and I'm glad to be back) Last
> time I checked in, sessioning was kinda working - especially the
sessioning
> of objecs. Is this feature robust enough for production now? I want to do
> basic sessioning, and I don't have a lot of development time. What I want
to
> do is simply :
> - Log in
> -instantsiate an object that will contain the user information
> -save the data in session
> -allow me to recreate that object from page to page
> How would I do/find out how to do this?
>
>
>
> --
> 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]




RE: [PHP] PHP/MySQL Question

2001-03-10 Thread Cal Evans

Select * from table limit 5;

http://www.calevans.com


-Original Message-
From: Kath [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 10, 2001 6:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP/MySQL Question


Having some problems with syntax.

If I wanted to SELECT only 5 instances of something from a database and
order it by datetime, how would I do that?

- Kath


-- 
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] reset in mysql?

2001-03-12 Thread Cal Evans

run it in a CRON job.

Cal
http://www.calevans.com
 

-Original Message-
From: McShen [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 10:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] reset in mysql?


hi

I have a database which tracks how many hits a website has sent me. I wanna
write a script to reset this particular field so that it will be zero at
12:00 in the morning. How do i do it? Any suggestion would be appreciated.

my database is kinda like this(mysql

url | hits
---
http://www.yahoo.com  | 100
--

Thank You!



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




RE: [PHP] How do I get Variables out of a string?

2001-03-16 Thread Cal Evans

urldecode it first. Then explode it.

Cal
http://www.calevans.com


-Original Message-
From: Shawn Pritchard [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 10:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How do I get Variables out of a string?


Hello!

I have been bashing my head trying to figure this out, and I'm hoping
somebody can show me the correct way to do this:

A PGP signed set of variables is passed to our URL via GET.
I use HTTP_GET_VARS to grab the PGP string, which is contained in a variable
called "trnResponse".
I run that through pgpv to end up with the raw string, which I store in a
variable called $rawstring

The string looks like:
trnId=1019&messageId=1&messageText=Approved&authCode=&trnDate=3%2F16%2F2
001+8%3A07%3A14+AM&trnOrderNumber=435643

That's where I get confused about the best way to pull the variables out of
the string.

I was using something like:  $thearray = explode ("&",
rawurldecode($rawstring));   (this still leaves me with "+" in some places,
but I can use str_replace to get rid of them)

I was exploding on "&", but that leaves me with an array with things like
trnId=1019 in each "cell"  It does explode properly, but now, how do I
pull these things out of the array and get them defined as variables??
Or...do I even need to put them into the array in the first place?

THANK YOU for any help someone might be able to provide!!

--
Shawn Pritchard



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




RE: [PHP] Can you recommend an ISP with the following?

2001-03-16 Thread Cal Evans

Have you looked at www.webmin.com?

Cal
http://www.calevans.com


-Original Message-
From: John Huggins [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 10:16 AM
To: Jamie Jackson; [EMAIL PROTECTED]
Subject: RE: [PHP] Can you recommend an ISP with the following?


You mention a large desire for a good web based administrator.  I wonder if
there is a version of a web based system administrator available that works
like Cobalt, but can be installed on any hosting setup.  Have you folks
heard of such a thing?  I am aware of Webmin, but am not too impressed with
it yet.

I have toyed with the idea of writing my own.  Jamie, what items do you feel
must be controllable in a web hosting account administration panel?  Yes, we
all know the basics, like email, dns, etc. but a bulleted list would be a
good start at organizing a development effort.

John

> -Original Message-
> From: Jamie Jackson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 16, 2001 10:45 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Can you recommend an ISP with the following?
>
>
> I'm looking to move from an old Web host (stormweb.net) that has
> entirely stopped responding to customer support emails. I liked what
> they had to offer, before they became unresponsive, so I'm looking for
> a similar ISP with:
>
> *PHP4
> *MySQL
> *Telnet access
> *Decent Support
> *Preferably a Cobalt server (or one with a VERY good Web-based
> administrator, most other types of Web administrators I've seen have
> been clunky and a PITA)
> *Pretty Cheap
>
> I've checked out ISP check, and it would be great if they listed the
> type of Wed-based administrator, but they don't. It's VERY tedious to
> get a demo account, and see that their Web-based administrator is
> junk. I'm used to the very slick administrator found on Cobalt
> servers. I have given up after a half-dozen attempts at other servers.
> I sincerely hope someone can help.
>
> Thank you very much,
> Jamie
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




RE: [PHP] ASP to PHP

2002-04-23 Thread Cal Evans

Having moved a moderately sized website last year from ASP to PHP I can say
from experience that if you can re-write it, the move will go smoother and
you will have fewer lines of code. I ended up with about 1/2 as many lines
of code to maintain after the port was done.
=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 6:38 AM
To: [EMAIL PROTECTED]
Subject: [PHP] ASP to PHP


I got a strange request from a client. He wants to be able to take his ASP
pages and move them over to PHP so that he can run them on apache on his
linux server. I saw a tool yesterday ASP2PHP, but I am wanting to know does
it work, how much is lost, is it easy to use? Is there another way to change
ASP file to PHP with out a lot of re-writes?

Chuck Payne


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



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




RE: [PHP] PHP Security Leak (plaintext)

2002-04-25 Thread Cal Evans

It's not PHP's place to do this.

That being said, check out ADODB.  It's a data abstraction layer for several
different databases that will give you this functionality.

=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Joshua b. Jore [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 4:00 PM
To: Maxim Maletsky (PHPBeginner.com)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP Security Leak (plaintext)


Foo. Somehow I encrypted the last message.

--[PinePGP]--[begin]--
I think you misunderstood me. I already have a AuthenticateUser(TEXT,TEXT)
function that works great. What I don't understand is how to get PHP to
use place holders for data binding. This is more generic database issue. I
could have also written:

"INSERT INTO foo (a,b) VALUES (?,?)"

where again, the values are passed separately and are *not* interpolated
into the query. That's the point - not interpolating your values to
protect against insertion attack.

Joshua b. Jore
http://www.greentechnologist.org

On Thu, 25 Apr 2002, Maxim Maletsky (PHPBeginner.com) wrote:

> Create yourself an SQL function that does that :-)
>
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
>
> www.PHPBeginner.com   // where PHP Begins
>
>
>
> > -Original Message-
> > From: Joshua b. Jore [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 25, 2002 10:26 PM
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: [PHP] PHP Security Leak
> >
> > This brings up another issue, how the heck do you get data binding?
> For
> > the life of me I don't see where the _query functions support SQL
> like:
> >
> > "SELECT AuthenticateUser(?,?)" where then the first param might be a
> > usernamd and the second would be a password. The idea is that without
> this
> > sort of thing you are vunerable to SQL insertion attacks.
> >
> > Joshua b. Jore
> > http://www.greentechnologist.org
> >
> > On Thu, 25 Apr 2002, Maxim Maletsky (PHPBeginner.com) wrote:
> >
> > > > -Original Message-
> > > > From: Liam Gibbs [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, April 25, 2002 8:20 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] PHP Security Leak
> > > >
> > > > I'm wondering if anyone has any ideas on how to make a
> > > > login site more secure. Since I'm not really sure if
> > > > I've explained myself well enough and don't really
> > > > know how else to say it, I'll just give examples and
> > > > then you guys can follow suit and mention some
> > > > oversights:
> > > >
> > > > I have a regular logon: username and password. What it
> > > > does is, when the user types in a name and pword, it
> > > > forwards to another PHP page (a 'middleman' page that
> > > > is there just to compare usernames and pwords),
> > > > validates by checking the SQL database, then header
> > > > forwards to the login page. A cookie is created, and
> > > > voila, you're allowed into what we'll call the
> > > > 'account pages'. Now, here's my 'security' (notice the
> > > > quotes):
> > > > 1. You can't log in when the URL includes a username
> > > > and/or a password (so that no one can make direct
> > > > links).
> > > > 2. Same with an account page: you're redirected to the
> > > > login page if you include a username and pword when
> > > > linking to an account page.
> > > > 3. The 'middleman' page also has this protection: you
> > > > cna't directly link to it with a username and pword in
> > > > the URL. Basically, users can't get into anything when
> > > > they include a username and pword in the URL.
> > > > 4. Obviously, you don't get access if your username
> > > > and password don't match anything in the database
> > > > (thought I'd mention it even though it goes without
> > > > saying).
> > > > 5. You can't login from a page that isn't on the
> > > > server.
> > > >
> > > > Is there any validation or security holes that I'm
> > > > overlooking?
> > > >
> > > >
> > >
> > > at least this two:
> > >
> > > 1. Use SSL
> > > 2. Store passwords MD5 encrypted in the DB
> > >
> > >
> > >
> > > Sincerely,
> > >
> > > Maxim Maletsky
> > > Founder, Chief Developer
> > >
> > > www.PHPBeginner.com   // where PHP Begins


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



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




RE: [PHP] return multiple value from function

2002-04-29 Thread Cal Evans

no, it's not possible to do it that way.  If you need to return multiple
values from a function, your best bet is to return an array or some kind of
record structure.

By design, in almost all languages, functions only return a single value.
=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: sanjay [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 9:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] return multiple value from function


Hi List,

I am new to php programming and wanted to know if it is possible to return
multiple value from a function like cgi programs.
How can I get the following result using php.

($var1, $var2) = myfunction($a,$b);


function myfunction($c,$d)
{
   // code
// code
return ($e,$f);
}


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



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




RE: [PHP] Text File Formating.

2002-04-29 Thread Cal Evans

the manual is your friend.

http://www.php.net/manual/en/function.nl2br.php


*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*
 

-Original Message-
From: Randum Ian [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 10:20 AM
To: PHP
Subject: [PHP] Text File Formating.


Hi there,

I have got various text files which I need to convert on the fly to HTML
with PHP.

How do I convert this:

--- TEXT ---
CHART RETURN

Chart Date: blah

No. Artist - 'Track (Remix)' (Label)

1. blah - 'blah (blah mix)' (blah)
--- END TEXT---

to this:

--- HTML ---
CHART RETURN

Chart Date: blah

No. Artist - 'Track (Remix)' (Label)

1. blah - 'blah (blah mix)' (blah)
--- END TEXT---

Any help much appreciated, Ian.
---
Randum Ian
DJ / Reviewer / Webmaster, DancePortal (UK) Limited
[EMAIL PROTECTED]
http://www.danceportal.co.uk
DancePortal.co.uk - Global dance music media


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



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




RE: [PHP] Secure MySQL connections in PHP with 'stunnel'

2002-04-29 Thread Cal Evans


My suggestion, if you just want to move data between the 2 servers, is to
mysqldump to a file, scp the file to the destination server and then mysql <
filename to get it into the second server.  You can't do it under
programmatic control but it will work and your data will remain secure in
transport.

=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Stefen Lars [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 10:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Secure MySQL connections in PHP with 'stunnel'


Hello all

I have written a very simple PHP script to copy the data from one MySQL
database table on SERVERA to another MySQL database table on SERVERB.

Using PHP, I simply connect to each server and copy the data across. That
works well.

However, natively, MySQL works with clear text. i.e. the data is copied
across the Internet in clear text (a bad thing).

I would now like encrypt the MySQL data between SERVERA and SERVERB.

After searching with Google, I see that stunnel is a tool to use.

However, I have been trying with no avail to create an encrypted connection
between the two servers from MySQL to work.

Following the instructions at:
http://www.zataz.net/php-stunnel-tuneling.php

I have come up with the following:

SERVERA (master)
/usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERA:3307
/usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d
3307 -r 3306

SERVERB (slave)
/usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERB:3307
/usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d
3307 -r 3306

This does not work. When I connect to the slave with:



and select / insert data into SERVERB, the data is selected / inserted to
the database on SERVERA. This is very strange.

Has anyone else tried using stunnel to achieve what I want to do? If so, I
would REALLY like to hear how you achieve the encrypted link.

Or are there other ways of securely coping data from one MySQL server to
another?

Using stunnel seems rather fiddly…

Any comments on this subject will be well received.

Stefen




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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



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




RE: [PHP] javascript and PHP

2002-04-29 Thread Cal Evans

since php runs on the server, not on the client, you have to pass the value
of data back to the server.   Normally, this is done via a GET or a POST
from a form or by building a URL and using javascript to load it. (i.e.
document.location = 'http://myserver.com/mypage.php?data=Hello%20World';)

Then your PHP script can execute and see the value of $_GET['data']

HTH,
Cal

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Steve Buehler [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 10:30 AM
To: [EMAIL PROTECTED]
Subject: [PHP] javascript and PHP


Does anybody know of a good/short tutorial about passing variables from
JavaScript to/from PHP?  For example, how to do the following:




data = "hello world";



";
?>



The above might at least give me a clue.  Just a note.  I really know
nothing to speak of about JavaScript.

Thanks in Advance
Steve


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




RE: [PHP] Cannot add header information

2002-04-29 Thread Cal Evans

It means that something has already output to the outbuffer in unbuffered
mode. Therefore, whatever header operation you are trying to do (start a
session? redirect?) cannot be done.

IMHO, the biggest culprit of this is blank lines in your include files.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Bo Pritchard [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 12:02 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Cannot add header information


I know without the accompanying code there's no way to help me...But without
having to get real specific what does the following message tell me is
wrong?

Thanks

Warning: Cannot add header information - headers already sent by (output
started at /home/omnidevi/omnidevices-www/s-cart/form.phtml:4) in
/home/omnidevi/omnidevices-www/s-cart/shop-head.phtml on line 44




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



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




RE: [PHP] In Addition to [PHP] PHP Security

2002-04-29 Thread Cal Evans

While I've never actually had that happen (If Apache crashes, NOTHING goes
out the socket...not the source to the page) in short, there is very little
that you can do to protect yourself against this. For PHP to get to the
file, it has to be readable but the user that Apache is running under. Since
include files get shoveled in before the page is executed, if Apache were to
spew the source, your include files would go with it.

That being said, I keep all my passwords in include files and keep the
include files in directories that Apache can't serve directly.  This
provides some level of comfort. (but not a lot)

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Jan Peuker [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 1:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] In Addition to [PHP] PHP Security


Sorry for answering with a new question.
But, what's if, say, the PHP-Parser crashes (or a filename is changed) and
Apache returns the source. How is it simply possible to store passwords
somewhere a httpd-users won't see it? (e.g. in the includes-Folder, am I
right?)
And are session-variables send per post or does the next script reads it
from the session-file so nobody can't read them?
Regars,

Jan Peuker

- Original Message -
From: "Miguel Cruz" <[EMAIL PROTECTED]>
To: "Jay Fitzgerald" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, April 29, 2002 8:33 PM
Subject: Re: [PHP] PHP Security


> On Mon, 29 Apr 2002, Jay Fitzgerald wrote:
> > Can someone point me in the right direction in determining just how
secure
> > PHP really is?
>
> What are you actually trying to find out?
>
> As far as actual security problems in PHP, where the interpreter behaves
> contrary to documentation when provided with extraordinary inputs, the
> team has been very responsive with fixes (in contrast with, say,
> Microsoft).
>
> If you are wondering about the security of any given application developed
> in PHP, well, that's up to the developers of that application.
>
> miguel
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



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




RE: [PHP] Is it possible to verify that a form submision is not being "spoofed"?

2002-04-30 Thread Cal Evans

Generate a random number when creating a form, store it in the session and
in a hidden on the form. Then when the post comes back, make sure the hidden
is there and that it matches the one in the session.

Cal
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Warrick Wilson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 2:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Is it possible to verify that a form submision is not
being "spoofed"?


I'm having a hard time explaining what I'm trying to do, which is why I'm
having a hard time finding anything online/in manuals...

My site serves a form for the user to fill in. User has been authenticated
with a login and we're using PHP 4 sessions. When using Internet Explorer,
the user can hit Ctrl-N and get a new window, but his session for that new
window is still valid. He could then load up a local page and submit it to
the target of my original form.

Is there some way of detecting that the submission came from a page that
hadn't been served up by my application, but was instead sent in from some
other "foreign" form?

Or maybe the question is - how can I kill off sessions if the user navigates
away from the page that I sent him originally?


Warrick Wilson
mailto:[EMAIL PROTECTED]


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



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




RE: [PHP] Self Destruct code

2002-05-07 Thread Cal Evans

IANAL!

It's against the law in most states to create booby-traps in your code.

As others have suggested, don't turn over the code until you've received
payment. IMHO, you really should have specified the payment schedule in your
contract.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: PHPCoder [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 07, 2002 3:20 AM
To: php-general
Subject: [PHP] Self Destruct code


Hi
I have a funny request; I wrote a system for a client and am rather
concerned that I am not going to receive payment for the work done. They
want me to hand over the code before they are willing to pay, so
basically I will be left at their mercy; if they don't pay, they will
still have a working version of the system...
So, is there any way I can inconspicuously code in some boo-boo's that
are time related etc. Something that will bomb the mysql tables or break
some code if it is not "unlocked" within a month etc.
I'm not sure if people out tjere might have existing safeguard tools
etc, so I'm open for suggestions.
PS, I know about Zend's encrypter, but since it will live on their
server, I don't think it will help much since they will need the
decrypter on there anyway right?

Thanks


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



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




  1   2   >