Re: [PHP] Strtotime returns 02/09/2008 for "next Saturday"....

2008-01-31 Thread Mike Morton
Good point ;)

Except that generally, when am told "next Saturday" - I take that to mean
"the next Saturday" - just one more ambiguity in the english language that
makes it so hard to learn I suppose!

The odd thing about this whole situation it that it seems to have cropped up
just after we "upgraded" to 4.3.9 - prior to that, "next Saturday" worked
just peachy.  I wish I knew which version we were running before that - but
that record was not kept.

I guess we are stuck with this, what maybe is a problem with this version,
until the Redhat RPM gets higher than 4.3.9 - since that is what our server
manager uses for updates

I could always adjust it to be:

date("m/d/Y",strtotime("+ ".(6-date("w"))." days"));

That should always return the next Saturday of the week, and if I am correct
in my thinking, then even on the Saturday, 6-6 = 0 - which would return that
day... Which does, at least for my application of it, work.

I am not sure how the bug that "next" = +2 rather than +1 applys here, maybe
it is just not understanding how exactly the "next whatever" syntax is
applied


On 1/31/08 12:57 PM, "Richard Lynch" <[EMAIL PROTECTED]> wrote:

> Maybe it's just me, but I've never quite figured out what people mean
> when they say "next Saturday"...
> 
> Do they mean the next one coming up?
> 
> Or do they mean that there's "this Saturday" coming up and "next
> Saturday" the one after that?
> 
> And if I can't figure it out, why would you expect PHP to figure it out?
> 
> :-)
> 
> On Thu, January 31, 2008 10:27 am, Mike Morton wrote:
>> Ya - the other server is 4.4.7
>> 
>> However - this does not seem to be the problem necessarily:
>> 
>> print date("m/d/Y",strtotime("next saturday"));
>> 02/09/2008
>> 
>> print date("m/d/Y",strtotime("next sunday"));
>> 02/10/2008
>> 
>> print date("m/d/Y",strtotime("next monday"));
>> 02/11/2008
>> 
>> print date("m/d/Y",strtotime("next tuesday"));
>> 02/12/2008
>> 
>> print date("m/d/Y",strtotime("next wednesday"));
>> 02/13/2008
>> 
>> print date("m/d/Y",strtotime("next thursday"));
>> 02/07/2008
>> 
>> So from today to next Thursday, the dates are all 1 week off?
>> 
>> On 1/31/08 11:03 AM, "Tom Chubb" <[EMAIL PROTECTED]> wrote:
>> 
>>> On 31/01/2008, Mike Morton <[EMAIL PROTECTED]> wrote:
>>>> 
>>>> I have been using:
>>>> 
>>>> $nextSaturday= date("m/d/Y",strtotime("next saturday"));
>>>> 
>>>> For months long time now with out problems, but in the last two
>>>> days, it
>>>> went kind of funky.  It is now returning:
>>>> 
>>>> 02/09/2008 instead of the expected 02/02/2008.  I have tried the
>>>> same code
>>>> on another server and different version of PHP,and it works ok.
>>>> 
>>>> More info:
>>>> 
>>>> Shell date: Thu Jan 31 09:44:50 EST 2008
>>>> echo date("Y-m-d g:i A T", time()); = 2008-01-31 10:00 AM EST
>>>> echo date("Y-m-d g:i A T", strtotime("next saturday")); =
>>>> 2008-02-09 12:00
>>>> AM EST
>>>> 
>>>> version: 4.3.9  (highest version we can have at the moment)
>>>> 
>>>> I could not find this in the known bugs from this version
>>>> 
>>>> So - is this something that is server or version specific?
>>>> 
>>>> TIA!
>>>> 
>>>> --
>>>> Cheers
>>>> 
>>>> Mike Morton
>>>> 
>>>> 
>>>> *
>>>> * Tel: 905-465-1263
>>>> * Email: [EMAIL PROTECTED]
>>>> *
>>>> 
>>>> 
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>> 
>>>> 
>>> The manual says:
>>> *Warning*
>>> 
>>> In PHP versions prior to 4.4.0, *"next"* is incorrectly computed as
>>> +2. A
>>> typical solution to this is to use *"+1"*.
>>> 
>>> Dunno if that helps you out? Is the other server > 4.4.0?
>>> http://uk3.php.net/strtotime
>> 
>> --
>> Cheers
>> 
>> Mike Morton
>> 
>> 
>> *
>> * Tel: 905-465-1263
>> * Email: [EMAIL PROTECTED]
>> *
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
> 

-- 
Cheers

Mike Morton


*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*


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



Re: [PHP] Strtotime returns 02/09/2008 for "next Saturday"....

2008-01-31 Thread Mike Morton
Ya - the other server is 4.4.7

However - this does not seem to be the problem necessarily:

print date("m/d/Y",strtotime("next saturday"));
02/09/2008

print date("m/d/Y",strtotime("next sunday"));
02/10/2008

print date("m/d/Y",strtotime("next monday"));
02/11/2008

print date("m/d/Y",strtotime("next tuesday"));
02/12/2008

print date("m/d/Y",strtotime("next wednesday"));
02/13/2008

print date("m/d/Y",strtotime("next thursday"));
02/07/2008

So from today to next Thursday, the dates are all 1 week off?

On 1/31/08 11:03 AM, "Tom Chubb" <[EMAIL PROTECTED]> wrote:

> On 31/01/2008, Mike Morton <[EMAIL PROTECTED]> wrote:
>> 
>> I have been using:
>> 
>> $nextSaturday= date("m/d/Y",strtotime("next saturday"));
>> 
>> For months long time now with out problems, but in the last two days, it
>> went kind of funky.  It is now returning:
>> 
>> 02/09/2008 instead of the expected 02/02/2008.  I have tried the same code
>> on another server and different version of PHP,and it works ok.
>> 
>> More info:
>> 
>> Shell date: Thu Jan 31 09:44:50 EST 2008
>> echo date("Y-m-d g:i A T", time()); = 2008-01-31 10:00 AM EST
>> echo date("Y-m-d g:i A T", strtotime("next saturday")); = 2008-02-09 12:00
>> AM EST
>> 
>> version: 4.3.9  (highest version we can have at the moment)
>> 
>> I could not find this in the known bugs from this version
>> 
>> So - is this something that is server or version specific?
>> 
>> TIA!
>> 
>> --
>> Cheers
>> 
>> Mike Morton
>> 
>> 
>> *
>> * Tel: 905-465-1263
>> * Email: [EMAIL PROTECTED]
>> *
>> ****
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
> The manual says:
> *Warning*
> 
> In PHP versions prior to 4.4.0, *"next"* is incorrectly computed as +2. A
> typical solution to this is to use *"+1"*.
> 
> Dunno if that helps you out? Is the other server > 4.4.0?
> http://uk3.php.net/strtotime

-- 
Cheers

Mike Morton


*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*


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



[PHP] Strtotime returns 02/09/2008 for "next Saturday"....

2008-01-31 Thread Mike Morton
I have been using:

$nextSaturday= date("m/d/Y",strtotime("next saturday"));

For months long time now with out problems, but in the last two days, it
went kind of funky.  It is now returning:

02/09/2008 instead of the expected 02/02/2008.  I have tried the same code
on another server and different version of PHP,and it works ok.

More info:

Shell date: Thu Jan 31 09:44:50 EST 2008
echo date("Y-m-d g:i A T", time()); = 2008-01-31 10:00 AM EST
echo date("Y-m-d g:i A T", strtotime("next saturday")); = 2008-02-09 12:00
AM EST

version: 4.3.9  (highest version we can have at the moment)

I could not find this in the known bugs from this version

So - is this something that is server or version specific?

TIA!

-- 
Cheers

Mike Morton


*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*


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



[PHP] Encryption in PHP - mcrypt and alternatives

2004-07-05 Thread Mike Morton
I have a need for an encryption program that can encrypt/decrypt data.  I
previously had a programmer build me a C program that compiled and runs on
the command line, which I would then call via PHP.

We are experiencing with this however, a 5-7% fail rate on the decryption -
not acceptable for the application.  At this point the programmer is blaming
the mcrypt libraries for the problem - I suspect not, but not being a C
programmer, cannot refute this.

So, the next step was to use Mcrypt Libraries through PHP. They are not
compiled into our PHP version - 4.1.2, and we cannot re-compile PHP.  First
reason is that the server runs Plesk 5, and the original compile was done
off server  (you know - host provider - install via disk image, etc).
Bottom line, PHP cannot be re-compiled with mcrypt.

Finally, I tried dynamically loading he libmcrypt.so library - compiled just
this morning specifically for this application.  No go.  It would not load
from the php.ini file, and when I tried to load it on a page, using the dl()
function - I got the error:

Invalid library (maybe not a PHP library) 'libmcrypt.so'

So at this point I am at a total loss.  I cannot hash the data, I need it to
be decrypted at another point as well.

So, I guess I am asking this:

1.  Is there any reasonably priced C programmer that would like to talk to
me about fixing/re-writing this encryption program.
2.  Have I overlooked anything with the dynamic loading of the mcrypt
libraries.
And
3.  Am I missing another alternative for securely encrypting/decrypting data
in PHP?  Short of re-compiling or such.

Thanks in advance!


--
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] Site slowdown, elminating possibilities.

2004-01-06 Thread Mike Morton
Hey everybody.  I am trying to eliminate possibilities for a site that is
slowing down, and was hoping that you all could pick apart some code for me
to see if there is some optimizations that you may suggest that may make
some significant difference.

The code in question here is called EVERY page to keep track of a users
activity status.  It is code I have used before elsewhere, without problems,
but as I said, I am trying to eliminate possible problems.

Without Further Ado:

//this is the sessions file that records actions and movement of the
customer
[EMAIL PROTECTED]("localhost","","");
@mysql_select_db("tienda");

session_start();

$SID_VAR=explode("=",SID);
if(isset($SID_VAR[1])) { $PHPSESSID=$SID_VAR[1]; }

if($PHPSESSID) {
[EMAIL PROTECTED]("select * from orders where
session_id='$PHPSESSID'",$c);
[EMAIL PROTECTED]($res);
//if it exists - update the last_active field.  if not - create it.
if(strlen($row[session_id]) > 0) {
[EMAIL PROTECTED]("update orders set last_active=now() where
session_id='$PHPSESSID'",$c);
} else {
[EMAIL PROTECTED]("insert into orders set
session_id='$PHPSESSID',affiliate_id='$aid',session_start=now(),status='1'",
$c);
}

if(strlen($aid) > 0) {
[EMAIL PROTECTED]("update orders set affiliate_id='$aid' where
session_id='$PHPSESSID'",$c);
}
}

//load the sessions now.
[EMAIL PROTECTED]("select * from orders where session_id='$PHPSESSID'",$c);
[EMAIL PROTECTED]($res);

//we are going to do affiliate calculations here - if there is an aid then
we are going 
//to consider this a clickthrough.
if($aid) {
//check to see if there is an affiliate by that id first.
$res=mysql_query("select affiliate_id from affiliates where
affiliate_id='$aid'",$c) or die(mysql_error());
$row=mysql_fetch_array($res);
if(strlen($row[0]) > 0) {
$current_date=date("Y-m-d");
//we have an affiliate id - decide if this is an insert or update.
$res=mysql_query("select affiliate_id from affiliate_stats where
affiliate_id='$aid' and stat_date='$current_date'",$c) or
die(mysql_error());
$row=mysql_fetch_array($res);
if(strlen($row[0]) > 0) {
//we are updating
$res=mysql_query("update affiliate_stats set hits=(hits+1) where
affiliate_id='$aid' and stat_date='$current_date'",$c) or
die(mysql_error());
} else {
//we are inserting
$res=mysql_query("insert into affiliate_stats set
hits='1',stat_date='$current_date',affiliate_id='$aid'",$c) or
die(mysql_error());
}
}

}

As I mentioned - nothing strange, odd, or anything that should cause a large
slowdown in the database.

Running PHP 4.3.2, Mysql 3.23.whatever  The 'orders' database you see here
is really light, 16K rows only, and the sessions_id field is indexed.

I am seeing a number (50-60) sleeping processes in the mysql server, not
sure how they got there, why, or even if they would affect the speed, but
that has been sent to the mysql list anyhow :)

If anyone has any suggestions, criticisms or witty remarks, they are all
accepted :)

TIA 


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



Re: [PHP] Apache 2 + PHP

2003-12-06 Thread Mike Morton
Yves:

I am not sure of the exact technical issues that affect it, but when I was
forced to use it in a production environment (does anyone actually admit to
CHOOSING to use it?  anyway) I received a lot of errors on includes,
intermittently.  This was most noticable when using phpmyadmin - but it was
noticed throughout the application.  Errors including a file, then you
refresh and there are no errors.

In general the webserver was very unstable, prone to hanging processes and
needing the webserver stopped and restarted.  In the beginning it was no big
deal - once twice a week, but in the last 3 weeks it has been 5-6 times a
day.

We just switched to Apache 1.3.2 (using PHP 4.3.4 on both machines.) and we
have had 0 problems across the board in 3 days of operation now.

So there you go - if you are OK with instability then go for it - if not,
choose Apache 1.3.x

PS.  Anyone out there know/work with PLESK?  6.0 comes with Apache 2.0 and
PHP 4.3.something - I want to 'downgrade' it to apache 1.3 - but *shrug* no
idea.  If there is anyone out there that has done It successfully, msg me
offline to chat.  WHY OH WHY do these companies not work WITH the php
community?  If only they had asked  Itools is the same way (server
manager for Mac OSX - for the love of GOD DO NOT EVER USE IT! That is
what was forced upon us and caused the above problems - you could not use it
unless you used Apache 2, and they 'said' that there are no 'instabilities'
with PHP - either they lied or just have a terrible QC division!!!)

On 12/5/03 1:00 PM, "Yves Arsenault" <[EMAIL PROTECTED]> wrote:

> 
> Would anyone know of the issues that might affect PHP 4.3.4 and Apache
> 2.0.48 ?
> 
> Thanks,
> 
> Yves
> 
> -Original Message-
> From: Martin Hudec [mailto:[EMAIL PROTECTED]
> Sent: 5 décembre 2003 10:52
> To: PHP-General
> Subject: Re: [PHP] Apache 2 + PHP
> 
> 
> Hi there,
> 
> when I had Gentoo Linux, I was using Apache 2.0.48 with PHP 4.3.4 installed
> from Gentoo portage. It was running <10 smallscale php/mysql based
> virtualhosts without any difficulties.
> 
> On Friday 05 December 2003 15:24, Yves Arsenault wrote:
>> Is this warning outdated?
>> http://www.php.net/manual/en/install.apache2.php
>> "Do not use Apache 2.0 and PHP in a production environment neither on Unix
>> nor on Windows."
>> I'm running RedHat 9.
>> 
>> I've got Apache 2.0.48 running and was ready to install the latest php
>> 4.3.x..
>> Just thought I would check.
> --
> :
> :. kind regards
> :..  Martin Hudec
> :.:
> :.: =w= http://www.aeternal.net
> :.: =m= +421.907.303393
> :.: [EMAIL PROTECTED] [EMAIL PROTECTED]
> :.:
> :.: "When you want something, all the universe
> :.:   conspires in helping you to achieve it."
> :.:   - The Alchemist (Paulo Coelho)
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] Mail() Function on Cobalt Raq 4

2003-10-22 Thread Mike Morton
Have you checked the mail logs (should be /var/log/mail.log or something
similar) you could be getting errors from the mail server rather than the
php side.  I have had it where I thought that it was php but it turned out
be a local relaying error


)On 10/22/03 10:16 AM, "Peter Graber" <[EMAIL PROTECTED]> wrote:

> Using a Cobalt Raq 4 w/php 4.3.1.   The sendmail_path is :
> /usr/sbin/sendmail -t -iThis seems to be right.
> 
> Can't get mail to send.  Script works on other servers without fail.
> 
> PHP Info here: http://www.ncafp.com/cgi-bin/phpInfo.php

--
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] PHP 4.3.3 and Apache 2

2003-10-14 Thread Mike Morton
I know this has been discussed in the past - but I wanted to check in with
the group to see if anything has changed.

I have the opportunity to start with a clean webserver running Apache
22.0.40 with PHP 4.3.3

This is a fairly high volume site that will be run on here - with a great
deal of MYSQL interaction.

In the past I have read that php is not ready for apache 2 (or vice versa -
whatever the case...) and there are some problems with stability.

Is this still the case?  Is it time to run a production site with this
combo?  Any experiences with other high volume sites running an apache 2/php
combo?

Any suggestions are appreciated :)

TIA 

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



Re: [PHP] Brain cramp with arrays

2003-09-19 Thread Mike Morton
Hmm - ya - I could do that :)

But then again that would be 2 easy!  What I ended up doing is databasing
the help system and retaining a 'rank order' in there - so that I can always
quickly calculate the next and previous - dunno why I did not do that in the
first place - but there it is :)

Thanks for the suggest Tom!


On 9/19/03 11:13 AM, "Tom Rogers" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Saturday, September 20, 2003, 12:49:52 AM, you wrote:
> MM> I am having a total brain cramp with this array problem (may have to do
> with
> MM> the pressure change from the hurricane - but whatever ;) )
> 
> MM> $helpsystem[onlineusignuphelp_username]='The username that you choose must
> MM> be more than 5 characters and 20 or less characters in length.  The
> username
> MM> must contain only numbers and letters.';
> MM> $helpsystem[onlineusignuphelp_password]='The password that you choose must
> MM> be more than 5 characters and 26 or less characters in length.  The
> username
> MM> may contain only numbers,letters, and the following characters:! @ # %
> ^
> MM> *';
> 
> MM> I am building a help system of sorts.  I have the following 2 array
> members
> MM> above (set exactly as such).  When I call the page it displays like:
> 
> MM> Print $helpsystem[$_GET[tip]]
> 
> MM> I would like to display a next and previous link to help items where
> MM> possible, the problem that I am having is figureing out how to get the
> next
> MM> and previous indexes.  I can get the current key with the key() function,
> MM> and the text for the next and previous using next() and and prev() but
> MM> because the help is called by the key, I need the index to call the array
> MM> item in the url:
> MM> Help.php?tip=onlinusignuphelp_password
> 
> MM> I cannot seem to find a way to get even the current index number (i.e. 0)
> so
> MM> that I can add and subtract one to that index number...  Can anyone help
> out
> MM> with a pointer on how to get the next and prev keys?
> 
> MM> Thanks ;) 
> 
> MM> --
> MM> Cheers
> 
> MM> Mike Morton
> 
> MM> 
> MM> *
> MM> * Tel: 905-465-1263
> MM> * Email: [EMAIL PROTECTED]
> MM> *
> MM> 
> 
> MM> "Indeed, it would not be an exaggeration to describe the history of the
> MM> computer industry for the past decade as a massive effort to keep up with
> MM> Apple."
> MM> - Byte Magazine
> 
> MM> Given infinite time, 100 monkeys could type out the complete works of
> MM> Shakespeare. Win 98 source code? Eight monkeys, five minutes.
> MM> -- NullGrey 
> 
> 
> One way is to change your array layout like this
> 
> $helpsystem = array(
>   0 => array(
>   'title'=>'username',
>   'content'=>'The username that you choose must'),
>   1 => array(
>   'title' =>'password',
>   'content'=>'The password that you choose must));
> 
> Then it is easy to navigate as the next and previous will always be numerical
> keys

--
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] Brain cramp with arrays

2003-09-19 Thread Mike Morton
I am having a total brain cramp with this array problem (may have to do with
the pressure change from the hurricane - but whatever ;) )

$helpsystem[onlineusignuphelp_username]='The username that you choose must
be more than 5 characters and 20 or less characters in length.  The username
must contain only numbers and letters.';
$helpsystem[onlineusignuphelp_password]='The password that you choose must
be more than 5 characters and 26 or less characters in length.  The username
may contain only numbers,letters, and the following characters:! @ # % ^
*';

I am building a help system of sorts.  I have the following 2 array members
above (set exactly as such).  When I call the page it displays like:

Print $helpsystem[$_GET[tip]]

I would like to display a next and previous link to help items where
possible, the problem that I am having is figureing out how to get the next
and previous indexes.  I can get the current key with the key() function,
and the text for the next and previous using next() and and prev() but
because the help is called by the key, I need the index to call the array
item in the url:
Help.php?tip=onlinusignuphelp_password

I cannot seem to find a way to get even the current index number (i.e. 0) so
that I can add and subtract one to that index number...  Can anyone help out
with a pointer on how to get the next and prev keys?

Thanks ;) 

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



Re: [PHP] Can't Connect Within Function?!

2003-09-01 Thread Mike Morton
You need to read up on the scope of variables within functions.

You should have something like:

function 
getUserPermissions($shs_MySQLServer,$shsMySQLUser,$shs_MySQLPassword) {
 if ($_SESSION['permissions'] == '') {
 // Connecting, selecting database
 $link = mysql_connect($shs_MySQLServer, $shs_MySQLUser,
 $shs_MySQLPassword)
 or die("MySQL Connect Error : " . mysql_error());
 
 etc
 }
}

And call it with:
GetUserPermissions("server","user","password") where server,user and
password are the variables that contain those values.


On 9/1/03 2:20 PM, "Seth Willits" <[EMAIL PROTECTED]> wrote:

> If I try to connect to a database within a function, I get the
> following error. Why is this?
> 
> 
> MySQL Connect Error : Can't connect to local MySQL server through
> socket '/Private/tmp/mysql.sock' (2)
> 
> function getUserPermissions() {
> if ($_SESSION['permissions'] == '') {
> // Connecting, selecting database
> $link = mysql_connect($shs_MySQLServer, $shs_MySQLUser,
> $shs_MySQLPassword)
> or die("MySQL Connect Error : " . mysql_error());
> 
> etc
> }
> }
> 
> 
> Seth Willits
> 
> ---
> President and Head Developer of Freak Software - http://www.freaksw.com
> Q&A Columnist for REALbasic Developer Magazine -
> http://www.rbdeveloper.com
> Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames
> 
> "When purchasing that gift for your Special Someone guys remember, girls
> like cute things. If it makes you want to puke, your chick will totally
> love it."
>-- Someone else out There
> 
> ---

--
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] Mail() error in logs

2003-08-31 Thread Mike Morton
Hey there - quick question - until a week ago, the mail() function I am
using to email confirmations was working fine, now the following error is
showing up in the logs:

Aug 31 11:50:26 www2 sendmail[29579]: h7VFoQc7029579: localhost [127.0.0.1]
did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA

This error shows up for each mail going out - no matter where it is going to
- and that could be one of 4 addresses (an internal, the customers email,
and 2 external addresses including a hotmail account).

Is this a php thing that I am missing a setting for the mail() function?  Or
is this a problem with the local mail server perhaps?

The following are the settings (on OS X btw):
ini_set(sendmail_path, "/usr/sbin/sendmail -t -f mail.vtc.com");
$headers = "From: VTC Orders <[EMAIL PROTECTED]>\r\n";
$subject="Order Confirmation from VTC";
$body="A bunch of things that will have no affect on the the email it's
self";
mail("[EMAIL PROTECTED]",$subject,$body,$headers);

I am not aware of anything that has changed since this worked last (actually
about 3 days ago) except that the company has messed with their internal
mail server - still - this error is showing for ALL emails going out - not
just the ones being delivered internally - and their internal mail server is
running on an entirely different server anyhow.

So - is there something that I am missing - and if it is not a php error
just say so WITHOUT FLAMES and I will check it out somewhere else.

TIA.


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



Re: [PHP] Array Push and Keys

2003-08-29 Thread Mike Morton
The code that I ended up using was:

$res=mysql_query("select distinct dealercode from transactions where
dealercode!='' order by dealercode",$intranet);
$count=0;
while($row=mysql_fetch_array($res)) {
$amt=mysql_query("select sum(amount) as total from transactions where
date between '2003-04-01' and '2003-06-31' and
dealercode='$row[dealercode]'",$intranet);
$afftotal=mysql_fetch_array($amt);
$transactions[$row[dealercode]]["onlineu"]=$afftotal[total];
$amt=mysql_query("select usercountry,sum(amount) as total from
orders_placed where date between '2003-04-01' and '2003-06-31' and
dealercode='$row[dealercode]' and sent='y' group by usercountry",$intranet);
while($cdtotal=mysql_fetch_array($amt)) {

$transactions[$row[dealercode]][$cdtotal[usercountry]]=$cdtotal[total];
}
}



On 8/29/03 11:38 AM, "John W. Holmes" <[EMAIL PROTECTED]> wrote:

> Ford, Mike [LSS] wrote:
> 
>> Having said that, I've just given you a clue: since array_push($array, $var)
>> is equivalent to $array[] = $var, you can get the result you want by doing:
>> 
>>$array[] = array($k, $v);
>> 
>> (with, of course, appropriate values for $array, $k and $v substituted to
>> suit your code!).
> 
> Shouldn't that be:
> 
> $array[$k] = $v;

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



Re: [PHP] Array Push and Keys

2003-08-29 Thread Mike Morton
And as a follow up, from the phpbuilder list where I posted the very same
question today, I think this answers the question:
"I don't think its a bug. I think the problem you're having is to do with
what type of argument you can give to array_push. There are two
possibilities ... 

1) variable 
2) array 

If you pass a single item (1), then no problem, works as expected.
However, if you pass an array(2), then it concats this array onto the target
array. 

So, maybe its taking for 2nd argument array($key => array($u, $v)) and
converting into array($key, array($u, $v)) and then concat'ing it to the
target array. "


 On 8/29/03 11:18 AM, "Mike Morton" <[EMAIL PROTECTED]> wrote:

> Look - David - I do appreciate your efforts to help - and I realize that
> working blind on an email list is tough, but the question is not about the
> structure of the code, the database, reserved words or anything else.
> 
> The question for anyone out there is simple - does array_push allow you to
> push key=>value pairs?  That is what is causing errors - nothing else,
> everything else is a result of inherited systems, and other developers
> crappy design.  I agree with you David on all the issues that you bring up -
> date IS a reserved word - but it still works - that is the previous
> developers mentality anyhow :)
> 
> 
>> "$row[dealercode]" should be "$row['dealercode']", same goes for the other
>> dictionaries. Your code should be throwing a notice on that, which suggests
>> that your error-level is set low and you may be missing other problems.
> 
> Fair if I was coding for anyting other than a one time report - I am not
> going to spend a great deal of time with 'proper' coding for a one time
> report that does not matter beyond it working once.
> 
>> You want a structure like:
>> 
>> array (
>>   33 = array (
>>   'a' = 52.00
>>   'b' = 53.00
>>   'c' = 54.00
>>   )
>>   34 = array (
>>   'a' = 55.00
>>   'b' = 56.00
>>   'c' = 57.00
>>   )
>> )
> 
> yes
> 
>> What's it supposed to look like when 33=>'a' exists more than once? Is that
>> possible?
> 
> It does not 33=>a does not occur more than once.
> 
>> That array_push looks like a mess. Try something like...
>> 
>> $data = array();
>> 
>> for each row in query :
>> 
>> $dealerid = $row[0];
>>   $data[$dealerid] = array();
>> 
>>   for each subrow in subquery :
>>   $country = $subrow[0];
>>   $amount = $subrow[1];
>> 
>>   $data[$dealerid][$country] = $amount;
> 
> This is what I am doing now, and yes it works, but this does not answer my
> original question.
> 
>> Do you have a seperate dealer table? You're pulling "SELECT DISTINCT
>> dealercode FROM transactions", which is odd. Somewhere you may have a table
>> where dealername is associated with dealercode. That's what you should be
>> doing the join against.
>> 
>> If I were you I'd ask on a database-specific mailing list, because it's
>> never faster to do it in software when you can push it all up into the
>> database instead.
> 
> Thanks for the opinion - but I have tried it both ways.  Software in this
> case is faster.  25 seconds execution in PHP, 3 mins in mysql.  But this
> STILL does not answer the original question.
> 
> 
> 
> 
> 
> 
> --
> 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 

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



Re: [PHP] Array Push and Keys

2003-08-29 Thread Mike Morton
Look - David - I do appreciate your efforts to help - and I realize that
working blind on an email list is tough, but the question is not about the
structure of the code, the database, reserved words or anything else.

The question for anyone out there is simple - does array_push allow you to
push key=>value pairs?  That is what is causing errors - nothing else,
everything else is a result of inherited systems, and other developers
crappy design.  I agree with you David on all the issues that you bring up -
date IS a reserved word - but it still works - that is the previous
developers mentality anyhow :)


> "$row[dealercode]" should be "$row['dealercode']", same goes for the other
> dictionaries. Your code should be throwing a notice on that, which suggests
> that your error-level is set low and you may be missing other problems.

Fair if I was coding for anyting other than a one time report - I am not
going to spend a great deal of time with 'proper' coding for a one time
report that does not matter beyond it working once.

> You want a structure like:
> 
> array (
>   33 = array (
>   'a' = 52.00
>   'b' = 53.00
>   'c' = 54.00
>   )
>   34 = array (
>   'a' = 55.00
>   'b' = 56.00
>   'c' = 57.00
>   )
> )

yes

> What's it supposed to look like when 33=>'a' exists more than once? Is that
> possible?

It does not 33=>a does not occur more than once.

> That array_push looks like a mess. Try something like...
> 
> $data = array();
> 
> for each row in query :
> 
> $dealerid = $row[0];
>   $data[$dealerid] = array();
> 
>   for each subrow in subquery :
>   $country = $subrow[0];
>   $amount = $subrow[1];
> 
>   $data[$dealerid][$country] = $amount;

This is what I am doing now, and yes it works, but this does not answer my
original question.

> Do you have a seperate dealer table? You're pulling "SELECT DISTINCT
> dealercode FROM transactions", which is odd. Somewhere you may have a table
> where dealername is associated with dealercode. That's what you should be
> doing the join against.
> 
> If I were you I'd ask on a database-specific mailing list, because it's
> never faster to do it in software when you can push it all up into the
> database instead.

Thanks for the opinion - but I have tried it both ways.  Software in this
case is faster.  25 seconds execution in PHP, 3 mins in mysql.  But this
STILL does not answer the original question.






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



Re: [PHP] Array Push and Keys

2003-08-29 Thread Mike Morton
Correct on the brackets - but not on the results still working...  The code
I had in the email was just a sample - here is the real code...

$res=mysql_query("select distinct dealercode from transactions order by
dealercode",$intranet);
$transactions=Array();
while($row=mysql_fetch_array($res)) {
$amt=mysql_query("select sum(amount) as total from transactions where
date between '2003-04-01' and '2003-06-31' and
dealercode='$row[dealercode]'",$intranet);
$afftotal=mysql_fetch_array($amt);

array_push($transactions,$row[dealercode]=>Array("onlineu",$afftotal[total])
);
$amt=mysql_query("select usercountry,sum(amount) as total from
orders_placed where date between '2003-04-01' and '2003-06-31' and
dealercode='$row[dealercode]' and sent='y' group by usercountry",$intranet);
while($cdtotal=mysql_fetch_array($amt)) {

array_push($transactions[$row[dealercode]],$cdtotal[usercountry]=>$cdtotal[t
otal]);
}
}


And as for your offline suggestion of putting it into one query - I did try
that first of course, but due to the large amount of data, and the shoddy
nature of the database design (inherited not built) the query times out.
This atleast returns within 1 min with the data when I can retrieve it :)

Ideally the database would have one table with all the transaction
information in it, and when I redesign it will, but in the meantime I am
stuck with this...

On 8/28/03 9:09 PM, "David Otton" <[EMAIL PROTECTED]> wrote:

> On Thu, 28 Aug 2003 18:14:39 -0400, you wrote:
> 
>> While($row=mysql_fetch_array($res) {
> 
>> That *should* create the array above, but as I mentioned array_push does not
>> seem to be taking the keys  I just get a Parse error message for the
>> line. (the first array_push)
> 
> Ahem. Count the brackets? :)
> 
> (On a style point, your code would be easier to read for bugs like this if
> you added some whitespace.)

--
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] Array Push and Keys

2003-08-28 Thread Mike Morton
I am trying to loop through some database results to build an array similar
to:

Array (
[33]=>Array (
[usa]=>52.00
[sa]=>553.00
)
)

And the problem that I am having is that array_push does not want to take
keys when I am using it.

My Code:

$transactions=Array();
While($row=mysql_fetch_array($res) {
array_push($transactions,$row[dealercode]=>Array());
$another_query=mysql_query("do another query here");
while($morerows=mysql_fetch_array($another_query)) {

array_push($transactions[$row[dealercode],$morerows[country]=>$morerows[amou
nt];
}
}

That *should* create the array above, but as I mentioned array_push does not
seem to be taking the keys  I just get a Parse error message for the
line. (the first array_push)

Is this is 'bug' (I hate to assume just because I cannot get it to work that
it is a bug ;) ) or am I trying to do something that is better accomplished
with another function?

TIA.



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



Re: [PHP] help with email problem

2003-08-14 Thread Mike Morton
How does the legislation prevent that?  As long as people publish their
email addresses - they are public domain and will be treated as such - do
you want to stop mass snail mailings mailings as well?  As long as people
publish their information it is going to be used/abused - that is the nature
of these people.  I personally am against spam - but my address is in the
public domain - there is nothing that says they cannot take it - and just
because the US makes a law against it does not make it wrong in the rest of
the world.  That is something that the US has seemed to forgotten in the
last few years.  But this is getting too WAY far off topic now - enough from
me ;) 



On 8/12/03 7:02 PM, "Roger B.A. Klorese" <[EMAIL PROTECTED]> wrote:

>> Be real - the legislation is a waste of time and money and will never
> be
>> enforced or enforcable.  Too many 'anonymous' countries willing to
> take
>> money for server hosting in the world.
> 
> Yes, but they're taking money *from* American companies, for the most
> part.  You don't have to punish the remailers if you prevent them from
> having anything to remail.
> 

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



Re: [PHP] help with email problem

2003-08-14 Thread Mike Morton
1.  Find them.
2.  Charge them.
3.  Prove it was them.
4.  Bomb the shit out of the country they used to spam from.
5.  Salute the US flag.
6.  Move to Canada
7.  Comment on the stupid Americans pushing their morals on the rest of the
world
8.  Get Drunk
9. Watch Hockey
10. Enjoy life.

I think that is the bigger challenge! :)


Be real - the legislation is a waste of time and money and will never be
enforced or enforcable.  Too many 'anonymous' countries willing to take
money for server hosting in the world.

On 8/12/03 6:53 PM, "Roger B.A. Klorese" <[EMAIL PROTECTED]> wrote:

> 
>> and how will this be enforced.  waste of legislation imo.
> 
> The same way any law is: by filing criminal charges after the fact.
> 

--
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] Container functions....

2003-08-10 Thread Mike Morton
In a language that I used to program in - for development we used to be able
to make a function that basically just executed everything inbetween:

Print "This is html printed"  Print "this is more
code";


So basically everything in between hidecode and /hidecode is executed the
same as if the hide code did not exist - except that the hidecode container
would be something like:

Function hidecode() {
if(getenv("remoteaddress")=="myaddress") {
%s (all code contained within the tags)
}
}

So - the question is does PHP have some way that I cannot see to do this?

I realize that I could create a function and pass everything in as an
argument - but that would involve putting everything into variables, and
overall being just a pain in the ass to add and remove the container.

Is PHP too sophisticated a language to be able to do this easily and
quickly?  Or am I just missing some form of function that is totally
obvious?

Finally - yes, I know that I could slap an if tag around it - but that is
also a big pain in the ass to add and remove each if tag when you go 'live'
with the change, as opposed to a quick find and replace with a container
function like this...

TIA



--
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] Container Functions Continued.....

2003-08-10 Thread Mike Morton
Thanks to everyone who responded to me so far, but I fear that I have not
explained myself too clearly.

First of all, I understand the argument about having a testing, development
and live servers, however, in the real world not every client can afford
that hardware and it is not always feasable for smaller websites to have all
the equipment.  

So, lets base this on the fact that there is one server that has one URL,
One IP and all development/testing is done on the live website.

Now that I have that out of the way.

What I am trying to accomplish is a function that can contain code blocks,
like an if statement.  Something that would operate like:

developer_execute() {
 execute this code only
}

Where the function developer_execute would be defined as:
function developer_execute() {
if(getenv("REMOTE_ADDR")=="000.000.000.000") {
%body
}
}

Where the %body is the actual code represented by 'execute this code only'
above.

So, the question is, is there a way to create a function like an if function
that does not only reply on the arguments between the ( and ) in the
function call?

Thanks again.



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



Re: [PHP] Container functions....

2003-08-10 Thread Mike Morton
Justin:

Not ColdFusion - ancient language by Brian Fox called MetaHTML - actually a
VERY good language - just not supported or developed anymore as far as I can
tell ;)

Anyhow - that is one solution that I had not thought of - but ideally I
would like to use a function rather than an IF statement - just the anal
developer attutude that is in me ;)

For instance, in an IF statement, is there a way to reference, or access the
code/etc contained within the { } ?  If there was, then this solution:

developer_execute() {
 execute this code only
}

Where the function developer_execute would be defined as:
function developer_execute() {
if(getenv("REMOTE_ADDR")=="000.000.000.000") {
%body
}
}

Would work - I am just hitting the wall as to how to reference the code
between { and } represented in the function definition by %body

Anybody?


On 8/10/03 7:46 PM, "Justin French" <[EMAIL PROTECTED]> wrote:

> Sounds like you're trying to replicated something in ColdFusion?
> 
> I have a few blocks of code on my pages which are only executed on my
> development server, not the live server -- is this what you want?
> 
> if(ereg("192.168.0.",$_SERVER['SERVER_ADDR']))
> {
> $local = 1;
> }
> else
> {
> $local = 0;
> }
> 
> 
> if($local)
> {
> // do whatever you want
> }
> 
> 
> Justin
> 
> 
> On Monday, August 11, 2003, at 12:50  AM, Mike Morton wrote:
> 
>> In a language that I used to program in - for development we used to
>> be able
>> to make a function that basically just executed everything inbetween:
>> 
>> Print "This is html printed"  Print "this is
>> more
>> code";
>> 
>> 
>> So basically everything in between hidecode and /hidecode is executed
>> the
>> same as if the hide code did not exist - except that the hidecode
>> container
>> would be something like:
>> 
>> Function hidecode() {
>> if(getenv("remoteaddress")=="myaddress") {
>> %s (all code contained within the tags)
>> }
>> }
>> 
>> So - the question is does PHP have some way that I cannot see to do
>> this?
>> 
>> I realize that I could create a function and pass everything in as an
>> argument - but that would involve putting everything into variables,
>> and
>> overall being just a pain in the ass to add and remove the container.
>> 
>> Is PHP too sophisticated a language to be able to do this easily and
>> quickly?  Or am I just missing some form of function that is totally
>> obvious?
>> 
>> Finally - yes, I know that I could slap an if tag around it - but that
>> is
>> also a big pain in the ass to add and remove each if tag when you go
>> 'live'
>> with the change, as opposed to a quick find and replace with a
>> container
>> function like this...
>> 
>> TIA

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



Re: [PHP] Localization and Customization of Application

2003-07-22 Thread Mike Morton
Chris:

Thanks for the suggestion - I have peeked through Smarty - not bad - but it
seems that the designer would still need to learn a different syntax.  That
is not an issue for this application however - I have really no need for
separating the template and the code, since the template is already
modifiable through an administration of configs, the problem is strictly the
text modifications.

>From what I see in Smarty (and granted I have not spent hours going through
the docs, just the high level here) I would still have the problem of
creating an interface for the 'merchant' to modify their text in, then
stream that text out to a file

If that is what it ends up being - I am cool with that and can do it - I was
hoping that there may be some convention for doing this that I missed
somewhere (i.e. Using regex to do the text replacements, using SED to do
them or something like that)

But thanks for the suggestion!



On 7/22/03 5:03 PM, "Chris Hubbard" <[EMAIL PROTECTED]> wrote:

> Mike,
> the easiest way to do this would be to use smarty. (smarty.php.net)
> abstract out your language specific strings into a file that is called by
> the template.  Use a variable to define the language and use an assign to
> dynamically change the language file in the template.
> 
> Then build a function that displays a form, one input box per string, that
> then writes to the language specific string file.
> Chris
> 
> 
> -Original Message-
> From: Mike Morton [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 22, 2003 12:39 PM
> To: PHP List
> Subject: [PHP] Localization and Customization of Application
> 
> 
> I am building a shopping cart application similar to OS Commerce.  I am
> trying to build it for expansion and customization right from the start, so
> I have decided to start from the beginning with localization support.
> 
> Basically, I have a file for each shopping cart 'section' that contains the
> text labels as constants:
> define('CART_TITLE',"Shopping Cart");
> define('CART_PAGETEXT',"Click on 'Continue Shopping' to return to the
> website and continue your shopping.  Click on 'Empty Cart' to clear out all
> the products currently in your shopping cart.  Click on \"Checkout\" to fill
> out your billing information and complete your order.");
> define('CART_SKU',"Sku");
> define('CART_NAME',"Name");
> define('CART_QTY',"Qty");
> define('CART_PRICE',"Price");
> define('CART_EXT',"Ext.");
> define('CART_DELETE',"del");
> define('CART_EDIT',"edit");
> 
> The merchant has an administration where they can edit any label in the
> shopping cart to be the language of their choice, or to just change a label
> to be more customized to their needs.
> 
> In the past, I have always done this with databases, i.e. CART_TITLE is a
> database field that gets loaded in the shoppingcart page, and the value is
> the label.
> 
> The trouble that I am having conceptually right now is how to make a user
> interface to modify the text files that define the labels without making the
> merchant download, modify and then upload the file.  That would involve
> 'teaching' them how to do it properly - the whole purpose of this
> application is that it is supposed to be easy for ANYONE to use, no HTML or
> programming experience necessary.
> 
> My first inclination is in the adminitration, to load the label file as an
> array, and split out the fields for editing, then after validation, re-write
> the label file using streams.
> 
> I guess I am wondering if anyone has a more elegant solution than this?
> User interface in the administration is the key here, and the method above
> leaves some UI questions such as 'when viewing the administration page, how
> can the user relate the label called CART_EDIT to the edit button in the
> cart page?'
> 
> If anyone has some experience in doing this, I would appreciate any
> tips/insights, or even recommendations on whether this is a good way of
> localizing the application!
> 
> TIA!
> --
> 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. Wi

[PHP] Localization and Customization of Application

2003-07-22 Thread Mike Morton
I am building a shopping cart application similar to OS Commerce.  I am
trying to build it for expansion and customization right from the start, so
I have decided to start from the beginning with localization support.

Basically, I have a file for each shopping cart 'section' that contains the
text labels as constants:
define('CART_TITLE',"Shopping Cart");
define('CART_PAGETEXT',"Click on 'Continue Shopping' to return to the
website and continue your shopping.  Click on 'Empty Cart' to clear out all
the products currently in your shopping cart.  Click on \"Checkout\" to fill
out your billing information and complete your order.");
define('CART_SKU',"Sku");
define('CART_NAME',"Name");
define('CART_QTY',"Qty");
define('CART_PRICE',"Price");
define('CART_EXT',"Ext.");
define('CART_DELETE',"del");
define('CART_EDIT',"edit");

The merchant has an administration where they can edit any label in the
shopping cart to be the language of their choice, or to just change a label
to be more customized to their needs.

In the past, I have always done this with databases, i.e. CART_TITLE is a
database field that gets loaded in the shoppingcart page, and the value is
the label.

The trouble that I am having conceptually right now is how to make a user
interface to modify the text files that define the labels without making the
merchant download, modify and then upload the file.  That would involve
'teaching' them how to do it properly - the whole purpose of this
application is that it is supposed to be easy for ANYONE to use, no HTML or
programming experience necessary.

My first inclination is in the adminitration, to load the label file as an
array, and split out the fields for editing, then after validation, re-write
the label file using streams.

I guess I am wondering if anyone has a more elegant solution than this?
User interface in the administration is the key here, and the method above
leaves some UI questions such as 'when viewing the administration page, how
can the user relate the label called CART_EDIT to the edit button in the
cart page?' 

If anyone has some experience in doing this, I would appreciate any
tips/insights, or even recommendations on whether this is a good way of
localizing the application!

TIA! 
--
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



Re: [PHP] URL correctimizer ... how to make one?

2003-07-20 Thread Mike Morton
Tell me Curt, where is it copyrighted?  US/Canada/Worldwide?  Where is it
registered?  What do you intended to do to protect your copyright?  What
makes this code unique that it can be copyrighted to you?  Do you understand
copyrighting and intellectual property?  You just made that code public on a
public list - does that nullify the copyright?  Why did you post the code if
it was not with the intent to share?

Perhaps you should think twice/thrice/four-times before you post copyrighted
code - I can guarantee you that it will be used over and over and over by
many a person - and you did not even include a credit in the code.  Silly
boy :)



On 7/20/03 1:26 AM, "Curt Zirzow" <[EMAIL PROTECTED]> wrote:

> I know this isn't your code but...
> 
> * Thus wrote Justin French ([EMAIL PROTECTED]):
>> [...]
>> 
>> // test the URL
>> // it's important that you dont put http:// or it will not work
>> // the 2nd paramater is how long to test the URL b4 timing out
>> $found = fsockopen($url, 10);
> 
> $found = fsockopen($host, $port, $errno, $errstr, $timeout);
> 
>> 
>> // act on it
>> if($found)
>> {  
>> echo "URL http://{$url} could not be found, thus is considered
>> invalid";
> 
> hm... actually this is found but any way but any way since it is found
> might as well check the uri..
> 
> fputs($found, "GET $uri HTTP/1.0\r\nHost: $host\r\n\r\n");
> 
> $status = fgets($found)
> list(proto, $result, $result_text) = split($status);
> if ($result != 200 ) {
> echo "url is bad, give me a better one";
> } else{
> echo "thank you for for the url";
> }
> 
>> }
>> ?>
> 
> and of course 
> fclose($found); //we dont want the rest of the page.
> 
> 
> hmm.. I think I did to much.. just that other peoples code frighten me
> sometimes
> 
> btw, the above code is copyrighted so dont use it.
> 
> cheers,
> 
> Curt

--
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] Array key names - can they be called as strings?

2003-07-17 Thread Mike Morton
Perhaps I was not that clear on the subject :)

I have the following array:

$SAVEVARS[headerimage]=$_POST[headerimage];
$SAVEVARS[backgroundimage]=$_POST[backgroundimage];

I want to iterate through it to save to a database config:

Forach($SAVEVARS as $whatever) {
$query="update table set $whatever=$whatever[$whatever]";
}

Where the 'set $whatever' would become 'set headerimage' and
'=$whatever[$whatever]' would become the value that was posted through and
set on the line above.

The question is the - the assigned string key - is there a way to retrieve
that in a loop?  Foreach, for, while or otherwise?

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



Re: [PHP] PHP POS program

2003-07-16 Thread Mike Morton
Mirek:

> - Of course, it can be done, but will U find someone, who will ever use
> it?   I've worked in a company which has about 170 supermarkets and
> small food stores and there we had a "war" with our POS software
> supplier , so I think, I can tell "I know something about it" It is much
> more complext then it seems to be. E-Commerce is about sitting at home
> and clicking mouse, shop assistants has much more stress then a person
> clicking through e-shop

Tell that to Amazon/Dell!  E-Commerce systems are not as simple as may first
appear either - but I do understand that while I may have the e-commerce
experience, you do have more POS experience than me :)

> - using php/web based interface can be BIG problem due to nature of the
> browser.

Depends on the application

> - POS is "live" system in opposition to the e-commerce which is only
> viewing stock and sending orders.

Untrue - E-commerce as you talk about it here is small shop purchasing -
e-commerce actually encompasses a much larger facet of operations from
fulfillment, CRM, loyalty, etc.

> - POS must be as simple and "stupidity proof" as possible, the other
> thing is mouse, POS must be controlled via keyboard.
> And AFAIK all POS systems, which were written under Windows had no
> succes because of the user interface. So I'm for 5 years out of this
> branche but as I can see in supermarkets, there are still good old MSDOS
> applications.

Any system should be simple and stupid proof, from a website to a CRM or
fulfillment application.  As far as POS being controlled via keyboard -
again, depends on the application.

You are talking about the point of view from a supermarket/multiple
registers, the original question was about a restaurant POS. that is a big
difference! :)

I am not saying that PHP is the be all and end all for this problem - but
what I am saying is that it CAN be done - not necessarily that it should be
done.  A better solution would be say build the interface in PHP - the back
end in MySQL (cause we all know that rocks ;) ) and the printer connection
in C or Java.

That is just my opinion, which has been proven (even on this list! ;) ) to
be wrong on occasion 

> My point of view has not much to do with PHP but with user interface, In
> php can be done very interesting things, I agree, for example I've
> written daemon using pure PHP, and it runs for 170 days continuously and
> sending e-mails from our site.
> 
>> 
>> On 7/16/03 8:25 AM, "Mirek Novak" <[EMAIL PROTECTED]> wrote:
>> 
>> 
>>> Angelo Zanetti napsal(a):
>>> 
>>> 
>>>> Anyone know where I can download a demo point-of-sale program from?
>>>> preferably written in php and preferably a point-of-sale designed for
>>>> restaurants? any links etc will be great
>>>> 
>>>> TIA
>>>> 
>>>> Angelo
> 

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



Re: [PHP] PHP POS program

2003-07-16 Thread Mike Morton
Sure - that is assuming that is how you want to print it!

And even then - given the power of PHP - surely you could do a socket
program to do it.

Anyhow - printing to a POS printer - how mandatory does that have to be?  If
we all remained slaves to how it is done in the past, then we will never
move to the future.

And BTW - there is no such thing as CANNOT be done, only that some one has
not done it yet


On 7/16/03 9:04 AM, "Andrei Verovski   (aka MacGuru)"
<[EMAIL PROTECTED]> wrote:

> 
> On Wednesday, Jul 16, 2003, at 15:58 Europe/Helsinki, Mike Morton wrote:
> 
>> Why is it too serious a problem?  E-Commerce sites are written in PHP -
>> there is not a big difference except that the POS system does not even
>> necessarily have to be online!  I think that is a bit of a short
>> sighted
>> view don't you?
>> 
>> Just because you have not seen it done does not mean that it
>> cannot/has not
>> been done...
>> 
>> I don't mean to be a prick about it -it is just that there really is no
>> reason that it could not be done in php.  It is not a difficult system
>> to
>> do.
>> 
> 
> Hi,
> 
> It is NOT possible since web browser cannot print row ASCII to serial
> POS printer (PHP scripts run on server and output Web pages to client
> machines).
> 
> 
> *
> *   Best Regards   ---   Andrei Verovski
> *
> *   Personal Home Page
> *   http://snow.prohosting.com/guru4mac
> *   Mac, Linux, DTP, Development, IT WEB Site
> *

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



Re: [PHP] PHP POS program

2003-07-16 Thread Mike Morton
Why is it too serious a problem?  E-Commerce sites are written in PHP -
there is not a big difference except that the POS system does not even
necessarily have to be online!  I think that is a bit of a short sighted
view don't you?  

Just because you have not seen it done does not mean that it cannot/has not
been done...

I don't mean to be a prick about it -it is just that there really is no
reason that it could not be done in php.  It is not a difficult system to
do.



On 7/16/03 8:25 AM, "Mirek Novak" <[EMAIL PROTECTED]> wrote:

> Angelo Zanetti napsal(a):
> 
>> Anyone know where I can download a demo point-of-sale program from?
>> preferably written in php and preferably a point-of-sale designed for
>> restaurants? any links etc will be great
>> 
>> TIA
>> 
>> Angelo
>> 
> 
> This problem (POS) is too serious to be written in PHP(via browser).
> Maybe in PHP-GTK or in PHP as CLI... But I've never heard about it.
> 

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



Re: [PHP] Exec command not working through php

2003-07-15 Thread Mike Morton
David:

Permissions were the first guess - I chmoded 777 everything - still no go.

On the server, there should be a second file created identical to the first
with the results of the sed find and replace in it - the only thing that is
created is a blank file.

So, it is not permissions, nothing is returned in the results array, and the
exact same query run on the server command line works properly - the only
difference between it executing through php and command line is, as far as I
can tell, the user being apache for the php exec and a different user
command line, but with mode 777 on the files and directories (ya ya, I know
that is not secure but it is just for testing purposes ;)) the user should
not make a difference.

On 7/15/03 6:23 PM, "David Nicholson" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 23:17,
> lines prefixed by '>' were originally written by you.
>> "if I print out the exec line with the
>> dynamically generated paths, etc, then execute that through the
>> terminal, no
>> problem. "
>>> From the first email meaning that I did just like you suggested
>> already and
>> it works in the terminal and contains exactly what I expect it to.
>> But thanks :)
> 
> Sorry, I jumped over that in your original mail! I amy as well try and be
> of help again then...
> 
> Does the user on the system that your webserver runs as have permission to
> execute the program you are trying to execute?
> 
> Do you expect the program to have any output, if so is it appearing in
> your $results array? is anything being put in the $results array?
> 
> Also, you could try using the third optional paramater for the exec
> function to retrieve the return status of the command you are executing.
> 
> David.

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



Re: [PHP] Exec command not working through php

2003-07-15 Thread Mike Morton
"if I print out the exec line with the
dynamically generated paths, etc, then execute that through the terminal, no
problem. "

>From the first email meaning that I did just like you suggested already and
it works in the terminal and contains exactly what I expect it to.

But thanks :)


On 7/15/03 6:09 PM, "David Nicholson" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 21:30,
> lines prefixed by '>' were originally written by you.
>> I have the following exec command in php:
>> exec("/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
>> $GLOBALS[TMP_MAIL_DIR]"."$mailid >
>> $GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp",$results);
>> Which does a search and replace using the sed command file:
>> s/'/'/g
>> s/"/"/g
>> Now, executed command line, this works beautifully, the input file is
>> parsed
>> and the results go to the output file - BUT when run via php, the
>> output
>> file is blank, empty, no data at all.
>> Permissions are not the problem, I went so far as to 777 the directory
>> and
>> file, still the same results.
>> Running PHP 4.1.2 on Linux Redhat something or another.
>> I am sure that it is something simple, but it is driving me crazy!
>> Oh, and yes, globals are on here - if I print out the exec line with
>> the
>> dynamically generated paths, etc, then execute that through the
>> terminal, no
>> problem.
>> If anyone has run into this with exec commands before or can suggest a
>> different way to run this command, I would love to hear it!
> 
> Put this line of code in your script:
> 
> echo "/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
> $GLOBALS[TMP_MAIL_DIR]"."$mailid >
> $GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp";
> 
> and check that it contains what you expect it to.
> 
> All the best,
> 
> David.

--
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] Exec command not working through php

2003-07-15 Thread Mike Morton
I have the following exec command in php:
exec("/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
$GLOBALS[TMP_MAIL_DIR]"."$mailid >
$GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp",$results);

Which does a search and replace using the sed command file:
s/'/'/g
s/"/"/g

Now, executed command line, this works beautifully, the input file is parsed
and the results go to the output file - BUT when run via php, the output
file is blank, empty, no data at all.

Permissions are not the problem, I went so far as to 777 the directory and
file, still the same results.

Running PHP 4.1.2 on Linux Redhat something or another.

I am sure that it is something simple, but it is driving me crazy!

Oh, and yes, globals are on here - if I print out the exec line with the
dynamically generated paths, etc, then execute that through the terminal, no
problem.

If anyone has run into this with exec commands before or can suggest a
different way to run this command, I would love to hear it!

TIA 

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



Re: [PHP] Setting Cookie Going Nuts

2003-07-08 Thread Mike Morton
George:

Thanks for getting back...

> Just a thought - are you outputting any HTML on the page where you are
> declaring your cookie?
> 
> If not, then it won't work.


I am outputting HTML on the page AFTER the cookie, and it does work, on
other servers

> I got stuck a few months back with a filter script where someone logs in and
> depending on who they were were redirected to various pages. I was decalring
> their cookies in the redirect script and it didn't work until I started
> doing in on a 'written' page.

Hmm, strange behaviour, I will have to check the other scripts to see if
they were modified to a redirect, but I do not think that they were...

Thanks George :)


> 
> Hope this solves your problem.
> 
> Cheers
> 
> George in Oxford
> 
>> -Original Message-
>> From: Boaz Yahav [mailto:[EMAIL PROTECTED]
>> Sent: 04 July 2003 10:05 am
>> To: Mike Morton; [PHP - GENERAL]
>> Subject: RE: [PHP] Setting Cookie Going Nuts
>> 
>> 
>> Did you solve this issue?
>> What does $_SERVER["HTTP_HOST"] return?
>> 
>> Sincerely
>> 
>> berber
>> 
>> Visit http://www.weberdev.com/ Today!!!
>> To see where PHP might take you tomorrow.
>> 
>> 
>> -Original Message-
>> From: Mike Morton [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, July 03, 2003 4:03 PM
>> To: [PHP - GENERAL]
>> Subject: [PHP] Setting Cookie Going Nuts
>> 
>> 
>> I am trying to issue a cookie, using the set cookie directive, and it is
>> not working for some reason.  The code below I have used before with
>> perfect success.  The only difference between the other place that I am
>> using it is that the other place has globals on, this server has globals
>> off (tho I turned them on a and it made no difference), and the other
>> server is running 4.3.2 where this one is 4.3.0
>> 
>> I am sure that it is something small that I missed when copying the code
>> over, but I cannot for the life of me see what it is.  The only other
>> difference is the other server is using a domain name, while the server
>> this code is on is an IP address only (that should not make a difference
>> tho)
>> 
>> Why is the cookie not being isseued?  I am going nuts trying to figure
>> this out!
>> 
>> $ADMIN_COOKIE_NAME="scavengeradmin"; //name of the issuing cookie
>> $COOKIE_EXPIRY=1800; //time in seconds to expiry
>> 
>> function adminCookie() {
>> global $ADMIN_COOKIE_NAME,$COOKIE_EXPIRY;
>> 
>> //check to see if a cookie exists already.
>> $cookieid=$_COOKIE[$ADMIN_COOKIE_NAME];
>> 
>> //if there is no cookieid - then we are going to set a cookie.
>> if(strlen($cookieid) < 1) {
>> //find a unique value.
>> list($msec,$sec)=explode(" ",microtime());
>> $cookiekey=ereg_replace("\.","",($msec+$sec));
>> //set expiry - 30 mins from now.
>> $cookieexpiry=time()+$COOKIE_EXPIRY;
>> 
>> setcookie($ADMIN_COOKIE_NAME,$cookiekey,$cookieexpiry,"/",$_SERVER["HTTP
>> _HOS
>> T"],0);
>> $_COOKIE[$ADMIN_COOKIE_NAME]=$cookiekey;
>>     unset($cookiekey);unset($msec);unset($sec);unset($cookieexpiry);
>> } else {
>> //if the cookie has been set then we are just going to adjust
>> the expiry date.
>> //set expiry - 30 mins from now.
>> $cookieexpiry=time()+$COOKIE_EXPIRY;
>> 
>> setcookie($ADMIN_COOKIE_NAME,"$cookieid",$cookieexpiry,"/",$_SERVER["HTT
>> P_HO
>> ST"],0);
>> unset($cookieexpiry);
>> }
>> 
>> unset($cookieid);
>> }
>> 
>> adminCookie(); //issue the cookie
>> 
>> --
>> 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
>> 
>> 

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



Re: [PHP] Setting Cookie Going Nuts

2003-07-08 Thread Mike Morton
Berber:

> Did you solve this issue?

No, this issue was not resolved.

> What does $_SERVER["HTTP_HOST"] return?

It returns the IP address that is assigned to the website.  There is no
domain assigned, just the IP. When there is a domain assigned  it would
assign the domain...

> 
> Sincerely
> 
> berber
> 
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
> 
> 
> -Original Message-
> From: Mike Morton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 03, 2003 4:03 PM
> To: [PHP - GENERAL]
> Subject: [PHP] Setting Cookie Going Nuts
> 
> 
> I am trying to issue a cookie, using the set cookie directive, and it is
> not working for some reason.  The code below I have used before with
> perfect success.  The only difference between the other place that I am
> using it is that the other place has globals on, this server has globals
> off (tho I turned them on a and it made no difference), and the other
> server is running 4.3.2 where this one is 4.3.0
> 
> I am sure that it is something small that I missed when copying the code
> over, but I cannot for the life of me see what it is.  The only other
> difference is the other server is using a domain name, while the server
> this code is on is an IP address only (that should not make a difference
> tho)
> 
> Why is the cookie not being isseued?  I am going nuts trying to figure
> this out!
> 
> $ADMIN_COOKIE_NAME="scavengeradmin"; //name of the issuing cookie
> $COOKIE_EXPIRY=1800; //time in seconds to expiry
> 
> function adminCookie() {
>   global $ADMIN_COOKIE_NAME,$COOKIE_EXPIRY;
>   
>   //check to see if a cookie exists already.
>   $cookieid=$_COOKIE[$ADMIN_COOKIE_NAME];
> 
>   //if there is no cookieid - then we are going to set a cookie.
>   if(strlen($cookieid) < 1) {
>   //find a unique value.
>   list($msec,$sec)=explode(" ",microtime());
>   $cookiekey=ereg_replace("\.","",($msec+$sec));
>   //set expiry - 30 mins from now.
>   $cookieexpiry=time()+$COOKIE_EXPIRY;
>   
> setcookie($ADMIN_COOKIE_NAME,$cookiekey,$cookieexpiry,"/",$_SERVER["HTTP
> _HOS
> T"],0);
>   $_COOKIE[$ADMIN_COOKIE_NAME]=$cookiekey;
>   unset($cookiekey);unset($msec);unset($sec);unset($cookieexpiry);
>   } else {
>   //if the cookie has been set then we are just going to adjust
> the expiry date.
>   //set expiry - 30 mins from now.
>   $cookieexpiry=time()+$COOKIE_EXPIRY;
>   
> setcookie($ADMIN_COOKIE_NAME,"$cookieid",$cookieexpiry,"/",$_SERVER["HTT
> P_HO
> ST"],0);
>   unset($cookieexpiry);
>   }
>   
>   unset($cookieid);
> }
> 
> adminCookie(); //issue the cookie
> 
> --
> 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 
> 

--
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] Setting Cookie Going Nuts

2003-07-03 Thread Mike Morton
I am trying to issue a cookie, using the set cookie directive, and it is not
working for some reason.  The code below I have used before with perfect
success.  The only difference between the other place that I am using it is
that the other place has globals on, this server has globals off (tho I
turned them on a and it made no difference), and the other server is running
4.3.2 where this one is 4.3.0

I am sure that it is something small that I missed when copying the code
over, but I cannot for the life of me see what it is.  The only other
difference is the other server is using a domain name, while the server this
code is on is an IP address only (that should not make a difference tho)

Why is the cookie not being isseued?  I am going nuts trying to figure this
out!

$ADMIN_COOKIE_NAME="scavengeradmin"; //name of the issuing cookie
$COOKIE_EXPIRY=1800; //time in seconds to expiry

function adminCookie() {
global $ADMIN_COOKIE_NAME,$COOKIE_EXPIRY;

//check to see if a cookie exists already.
$cookieid=$_COOKIE[$ADMIN_COOKIE_NAME];

//if there is no cookieid - then we are going to set a cookie.
if(strlen($cookieid) < 1) {
//find a unique value.
list($msec,$sec)=explode(" ",microtime());
$cookiekey=ereg_replace("\.","",($msec+$sec));
//set expiry - 30 mins from now.
$cookieexpiry=time()+$COOKIE_EXPIRY;

setcookie($ADMIN_COOKIE_NAME,$cookiekey,$cookieexpiry,"/",$_SERVER["HTTP_HOS
T"],0);
$_COOKIE[$ADMIN_COOKIE_NAME]=$cookiekey;
unset($cookiekey);unset($msec);unset($sec);unset($cookieexpiry);
} else {
//if the cookie has been set then we are just going to adjust the
expiry date.
//set expiry - 30 mins from now.
$cookieexpiry=time()+$COOKIE_EXPIRY;

setcookie($ADMIN_COOKIE_NAME,"$cookieid",$cookieexpiry,"/",$_SERVER["HTTP_HO
ST"],0);
unset($cookieexpiry);
}

unset($cookieid);
}

adminCookie(); //issue the cookie

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



Re: [PHP] web site security: how to hide login info formysql-connection

2003-06-29 Thread Mike Morton
Anders:

> Somewhere, I've read that settings.php should be placed in a directory
> outside the html/php-directories. Today, my web directory is
> /home/anders/public_html and subdirectories to public_html. Should
> settings.php be placed in /home/anders/include?

That is correct - you are always best to keep password and such outside the
web root where possible.  As many people have pointed out on this list - it
is a best practices thing that should be done.

Be aware that wherever you store the settings folder, your php.ini should
have that path in it's include_directories setting, and the webserver must
have read permissions for that file.


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



Re: [PHP] Re: Securing PHP code

2003-06-26 Thread Mike Morton
Why not just connect the 2 servers together with additional nic cards, then
the second is only accessable from the first.

On 6/26/03 6:26 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 06/26/2003 02:10 AM, Joseph Szobody wrote:
>>> A safer architechture would be to use two machines. One to act as
>>> the Web server and the other to process transactions. The Web
>>> server would take the orders and request the transaction server to
>>> process them.
>>> 
>>> The transcation server can only be accessed from the Web server.
>>> Nobody should be able to reach the transaction server from the
>>> Internet. The transaction server machine should have the database
>>> server too. The database server should not accept network
>>> connections.
>> 
>> Having never setup a multi-server web environment before, I'm a bit
>> curious. How would the public server communicate with the private
>> server, passing in database queries and getting results, if it can't
>> connect directly to the database? Are we talking about building a
>> SOAP interface between the two?
> 
> Yes, it could be SOAP although a less bloated protocol over HTTP would do.
> 

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



Re: [PHP] Securing PHP code

2003-06-25 Thread Mike Morton
Ok :)

The only reason that I was so adamant about it was I had a 'heated'
discussion with a business associate who's server was compromised - and he
was, lets say, insistant that the fact that there were database passwords in
a php file inside the webroot was the reason it was insecure.  I just wanted
to know if I was wrong in saying that the passwords were not compromised
without the server access being compromised

(not to mention the clear text password accesses, the wildcarded mysql
access on a remote host passed in clear text, the lack of ssl on pages
collection cc information, same root passwords across the network and
dictionary hackable passwords for users :)  Oh, and did I mention the non
ssh telnet access from internet café's?)

Thanks :)

On 6/25/03 5:49 PM, "Mike Migurski" <[EMAIL PROTECTED]> wrote:

>>> Why rely on some access restriction when you don't have to? You include
>>> code using a filesystem path. There is no need for it to reside under
>>> document root. Yes, you can make it so that certain things are not
>>> served directly by the Web server, but why take the extra risk? You
>>> gain nothing. What if you make a mistake? What if you install a new
>>> version of Apache and that file accidently gets served raw?
>> 
>> Fair enough - but that still does not answer my question.  Is there a way
>> to get a php document served raw if apache or whatever server is
>> configured correctly?
> 
> I don't believe so, no.
> 
> 
>> So back to the original question:
>> 
>> "Maybe I am missing something totally obvious, but if the server is set
>> up to properly parse php files - having configs outside of the doc root
>> should not make much of a security difference? "
>> 
>> Is this a true statement or not?  (of course we have to make the
>> assumption that server access has not been compromised)
> 
> It's a true statement /if/ the server configs don't change -- but why risk
> it? seriously... if you're concerned about those values being compromised
> stick 'em someplace where you /know/ they won't get served up, no matter
> what happens to the webserver. I usually put them in .htaccess first, then
> move them to httpd.conf on production:
> 
> http://httpd.apache.org/docs/mod/mod_env.html#setenv
> http://php.net/getenv
> 
> Also it helps with version control, since you can keep the
> environment-specific stuff out of CVS (and PHP entirely).
> 
> -
> michal migurski- contact info and pgp key:
> sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] Securing PHP code

2003-06-25 Thread Mike Morton

> --- Mike Morton <[EMAIL PROTECTED]> wrote:
>> That is precisely my point - if the user has shell access of any
>> type you are compromised - but if they do not get server access -
>> how could they possibly get the dotabase.inc.php?  If that is
>> called directly then it will be parsed, and as long as you are not
>> outputting anything in this page, they will not see the user/pass
>> that you have in there...
> 
> That's the perspective that is the cause of many security vulnerabilities.
> 
> Why rely on some access restriction when you don't have to? You include code
> using a filesystem path. There is no need for it to reside under document
> root.
> Yes, you can make it so that certain things are not served directly by the Web
> server, but why take the extra risk? You gain nothing. What if you make a
> mistake? What if you install a new version of Apache and that file accidently
> gets served raw?

Fair enough - but that still does not answer my question.  Is there a way to
get a php document served raw if apache or whatever server is configured
correctly?

I am not saying that it is not a good practice - but some people do not have
access to directories outside of their webroot - some host providers do not
allow it.

So back to the original question:

"Maybe I am missing something totally obvious, but if the server is set up
to
properly parse php files - having configs outside of the doc root should not
make much of a security difference?
"

Is this a true statement or not?  (of course we have to make the assumption
that server access has not been compromised)
 


 Chris
> 
> =
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/

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



Re: [PHP] Securing PHP code

2003-06-25 Thread Mike Morton

>>>> 2) I store the db password and login info in a database.inc.php file.
>>>> Is there any way I can prevent a person from getting the db pass even
>>>> after he gets this file?
>>> 
>>> Store that file outside the docroot.  That way there is no chance they
>>> can get it from the web site.  I myself use an ini file that is no
>>> where near the docroot, and use parse_ini_file() to load the DB
>>> information in, and then I connect to it.  This method passed our
>>> security audit with flying colors.
>> 
>> Okay - this may be a dumb question - but if the file is named
>> database.inc.php - how would someone get this file without having ftp or
>> ssh or telnet access to the server.  If they have access to the server -
>> it would be just as easy to collect the information outside of the doc
>> root, since that file has to be readable by the webserver also yes?
> 
> Yes, but if an outsider can gain SSH access, then Apache's security is
> meaningless, too. If you are concerned about security, you will also
> disable FTP and telnet (or at least restrict them severely).

That is precisely my point - if the user has shell access of any type you
are compromised - but if they do not get server access - how could they
possibly get the dotabase.inc.php?  If that is called directly then it will
be parsed, and as long as you are not outputting anything in this page, they
will not see the user/pass that you have in there...



> 
> -----
> michal migurski- contact info and pgp key:
> sf/cahttp://mike.teczno.com/contact.html
> 

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



Re: [PHP] Securing PHP code

2003-06-25 Thread Mike Morton
Dan:

>> 2) I store the db password and login info in a database.inc.php
>> file. Is there any way I can prevent a person from getting the db
>> pass even after he gets this file?
> 
> Store that file outside the docroot.  That way there is no chance they can
> get it from the web site.  I myself use an ini file that is no where near
> the docroot, and use parse_ini_file() to load the DB information in, and
> then I connect to it.  This method passed our security audit with flying
> colors.

Okay - this may be a dumb question - but if the file is named
database.inc.php - how would someone get this file without having ftp or ssh
or telnet access to the server.  If they have access to the server - it
would be just as easy to collect the information outside of the doc root,
since that file has to be readable by the webserver also yes?

Maybe I am missing something totally obvious, but if the server is set up to
properly parse php files - having configs outside of the doc root should not
make much of a security difference?

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



Re: [PHP] Best Merchant Account For PHP Users

2003-06-25 Thread Mike Morton
If you have never built an ecommerce site before then you do not want to
start building one live for a store to learn on.

There are many facets to an e-commerce store - the least of which is
understanding session management, and up to securing your code and servers.
It takes more than just PHP to make a good e-commerce site.

You are better of starting by looking around for existing e-commerce sites
that you can hook into your existing site - ones that are hosted and managed
by the service provider such as http://www.dxcart.com

The alternative would be to download a shopping cart that you would manage
and run off of your own servers, such as http://www.oscommerce.com

There are many pros and cons to each of these methods, it is up to you to
decide which best suits you, but I would never recommend building an
e-commerce shopping cart yourself until you are fully versed in the securing
of your servers and code.

As for merchant account provision, if you go with an outside supplier for a
shopping cart, most integrate with a great many gateway and merchant account
providers.  They should be able to recommend one that works best with their
service.

Personally in Canada I prefer PSI Gate (http://www.psigate.com) they are
easy to integrate and can provide merchant accounts as well as gateway
services.  In the US I use Authorize.Net (http://www.authorize.net) - they
are a gateway service and can recommend a merchant account provider to get
your accounts from.

This really is a huge topic that has many different areas that you should
understand before you jump into the e-commerce world.  Do a search on google
to find information about service providers, merchant accounts, gateway
services, etc.


On 6/25/03 12:57 PM, "Nilaab Y." <[EMAIL PROTECTED]> wrote:

> Hello everyone,
> 
> I want to start learning about e-commerce, shopping carts, SSL encryption
> methods, etc. I have built a catalog system for my clients and I want to
> built a fully integrated store on top of it.
> 
> I need a merchant provider that can allow me to integrate the credit card
> proccessing within my own designs. I want to just be able to send their
> servers the credit card info, for authentication, processing, and banking,
> then I want them to send me a confirmation message, saying the credit card
> has been authorized successfully and the customer has been billed for such
> amount of money, etc. I don't want to use any merchant provider's design. In
> other words, no Motiva-like merchant providers.
> 
> Sorry about the long explaination. Here's the question:
> 
> Has anyone worked with a merchant account that can do what I need? Does
> anyone have any suggestions of who their favorite merchant providers are?
> Are there merchant providers who work better with applications coded in PHP,
> or does it really not matter at all which application it's written in? Also,
> does anyone know of a website (for dummies) that can teach me how to start
> enabling my website into an e-commerce website?
> 
> Thanks in advance guys!  :)
> 

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



Re: [PHP] php.ini

2003-06-25 Thread Mike Morton
Depending on how you compiled/installed PHP on the mac - you may not have a
php.ini file - for example, if you used the binary from entropy.ch - there
is no php.ini - you would have to create it.


On 6/25/03 12:07 PM, "Steve Marquez" <[EMAIL PROTECTED]> wrote:

> Yes,
> 
> But I had a question that is php and mac specific. I used the info in the
> discussion all morning, and could not find the file, I thought that some of
> you great gurus could help with that.
> 
> Does the php.ini file always go in the same place no matter the OS? I did a
> locate in the shell, and nothing came up. I could find .ini files, or php.
> files, but no php.ini files.
> 
> Can the file be called anything else?
> 
> Thanks,
> Steve
> 
>> [snip]
>> I am running MacOSX and can not find my php.ini file. Does anyone know
>> where
>> it is located on a mac?
>> 
>> I looked at my phpinfo file, and it says /usr/lib/ but does not have the
>> php.ini file in it.
>> 
>> Can anyone help?
>> [/snip]
>> 
>> I just want to make sure that I have not lost my mind, but haven't we
>> been discussing the location of the php.ini all morning long? I thought
>> we were, but I could be mistaken.
>> 
>> Jay
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
> 

--
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] Another hosting question....

2003-06-18 Thread Mike Morton
I know that this subject has been beaten to death, but I going through old
lists, I see a lot of hosting companies for site hosting, but I am
interested specifically in dedicated server hosting.

It is tough to find a hosting facility that is state of the art, with big
pipes and redundancy, but is not a huge corporate company that could not
care less about you

What I am looking for specifically is a company that someone can recommend
from direct experience, one that is customer friendly, offers dedicated
servers at a REASONABLE price, offers admin support and server support, etc,
etc, etc, and most importantly has expertise in compiling PHP.

If anyone out there know of a company like this and can recommend them - I
would appreciate it :) It will save literally hours and hours of sorting
through the  google listings that a php dedicated hosting search brings
back!  (2 days of sorting to this point anyhow!)

TIA

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



Re: [PHP] .htaccess files

2003-06-18 Thread Mike Morton
Nothing to do with php but:

http://search.apache.org/index.cgi?query=.htaccess&submit=Search%21&metaname
=swishdefault&sort=swishrank&sbm=httpd


On 6/18/03 6:34 PM, "Steve Marquez" <[EMAIL PROTECTED]> wrote:

> Hello everyone,
> 
> Could someone point me in the direction of some info on .htaccess files?
> Could someone send me one, tell me where to put it in my
> server? I hope this is not a stupid question. I am running Apache on a Mac
> with Jaguar OSX.
> 
> Thanks for your help,
> 
> -Steve Marquez
> [EMAIL PROTECTED]
> 

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



Re: [PHP] Ini_set with mutiple include directories

2003-06-17 Thread Mike Morton
Ah ha - the semi colon does not work - but colon does - thanks Jason!



On 6/17/03 5:04 PM, "Jason Wong" <[EMAIL PROTECTED]> wrote:

> On Wednesday 18 June 2003 03:08, Mike Morton wrote:
>> I have an application that I set the include directory using the ini_set
>> (the application assumes that the client does not have access to the
>> php.ini files).
>> 
>> I can set the first include path of course:
>> ini_set("include_path","/Library/WebServer/Documents/includes");
>> 
>> But how do I set additional paths like in the ini file?  If I try to do
>> another ini set, then it replaces the initial one, and I cannot seem to
>> find any way to set more than one path in the initial ini_set above
> 
> Separate multiple directories with a semi-colon?

--
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] Ini_set with mutiple include directories

2003-06-17 Thread Mike Morton
I have an application that I set the include directory using the ini_set
(the application assumes that the client does not have access to the php.ini
files).

I can set the first include path of course:
ini_set("include_path","/Library/WebServer/Documents/includes");

But how do I set additional paths like in the ini file?  If I try to do
another ini set, then it replaces the initial one, and I cannot seem to find
any way to set more than one path in the initial ini_set above

Does anyone know how this can be done?  Thanks :)



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



Re: [PHP] Sessions can be dangerous

2003-05-30 Thread Mike Morton
example, absolutely and explicitly, no guarantee
> that http requests will be received in chronological order.  It is all
> strictly about "best effort", and no guarantees. This is why the
> internet works: each component does its own job as well as it can
> without worrying about what else is happening.
> 
> The implication from a design point of view is that you should not be
> making any assumptions about what has "gone before" or what "will come
> after" your php script runs.  The functionality offered, should, as far
> as possible, be completely self-contained, with each php script acting
> as a "component" in its own right. That means no direct interaction
> between the scripts.  Interaction should be  gated through third-party
> standard interfaces such as http or SQL.
> 
> The problem with sessions is that they encourage you to break this model
> by creating a new set of "super-global" data holding "state"
> information.  This data is not exchanged through established standards,
> but rather, "floats around" in the background, changing the behaviour of
> the script but without being clearly externally defined.
> 
> If the session data is only concerned with "cosmetic" data such as user
> style and colour preferences, this doesn't particularly matter.  But if
> it holds important or critical data, it does matter.  Each script is no
> longer a well-defined self-contained component, but more or less
> intimately bound up with other scripts that share the same session.
> 
> It's worth remembering that there is nothing remotely new about
> "state-ful" design. VDUs connected to mainframes are about as state-ful
> as you can get. Indeed, the single distinctive feature of the two most
> successful software technologies of all time, (the internet and SQL), is
> that, (unlike their predecessors), they are both fundamentally
> state-less protocols.
> 
> 
> 5. Reduced Component Reusability
> 
> A practical example of the problems of this style of "state-ful" code is
> in reduced reusability of the components, (php scripts in this case).
> One of the great benefits of the internet's stateless approach is the
> tremendous ease with which uri-addressable components can be reused.
> For example, a single graphic  can be very easily used on any web page,
> anywhere, anytime, with no additional effort than making it available on
> one web page on one site, once.
> 
> Similarily, php scripts which are properly structured components, (e.g.
> no significant session data use), can be reused, without code change for
> many different purposes.  If session data is used, e.g. to pass search
> criteria or results data between pages, this flexibility is
> significantly reduced.
> 
> For example, it's very handy when maintaining data in one table, to be
> able to offer direct links to updates of related data. But if the update
> form for the related data is coded to expect the details of what it must
> update from session data e.g. to have been set from a search/list/select
> page, this won't work.  So, just because you used sessions, you, (or
> someone else), may not be able to offer direct links, (or bookmarks), to
> the update page even when the appropriate database keys are already
> known.  You either have to force the user to duplicate effort by
> unnecessary traversing of a new search/list/select or you have to write
> new code to handle this new type of request.
> 
> On the other hand if the update is coded as a proper component i.e. it
> reads the key of the data to be updated from the http request, (GET,
> POST or COOKIE), then you can automatically allow it to be accessed from
> anywhere without having to always go through some particular
> search/list/select sequence.
> 
> This is one, among many possible, examples of how, by establishing a
> hidden, private, relationship between php scripts, session data
> automatically and inevitably reduces the accessibility of the
> functionality of the script.
> 
> There is a direct parallel in "lower-level" code structures.  Over use
> of session data is as intrinsically hostile to code re-use as over use
> of global data to communicate between distinct functions or objects.
> Just as functions and objects should use the "public" interface to
> exchange data i.e. arguments/methods/properties, so php scripts should
> exchange data via "public" interfaces i.e. http requests, databases etc.
> 
> 
> 
> Well, I've convinced myself.  Of course, as I don't use sessions I may
> have missed something, (or everything).  So, please, what have I got wrong?
> 
> 
> 
> George
> 

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



Re: [PHP] Netbilling PHP Script

2003-05-30 Thread Mike Morton
Justin:

Point well taken, and I agree for the most part.  Teaching people to learn
themselves is a much better solution that just giving the answer, however it
CAN be done in a constructive and helpful manner, rather than a rude and
abrupt one.

I have not noticed your responses, so I cannot comment, other than they did
not particularily jump out at me as rude as Jason's did.


There is a lot of experience on this list, but we all have to remember that
there is also a lot of inexperience on this list.  When someone asks a
simple question they do not always even understand what they are asking, and
may not even know how to ask the correct question.  That is why if we do not
have an answer that is constructive, then we should not post it.


That is not to say that I am the judge of a constructive or non-constructive
answer, just that if you do not have anything nice to say, then don't say
anything at all!

Anyway, arguing noob teaching ethics is not paying the bills, so back to
that at least! :)


On 5/29/03 9:42 AM, "Justin French" <[EMAIL PROTECTED]> wrote:

> Mike,
> 
> I agree that at times Jason (and plenty of others, including myself on a bad
> day) tend to use the "search google" and "RTFM" replies a lot, but the
> reality is that if people did a quick search in the manual, and a quick
> search on google, this list would be a lot less cluttered.
> 
> It also goes a long way in showing that the original poster isn't simply
> lazy, and has made SOME effort to find the answer before posting to a list.
> 
> 
> We'd also have well-formed questions like:
> 
>   "I checked out the manual page on file uploads, and tried getting
>   the example script to work, but I'm getting the following error
>   (...) -- can anyone offer advice?"
> 
> Rather than:
> 
>   "I can't get file uploading to work, please read my 2000 line
>   script and tell me what's wrong"
> 
> 
> I just had a kick around google, and couldn't find much to do with
> netbilling and PHP (apart from http://dreamcost.com/?page=dreamaccount), but
> the fact is if the OP had mentioned that he/she had already searched google
> with little success, this whole discussion could have been avoided :)
> 
> 
> Which is better?  Teaching someone the answer to a problem, or teaching
> someone how to find the answer (and future answers) themselves?
> 
> "Search google" may not be a detailed answer, or even a polite one, but in
> many cases (not necessarily this OP of this thread) a lazy question deserves
> a lazy response.
> 
> Justin French
> 
> 
> 
> 
> 
> 
> on 30/05/03 12:49 AM, Mike Morton ([EMAIL PROTECTED]) wrote:
> 
>> 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,
>

Re: [PHP] Netbilling PHP Script

2003-05-30 Thread Mike Morton
Jason, you are a sad sad man.

The point I was simply trying to make was that YOU do not have to do
ANYTHING.  Don't search google, don't spend any time on it at all, don't
even email.

There are plenty of people here that are willing to help - if you are not -
piss off.

Not everyone has your complete knowledge and massive experience and extreme
brainpower, and we are not all able to utilize our pitiful intellects to
your level and utilize all the useful resources that google has to offer.

As for this list being the first resort, why not?  Who are you to determine
whether this list is a first, last or any other kind of resource?  Do you
own it, do you manage or moderate it in any way?  If so, then perhaps you
should write an FAQ that is presented with the welcome to the list email
that states all the obvious answers, if not, then leave the moderation to
those who's job it is.

This is a list containing noobs, vets and everything inbetween.  You have to
be considerate to all levels.  You sir, are not.  You are arrogant (your
problem not mine), rude (your problem not mine), and overall just not a nice
person on this list.  If you are different in real life, cool, by try to use
some restraint on the list why don't you!

That is all, back to our regular programming :)

On 5/29/03 10:28 AM, "Jason Wong" <[EMAIL PROTECTED]> wrote:

> On Thursday 29 May 2003 21:49, Mike Morton wrote:
>> 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.
> 
> Because I don't like spam.
> 
>> Why do you bother to answer on the php list at all?  90% of the messages
>> from you are 'search google'
> 
> Probably because 90% of the questions on the list can be answered by searching
> google?
> 
>> if you do not have constructive info to
>> offer, why bother to answer at all.
> 
> So constructive info would be for ME to search google and present the results
> neatly in my reply? Somehow I don't think so.
> 
>> 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.
> 
> Non-specific questions get non-specific answers.
> 
> If the OP wanted a better answer the question asked should have been something
> like:
> 
> I'm looking for a script to do blahblah, I searched on google/etc and found A,
> B and C. However I need features X, Y and Z.
> 
> Because:
> 
> 1) We know the OP has done some homework
> 2) We know which packages the OP has already looked at and thus would not
> recommend them
> 3) We know what specific features the OP would like and thus can make an
> informed recommendation
> 
>> 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,
> 
> So a good answer would be for ME to search google and present the results
> neatly in my reply? Somehow I don't think so.
> 
>> at the worst
>> of times, most people do not even know what to search for to narrow it
>> down! 
> 
> Well in this particular case "php netbilling" would have been a good start.
> Not exactly rocket science.
> 
>> Never mind searching the list archive - half the time all I get back
>> is your emails saying 'search google'!
> 
> Probably it's because a lot of people look to the list as a first resort
> instead of consulting the manual, the archives and google. Thus they keep
> asking the same questions over and over again.
> 
>> Geeze, look what you have made me do, get pissed of and waste my time
>> flaming you. What a waste of our time.
> 
> Well if you have nothing better to do then maybe you should search google try
> out all the links then present an executive summary for our friend the OP so
> that he can save himself some time.

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



Re: [PHP] Netbilling PHP Script

2003-05-29 Thread Mike Morton
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



Re: [PHP] strtr question

2003-05-29 Thread Mike Morton
Ed:

Better yet, because not all browsers pass through the original file name
that was was uploaded, have the user input the name - and validate that
instead. You can then restrict them to numbers letters:

$filename=ereg_replace("[^0-9a-zA-Z.]","",$filename)

Or something like that.


On 5/28/03 10:42 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> 
> I want to remove unwanted characters from filenames of files uploaded to
> our server. I am currently using strtr to do this. I have a few characters
> that are being removed but I would also like a single quote to be removed
> if it is in the filename. I think it has to be escaped in the command
> though. How do I do this?
> 
> TIA,
> 
> Ed
> 
> 

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



Re: [PHP] Client Side PHP

2003-02-06 Thread Mike Morton
That is a real nice thought - but Java is NOT platform independent - ever
tried running your java applets on a Mac, or how about BSDI?  Guess what -
bad interpreter for Mac and expensive non-available one for BSDI.  Java is
no different than PHP except that it is a tough language to learn for the
lay person, and requires a lot of time to build simple scripts.

Java is NOT the answer, there is no such thing as platform independence.
Every platform will require an interpreter of some sort for such a language,
and because that interpreter is typically built by someone other that the
language developer, the support will never be the same for the language
cross platform (ever heard of a little language called Javascript and
J-Script - how well supported is that?  Can you do the same things in
Netscape as in IE - which browser supports the true specification, for that
matter, how about CSS, or HTML even?)

Having a client side PHP will really do no more than allow other fighting
browsers screw up the support as they have done every other technology, and
if you require that it is a plug-in, well, then you are restricting the
audience.

A lot of developers prefer server side simply because it gives them control
over what the client sees (except when you mix other technologies in like
HTML and CSS, and others to format the results)

Just my 2 cents worth and a long awaited shot at the 'wonderful' world of
Java ;)

Flame at will.


On 2/6/03 3:44 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:

> "One language across the whole web"
> In a word: JAVA
> 
> Has the cross-platform flexability of PHP with a little more versitility and
> power under the hood.  Of course PHP still has its niche, but I'm still
> waiting 
> to go to an ecommerce page that fires up and interactive store applet on the
> client side and streams sales information via XML, so I can really "shop" from
> my desktop.
> 
>> 
>> I am doing now ;)
>> 
>> 
>> How would you guys like the idea, though?
>> 
>> 
>> --
>> Maxim Maletsky
>> [EMAIL PROTECTED]
>> 
>> 
>> 
>> Pete <[EMAIL PROTECTED]> wrote... :
>> 
>>> Has any one ever considered creating browser / client-side php to
>>> replace Javascript and vb??
>>> 
>>> One language across the whole web ;-)
>>> 
>>> Posted this question in the evangelism so I'd be interested in more
>>> reaction:
>>> 
>>> Pete
>>> 
>>> 
>>> 
>>> -- 
>>> 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
>> 
> 
> 
> 
> 

--
Cheers

Mike Morton


*
*  E-Commerce for Small Business
*  http://www.dxstorm.com
*
* DXSTORM.COM
* 824 Winston Churchill Blvd,
* Oakville, ON, CA L6J 7X2
* Tel: 905-842-8262
* Fax: 905-842-3255
* Toll Free: 1-877-397-8676
*


"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] Reading Posted variable names

2003-02-05 Thread Mike Morton
I am trying to write a quick form->mail script (like Matt's) and I am stuck
on one small part:

form:















Form.php (receiver of the form post):
foreach($_POST as $x) {
print "$x";
}


Will output the values of field1, field2, etc

BUT - how do I get the field names on the form.php page?  I want to be able
to display:
field1: value of field 1

But short of the form posting the field names as a separate field, how can I
just grab the posted field NAMES as well as their VALUES?

This may seem like a simple question, but I am too damn lazy to look through
thousands of previous emails for what may take someone a quick 5 min to
write it. :)

Thanks :)


--
Cheers

Mike Morton


*
*  E-Commerce for Small Business
*  http://www.dxstorm.com
*
* DXSTORM.COM
* 824 Winston Churchill Blvd,
* Oakville, ON, CA L6J 7X2
* Tel: 905-842-8262
* Fax: 905-842-3255
* Toll Free: 1-877-397-8676
*


"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




Re: [PHP] Encryption using MMCrypt - whats the point?

2003-01-30 Thread Mike Morton
Adam/Lowell:

Thanks for the suggestions ­ but like all clients ­ they want maximum
function for minimum $$ - encoders are therefore not a possibility (but I
will keep that in mind for future apps :))

Thanks.

On 1/30/03 9:55 AM, "Adam Voigt" <[EMAIL PROTECTED]> wrote:

> http://www.ioncube.com/
> 
> Encrypt PHP scripts (there pretty cheap to).
> 
> On Thu, 2003-01-30 at 09:30, Mike Morton wrote:
> I want to use the mcrypt functions to encrypt credit card numbers for
> storage in a mysql database, which mycrypt does admirably:
> 
> $key = "this is a secret key";
> $input = "Let us meet at 9 o'clock at the secret place.";
> $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256,
> MCRYPT_MODE_CBC), MCRYPT_RAND);
> 
> $encrypted_data = base64_encode(@mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , $key,
> $input, MCRYPT_MODE_CBC,$iv));
> 
> The trouble is - the key and the IV.  Both of these have to be available in
> the merchants administration for retrieval of the credit card, thus need to
> be stored somewhere - most likely on the server or in a database.  Here is
> the problem - if someone gets to the database and retrieves the encrypted
> credit card, the chances are that they are able to also retrieve the script
> that did the encryption, thus find out where the key and IV are stored,
> making it simple to decrypt the credit card for them.
> 
> The only solution that I can see is to use an asymetric encryption and have
> the merchant enter the decryption key at the time of credit card retrieval -
> but that is unrealistic for a User Interface point of view.
> 
> So - the only other thing that I can see to do is have a compiled program,
> bound to the server, that has the key compiled into the program.  I am not a
> C programmer - so this is also not exactly possible.
> 
> Does anyone else have any answers or has anyone else run into this?  Is this
> just a general problem with doing encryption through PHP as opposed to a
> compiled binary?  Can anyone suggest a solution to this problem?
> 
> Thanks :) 
> 
> 
> 


--
Cheers

Mike Morton


*
*  E-Commerce for Small Business
*  http://www.dxstorm.com
*
* DXSTORM.COM
* 824 Winston Churchill Blvd,
* Oakville, ON, CA L6J 7X2
* Tel: 905-842-8262
* Fax: 905-842-3255
* Toll Free: 1-877-397-8676
*


"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] Encryption using MMCrypt - whats the point?

2003-01-30 Thread Mike Morton
I want to use the mcrypt functions to encrypt credit card numbers for
storage in a mysql database, which mycrypt does admirably:

$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";
$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256,
MCRYPT_MODE_CBC), MCRYPT_RAND);

$encrypted_data = base64_encode(@mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , $key,
$input, MCRYPT_MODE_CBC,$iv));

The trouble is - the key and the IV.  Both of these have to be available in
the merchants administration for retrieval of the credit card, thus need to
be stored somewhere - most likely on the server or in a database.  Here is
the problem - if someone gets to the database and retrieves the encrypted
credit card, the chances are that they are able to also retrieve the script
that did the encryption, thus find out where the key and IV are stored,
making it simple to decrypt the credit card for them.

The only solution that I can see is to use an asymetric encryption and have
the merchant enter the decryption key at the time of credit card retrieval -
but that is unrealistic for a User Interface point of view.

So - the only other thing that I can see to do is have a compiled program,
bound to the server, that has the key compiled into the program.  I am not a
C programmer - so this is also not exactly possible.

Does anyone else have any answers or has anyone else run into this?  Is this
just a general problem with doing encryption through PHP as opposed to a
compiled binary?  Can anyone suggest a solution to this problem?

Thanks :)




--
Cheers

Mike Morton


*
*  E-Commerce for Small Business
*  http://www.dxstorm.com
*
* DXSTORM.COM
* 824 Winston Churchill Blvd,
* Oakville, ON, CA L6J 7X2
* Tel: 905-842-8262
* Fax: 905-842-3255
* Toll Free: 1-877-397-8676
*


"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] Perl Includes when executed with php....

2003-01-26 Thread Mike Morton
I have a perl script that needs to be executed using the exec command.  This
perl script had a use for another library. When executing this perl script
from the consol - there is no problem - the library from the use is picked
up from the proper directory (the included library is in the same directory
as the perl script) - but when executing it from within php, the library
cannot be found.  In the past I have worked around it successfully by
putting the library in the perl libs directory - but on this shared host
provider they will not allow that.

I am at a loss first of all why the file cannot be found in the perl script
where executed using php, and second of all how to get the perl script to
execute successfully through php.

The php code is:
exec("/home/vtccanada/psigate/processor.cgi \"secure.psigate.com\" \"1139\"
\"ConfigFile=teststore&KeyFile=./teststore.pem&ChargeType=1&UserId=TEST&Oid=
&Bname=John Q. Public&Bcompany=PSiGate&Baddr1=6725-6 Millcreek
Drive&Bcity=Mississauga&Bstate=Ontario&Bzip=L5N
5V2&Bcountry=Canada&Amount=1.99&Comments=NO
COMMENTS&[EMAIL PROTECTED]&CardNumber=4111&ExpMonth=04&
ExpYear=05\"",$results);

foreach($results as $x) {
print "$x";
}

The Perl bit that is giving trouble is:

sub process_order {

use ClearLink;

# Unique order number. Leave blank to have the API assign one.
$oid = $input{'Oid'};

Etc...
}

Specifically the use ClearLink line.

I know that this is not a perl list - but if anyone has suggestions on how
to get that file included, or executed properly through php, I would
appreciate it - keeping in mind that I have no access to perl library
directories.

Thanks.



--
Cheers

Mike Morton

"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




Re: [PHP] PHP Books

2003-01-20 Thread Mike Morton
As well as books there are some great PHP/MYSQL tutorials that cover all
aspects that the book do in a more visual way.

http://www.vtc.com - there are mysql and php tutorials there - you can view
the first few tutorials online to see if that is what you are looking for.


On 1/19/03 11:31 PM, "Armoured" <[EMAIL PROTECTED]> wrote:

> hello,
> 
> i have been told that i should email you to help me
> with my question, and the auestion is:
> 
> Can you recommend an GREAT book for someone to learn
> php off. The person will only have knowladge of html.
> Is there a really good book out there that will teach
> me php???
> 
> thanks
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com

-- 



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




Re: [PHP] Redirecting - here is the code

2003-01-16 Thread Mike Morton
You cannot have ANY output b4 sending a header unless you are buffering your
output.  In your example you are sending HTML before your redirect - the
redirect has to happen before you do any kind of HTML or any characters that
would get output to the browser.

On 1/16/03 12:40 PM, "Denis L. Menezes" <[EMAIL PROTECTED]> wrote:

> I ahve tried everything jason. It says that there should be no output before
> the header().
> 
> I cannot still find the error. Can you please help in locating the error?
> 
> thanks
> Denis
> - Original Message -
> From: "Jason Wong" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 17, 2003 1:10 AM
> Subject: Re: [PHP] Redirecting - here is the code
> 
> 
>> On Friday 17 January 2003 01:07, Denis L. Menezes wrote:
>>> I tried. But I get an error as follows :
>>> 
>>> Warning: Cannot add header information - headers already sent by (output
>> 
>> Try searching the archives on the above error.
>> 
>> --
>> Jason Wong -> Gremlins Associates -> www.gremlins.biz
>> Open Source Software Systems Integrators
>> * Web Design & Hosting * Internet & Intranet Applications Development *
>> 
>> /*
>> Stenderup's Law:
>> The sooner you fall behind, the more time you will have to catch up.
>> */
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--
Cheers

Mike Morton


*
*  E-Commerce for Small Business
*  http://www.dxstorm.com
*
* DXSTORM.COM
* 824 Winston Churchill Blvd,
* Oakville, ON, CA L6J 7X2
* Tel: 905-842-8262
* Fax: 905-842-3255
* Toll Free: 1-877-397-8676
*


"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