RE: [PHP] Problem connecting to POP3 accounts

2003-04-03 Thread Danny Shepherd
Try:

$strMailServer = {domain.co.uk:110/pop3}INBOX;

As per the manual.

HTH

Danny.

-Original Message-
From: Alec Wallis [mailto:[EMAIL PROTECTED] 
Sent: 03 April 2003 18:35
To: [EMAIL PROTECTED]

Hi

I am currently experiencing some problems connecting to POP3 accounts using
imap_open.

I am using the following code:

$ArrayImap = imap_open ($strMailServer, $strUsername, $strPassword);

with the mail server being set to:

$strMailServer = {domain.co.uk/pop3:110}INBOX;

It seems to connect ok, as if an incorrect username or password is entered
incorrectly something different happens.  The error message I seem to get
is:

Notice: (null)(): Mailbox is empty (errflg=1) in Unknown on line 0
PHP Notice: (null)(): Mailbox is empty (errflg=1) in Unknown on line 0 

When I view the mailbox in Outlook it has messages in it and so isn't empty.
Can anyone help me please?


Alec



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



RE: [PHP] Constants and Here Document Interpolation

2003-03-01 Thread Danny Shepherd
Hello,

It doesn't look like it - a note in the constants manual entry reads:

PHP has no way of recognizing the constant from any other string of
characters within the heredoc block

Danny.

-Original Message-
From: Daniel R. Hansen [mailto:[EMAIL PROTECTED] 
Sent: 01 March 2003 15:57
To: [EMAIL PROTECTED]

Can anyone tell me if it is possible (and how) to use defined constants
within here document content?  I've not been successful finding anything
on this in the online docs.

Thanks!

Dan




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



Re: [PHP] Capitalising Personal Names

2003-02-28 Thread Danny Shepherd
Hi,

Well it's hardly rocket science - a flick through the manual and I came up
with :

$name=ucwords(strtolower($name));

HTH

Danny.

- Original Message -
From: Geoff Caplan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 28, 2003 10:31 AM
Subject: [PHP] Capitalising Personal Names


 Hi folks,

 I need to clean up the capitalisation of user-entered personal names.

 Once you start thinking about it, you realise it is a non-trivial
 issue, but previous discussions on the list presented only very
 partial solutions.

 In Perl, there are Cpan modules such as namecase and nameparse which
 handle this quite well. Does anyone have anything similar in PHP?

 Thanks
 --

 Geoff Caplan
 Advantae Ltd


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




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



Re: [PHP] Finally!!! A workaround to mail() in PHP...

2003-02-19 Thread Danny Shepherd
I'd say an even simpler workaround would be to add '[EMAIL PROTECTED]' as
the fifth parameter to the mail function - just as in example 3 of the docs.

Danny.

- Original Message -
From: Scott Fletcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 19, 2003 3:43 PM
Subject: [PHP] Finally!!! A workaround to mail() in PHP...


 Finally a workaround to the problem in mail() in PHP  I did the
posting
 somewhere, so I'll cut to the chase by posting it here  My recent
 posting does not work too well

 --clip--
 This is for any Unix or Linux machine using the Sendmail.  However, no
 guarentee that it would work in Windows.

 Some SMTP won't accept e-mail with the From: host@domain without the
 suffix com, like domain.com, so using the From: [EMAIL PROTECTED]
option
 in the $header in the mail() does not solve the problem for me.

 Someone suggest using the php.ini with the configuration by adding the -f
 [EMAIL PROTECTED] to the sendmail path.  Example look like this

 --clip--
 sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED]
 --clip--

 This is not an option for me because it is limit to one user, not more
than
 one and it override the From: [EMAIL PROTECTED] option in the $header in
 mail()..  So, Finally there is a workaround to the problem and it is very
 simple  Just add this entrie to the /etc/hosts file in Unix or Linux.
 Just substitute the word in bracket for a value
 --clip--
 ip addressmachine's_host.domain.com
 --clip--

 Example ...
 --clip--
 123.456.789.012  xyz.abc.com
 --clip--

 Make sure your machine do the search order with the host first before the
 DNS or Nameserver.  In my case in AIX, is /etc/netsvc.conf.

 Hope

 Make sure your machine is set to read the host file first before the DNS
or
 the nameserver, if not then make some changes to it.  In my case for AIX,
it
 is /etc/netsvc.conf...

 Hope this help
 --clip--



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



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




Re: [PHP] What's the scoop on PHP 5?

2003-02-13 Thread Danny Shepherd
The latest cvs snapshots for PHP4.3.x and PHP5.0.x can be found at
http://snaps.php.net

Danny.

- Original Message -
From: Leif K-Brooks [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 13, 2003 8:50 PM
Subject: [PHP] What's the scoop on PHP 5?


 Anyone know what the status of PHP 5 is?  I can't find reference of it
 on php.net, and the only place I can find an alpha of it is at the PHP
 Museum.

 --
 The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.



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



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




Re: [PHP] Attaining NTLM information from IE browsers.

2003-02-08 Thread Danny Shepherd
There is actually an NTLM Auth module available for Apache.
(http://modntlm.sourceforge.net/).

If you really need to do it though PHP I'd suggest running a packet sniffer
to see what headers IIS sends and what to expect back from IE.

HTH

Danny Shepherd.

- Original Message -
From: Marriner, Bruce W. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, February 08, 2003 6:39 PM
Subject: [PHP] Attaining NTLM information from IE browsers.



I know this is in the archives, but I couldnt seem to find the answer I
needed.  I am running redhat8, apache 2.0.44, and php 4.2.2.
I am trying to write a script that will emulate the IIS server and request
NTLM auth. from the browser.  And then decode the base64? information and
compate the user information against a ldap function that connects to a
active directory server.  I know that you must modify the header with the
header() command.  I have done that, and the most I get in one line of
information back from the browser.  There is suppose to be three lines of
encoded information sent back.   If anyone has any code or knows the
complete hand shake or anything really, I would really like the help. This
is a really big project at my company, and they are considering moving to a
linux platform and even PHP.  But if I can't make the same stuff work that
their w2k cold fusion platform does.  It's not going to work so well.




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


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




Re: [PHP] PHP Framework

2003-02-03 Thread Danny Shepherd
Well, Yahoo! have moved/are moving to Smarty and they get a few million
views a day.

The killer part with smarty is that it converts the Smarty tags, in your
template, to real PHP code - that's what makes it so fast. It's also very
easy to extend.

Danny.


- Original Message -
From: John Wards [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 03, 2003 2:41 PM
Subject: Re: [PHP] PHP Framework


On Monday 03 Feb 2003 2:01 pm, karthikeyan.balasubramanian wrote:
 Hi All,

   I finally decided to upgrade my PHP.  Just want to know your thoughts on
 which Framework is the best with a clear seperation of content from
 presentation.

   Please let me know which do you think is the best and why?

I use SMARTY (smarty.php.net) and think its the dogs bolxs.

Its fast, its easy to use. The template pasing language is simple.

My site gets somewhere in the region on 100,000 p.v.s a day and it copes
easily.

But, there is a pertender lurking in the shadows.

phorum.org, yes its a message board. But phorum 5 which is not pre alpha yet
has its own built in templating system which I thnk with a bit of tweaking
could be used as a full blown templating system.

John

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


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




[PHP] Re: [SOAP] Re: soap post and http 1.1 100 continue

2003-01-25 Thread Danny Shepherd

- Original Message -
From: Dominik Wittenbeck [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 25, 2003 3:28 PM
Subject: [SOAP] Re: soap post and http 1.1 100 continue


 Yep, know that one,

 Why it does happen:
 although the HTTP 1.1 spec states that a HTTP 100 SHOULD NOT (or was it
MUST
 NOT ;-) to the client, unless it requires it by a specific header, IIS
does
 it with webservices and thereby about any that are published and
maintained
 with .NET ;-)

Not quite right :

An origin server SHOULD NOT send a 100 (Continue) response if the request
message does not include an Expect request-header field with the
100-continue expectation, and MUST NOT send a 100 (Continue) response if
such a request comes from an HTTP/1.0 (or earlier) client. There is an
exception to this rule: for compatibility with RFC 2068, a server MAY send a
100 (Continue) status in response to an HTTP/1.1 PUT or POST request that
does not include an Expect request-header field with the 100-continue
expectation. This exception, the purpose of which is to minimize any client
processing delays associated with an undeclared wait for 100 (Continue)
status, applies only to HTTP/1.1 requests, and not to requests with any
other HTTP-version value.

 Solution:
 A HTTP 100 basically states: ok I am ready for your content now. You
have
 probably submitted your content already... resend it, but the content
only,
 without the \r\n\r\n mark that separates headers from payload with HTTP.
 To serve a clean solution you should however go ahead and implement a
 listener that tries to hear a HTTP 100. With PHP this is kind of tiresome.
 In my implementation I also just resend the payload ;-)

A HTTP 100 basically states ok based on your headers I won't reject your
body data, so send it now - handy for services which need to check specific
headers. Imagine if the client sent 5MBs of data only to have it knocked
back because an authorization header wasn't present. :-)

I suppose a better solution would be to use the 100-Continue properly (i.e.
send headers + with an expect header and no body) or send HTTP/1.0 requests.

HTH

Danny.


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




Re: [PHP] Script under Windows OK, under Linux, not...

2003-01-25 Thread Danny Shepherd
Why are you opening the file in append mode?

As the manual says:  a+' - Open for reading and writing; place the file
pointer at the end of the file.

Try using 'r+' instead or rewind the file pointer before reading.

Danny.

- Original Message -
From: Daniel Page [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 25, 2003 11:39 AM
Subject: [PHP] Script under Windows OK, under Linux, not...


 Hi,

 I have the following code :

 $_fp = fopen(/home/dh2240/mgt/index.php, a+) or die();
 $_contents = fread($_fp,filesize(/home/dh2240/mgt/index.php));
 fclose ($_fp);
 //Menu elements
 $_sme = strpos($_contents,sub_menu_elements);
 echo sme = $_smep;
 ...

 It should display somthing like sme = 850, after finding the string in
the
 specified file.

 Under windows, this script works fine (except replacing the
 /home/dh2240/mgt/index.php by c:/apache/htdocs/mgt/index.php)... it
 seems that the file index.php cannot be opened under linux...
 The file is chmod 777, along with the directory /mgt, and the files
 identical, but still no luck... The fopen does not die(), but it does not
 seem to read any data from the file... I'm confused, and not sure how to
 check what is happening... Anyone got any ideas ?

 Cheers,
 Daniel



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



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




Re: [PHP] Random Row...

2003-01-16 Thread Danny Shepherd
Don't make life difficult for yourself :)

SELECT * FROM myTable ORDER BY RAND() LIMIT 0,1

HTH

Danny.

- Original Message - 
From: Brian McGarvie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 16, 2003 9:37 AM
Subject: [PHP] Random Row...


 $sql = 
 select count(*) as theCount
 from myTable
 ;
 ...
 $row_id = rand(1, $myrow[theCount]);
 ...
 $sql_randow_row 
 select *
 from myTable
 where id = $row_id
 ;
 
 I assume I'm right with the method above to select a random row? or any
 other way?
 

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




Re: [PHP] Getting a dynamic IP address

2003-01-16 Thread Danny Shepherd
$_SERVER['SERVER_ADDR'] gives the address of the server running the php
script
$_SERVER['REMOTE_ADDR'] gives the client address or the proxy address. (be
careful here, storing a proxy's IP is next to useless)
$_SERVER[' HTTP_X_FORWARDED_FOR'] gives the client address if they're behind
a proxy (if this isn't set then they probably aren't behind a proxy so you
can use the remote_addr instead)

HTH

Danny.


- Original Message -
From: Kyle Lampkin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 11:41 PM
Subject: [PHP] Getting a dynamic IP address


Hello all,
 Newbie here I need to know if there is a way I can get my dynamic IP
 address for use in a php script?
 --
 Your favorite stores, helpful shopping tools and great gift ideas.
 Experience the convenience of buying online with Shop@Netscape!
 http://shopnow.netscape.com/


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



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




Re: [PHP] Question about $_GET

2003-01-15 Thread Danny Shepherd
Try

$query = SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
{$_GET['id']};

HTH

Danny.
- Original Message -
From: Frank Keessen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 10:50 AM
Subject: [PHP] Question about $_GET


Hi All,

Can you please help me with the following problem? I've had code wich was
running fine with php till i've upgraded to PHP version 4.2.3.

The original code line was:

$query = SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
'$id';

but it's not working when you have register_globals=Off
So i've read everywhere to use the $_Get:

So the code looks like this:

$query = SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
$_GET['id'];

But all i'm getting in my browser is:

parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'


Can someone please help?

Thanks and regards,

Frank


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




Re: [PHP] HTTP_ACCEPT - Reliabilty?

2003-01-14 Thread Danny Shepherd
Hi,

No, I wouldn't rely on it at all, I couldn't find a browser that *does* have
that mime-type in it's header! - Here's what IE6 sends :

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/msword, */*
Accept-Language: en-gb
Accept-Encoding: gzip, deflate

Flash, along with a multitude of other plugins, is installed and working
fine.

FWIW, Mozilla 1.3a sends:

Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate,compress;q=0.9

Opera 7 sends:

Accept: text/html, image/png, image/jpeg, image/gif, image/x-xbitmap,
*/*;q=0.1
Accept-Language: en
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0



- Original Message -
From: SED [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 10:22 AM
Subject: [PHP] HTTP_ACCEPT - Reliabilty?


 I'm using Flash very often within websites. Like you know, sometimes the
 user doesn't have the Flash-plug-in so I was wandering if I could depend
 on this $_SERVER['HTTP_ACCEPT'] variable to look for shockwave-flash.
 If found, the visitor has Flash-plugging, if not, he doesn't.

 So my question really is, can I base my Flash-detection on this global
 variable or is too uncertain? (e.g. when the user is using Netscape,
 Opera etc., Linux, Mac etc.)

 Regards,
 Sumarlidi E. Dadason

 SED - Graphic Design
 _
 E-mail: [EMAIL PROTECTED]
 website: www.sed.is


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



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




Re: [PHP] php5 cvs

2003-01-11 Thread Danny Shepherd
It includes the latest CVS build of ZendEngine 2.0 - AFAIK it hasn't even
reached beta status yet, so don't even think about using it for production
work. That said, I didn't have any problems building it and it seems pretty
stable.

A list of changes and features can be found at
http://www.php.net/ZEND_CHANGES.txt.

HTH

Danny.

- Original Message -
From: electroteque [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 11, 2003 6:50 PM
Subject: [PHP] php5 cvs


 hi guys just noticed php5 cvs in the snaps page , does this have the zend
 2.0 engine ? more specific question has it got the proper OO built in yet
?



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



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




Re: [PHP] Is this possible with php?

2003-01-10 Thread Danny Shepherd
Hi,

Where did he say he wanted to use Word to edit PHP files? AFAICT the idea
was to automatically upload Word files, presumably to make them available on
an Intranet for download etc.

As for uploading a file automatically - PHP isn't going to do it. An app
which can map a virtual drive in Windows would probably be the best bet - I
think Windows has built in support for mapping WebDAV and FTP servers as
shares so this may be a good starting point.

HTH

Danny.

- Original Message -
From: Maxim Maletsky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, January 10, 2003 11:38 AM
Subject: Re: [PHP] Is this possible with php?



 [EMAIL PROTECTED] wrote... :

  I would like to know if the follwing function can be implemneted
  in php with help of other tools:

 in PHP distribution? PHP is the programming language, not a
 client/server tool. This is definitely something to be an integrated
 part of something else.

  using MS Word in windows,

 MS Word for editing PHP files? That is very, very bad ... You will never
 find a job if ever mention it to an employer. Search the archives of
 this list for PHP Editors. I recommend Edit Plus for plain-text
 programming. If you want a whole IDE then Zend Studio is probably the
 best for you.

  when a file is saved, can it be AUTOMATICALLY
  uploaded (via http POST or other mechanism) to a server?
 
  Currently I need to first save it on my desktop, then upload that copy
  to a php-supported server.

 Oh well, there are four ways to accomplish this.


 1. Professional way:

 Using CVS. CVS (cvshome.org) is a system that allows you to version your
 files. This, in two words, works this way: in CVS, you `checkout'
 (update) a file, edit it, and save it (if somebody else edited that file
 while you edited yours both changes will merge). CVS is the most
 professional solution for this thing.


 2. Simplest way:

 Use a mapped networking like Samba. This will mean that you will see
 your server just as it was a hard disk on your windows. You dragdrop
 files there and the same will occur remotely. Not a very secure way,
 though.


 3. FTP integrated tool:

 Get a good editor that has some FTP integration. It will means that when
 you `save' a file in your editor, it will automatically FTP that file on
 the server. A very tool-dependent way but can work. Very cruel when
 something goes wrong, though. Again, Zend IDE and Edit Plus can do that.


 4. The Geeky way:

 Edit all your files in a simple VIM or other fancy directly on the
 server by logging there with telnet or SSH.


 Have fun.


 --
 Maxim Maletsky
 [EMAIL PROTECTED]


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



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




Re: [PHP] money

2003-01-09 Thread Danny Shepherd
http://www.php.net/manual/en/function.number-format.php

- Original Message -
From: Wilbert Enserink [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 10:44 AM
Subject: [PHP] money


Hi all,



I'm busy making a swebstore. I have troubles with the format of money.

I wanrt to display amounts like 2 products a ? 6,25 = ? 12,50


Whatever I try I can't get the comma there (it's showing a point . and it
doesn't display the second number behind the comma i.e. 12.5

Anybody knows how to make me my money? :-)

regards Wilbert




-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


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




Re: [PHP] Apache 2 and PHP 4.2.3.

2002-11-16 Thread Danny Shepherd
In short - looks as if your version of Apache 2 is out of date.

You're using a version from 28th June, the PHP dll was built against a
version from 3rd September.

Danny.

- Original Message -
From: Horst Gassner [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 16, 2002 12:06 PM
Subject: [PHP] Apache 2 and PHP 4.2.3.


 Hi!

 When I am laoding php as module:
 LoadModule php4_module c:/php/sapi/php4apache2.dll

 I get the following error:
 Apache.exe: module c:\php4build\snap\sapi\apache2filter\sapi_apache2.c
is not
 compatible with this version of Apache (found 20020628, need 20020903).
 Please contact the vendor for the correct version.

 What I am doing wrong?

 Thanx in advance
 Horst


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




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




Re: [PHP] Re: GD 1.5

2002-11-16 Thread Danny Shepherd
Actually, GD2 can be compiled (after a patch) to read/write GIFs with LZW
compression (the LZW algorithm is the root of the legal iffyness), but
(AFAIK) you're only legally allowed to enable it if you live outside the US
 Canada. AFAIK only FreeBSD's ports system does this atm.


- Original Message -
From: Mako Shark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 15, 2002 7:18 PM
Subject: [PHP] Re: GD 1.5


 If the OP was concerned about such issues then
 he/she should not be using GIF at all!

 This is leading me to believe that I can't use GIFs
 because of these issues. Is this true? I know now that
 Unisys (Unisys?) made a fuss about some compression or
 whatever, but someone told me it was still okay to use
 old GDs (am I naive? maybe). Is it now considered
 piracy to use GIFs at all? Does this mean I have to
 switch over to JPGs, even those images that compress
 better with GIFs? I just assumed we were still
 permitted, what with Jasc and everybody still allowing
 it in their products. Is JPEG (or PNG) the way to go?
 I hesitate using PNGs since they seem to be the
 least-supported out of the 'big three'.


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




Re: [PHP] OOP-related question

2002-11-14 Thread Danny Shepherd
Hello,

Adding the following as the first line of overall-load() should solve your
problem.

global $$class;

HTH,

Danny.

- Original Message -
From: Tularis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 14, 2002 8:18 PM
Subject: [PHP] OOP-related question


 Hey,
 I have the following script:
 class overall {

 function overall(){
 $this-loaded['overall'] =1;

 function load($class){

 $$class = new $class;
 $this-loaded[$class] = 1;

 $$class-setup(); // Run constructor

 if(!is_object($$class)){
 return false;
 }
 return true;
 }
 }

 then I have a few classes, which hold a setup() function as thei
 'constructor'. Then, I do this:

 $overall = new overall;
 $overall-load('debug');

 this should load the debug class. I want it to load to $debug-, but it
 won't even load to $overall-debug

 It's not really a *need* to have this, it's just something that will
 help me in keeping control over all classes. I don't want to use new
 class, because this way it would be easier to 'instruct' the
 'constructor' of those new classes to change the values of the vars to a
 specific one, without calling for something weird...

 anyway, it doesn't work, and it doesn't spit out an error either.
 Any ideas?

 - Tularis


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




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




Re: [PHP] OOP-related question

2002-11-14 Thread Danny Shepherd
I think the error is fairly self explanatory here - you can't pass the
parameter by reference. Globalising the $$class var will retain scope.

Danny.

- Original Message -
From: Tularis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 14, 2002 9:29 PM
Subject: Re: [PHP] OOP-related question


 Ok, I combined both, your tip and Brent's, now I have the following
 error, with the following code:

 Fatal error: Cannot pass parameter 1 by reference in
 /home/shadowlight/public_html/test/libs/global.lib.php on line 296

 code:
 function load($class){
 global $$class;

 $$class = new $class;
 $this-loaded[$class] = 1;

 $$class-setup(); // Run constructor

 if(!is_object($$class)){
 return false;
 }
 return true;
 }
 }
 Danny Shepherd wrote:

  Hello,
 
  Adding the following as the first line of overall-load() should solve
  your
  problem.
 
  global $$class;
 
  HTH,
 
  Danny.
 
  - Original Message -
  From: Tularis
  To:
  Sent: Thursday, November 14, 2002 8:18 PM
  Subject: [PHP] OOP-related question
 
 
 
  Hey,
  I have the following script:
  class overall {
  
  function overall(){
  $this-loaded['overall'] =1;
  
  function load($class){
  
  $$class = new $class;
  $this-loaded[$class] = 1;
  
  $$class-setup(); // Run constructor
  
  if(!is_object($$class)){
  return false;
  }
  return true;
  }
  }
  
  then I have a few classes, which hold a setup() function as thei
  'constructor'. Then, I do this:
  
  $overall = new overall;
  $overall-load('debug');
  
  this should load the debug class. I want it to load to $debug-, but it
  won't even load to $overall-debug
  
  It's not really a *need* to have this, it's just something that will
  help me in keeping control over all classes. I don't want to use new
  class, because this way it would be easier to 'instruct' the
  'constructor' of those new classes to change the values of the vars to
a
  specific one, without calling for something weird...
  
  anyway, it doesn't work, and it doesn't spit out an error either.
  Any ideas?
  
  - Tularis
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 


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




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




Re: [PHP] Elliptic curve cryptology

2002-09-22 Thread Danny Shepherd

http://www.amazon.com/exec/obidos/ASIN/1884777694/102-5129419-0804910

- Original Message -
From: EjdeR [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 22, 2002 11:12 AM
Subject: [PHP] Elliptic curve cryptology


 i cant find any example about Elliptic curve cryptology.. do you have
any
 example? i cant understand without an example :)




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



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




Re: [PHP] Why isn't there much info on apache2?

2002-09-20 Thread Danny Shepherd

Apache 2 isn't officially supported yet. If you get the latest version of
both then you shouldn't hit to many hurdles but you should know that you'll
get no official support and it isn't recommended for production
environments.

If you need Apache2 then you'll know why - if you don't know what the
advantages are, you'll probably be better off with Apache 1.3.26 anyway.

Danny.

- Original Message -
From: pierre.samson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 20, 2002 4:00 PM
Subject: Re: [PHP] Why isn't there much info on apache2?


 Any particular reason... future plans or is apache2 is not worthy?
 Adam Williams [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Yeah, apache 2.0 and php don't like each other.
 
  Adam
 
  On Fri, 20 Sep 2002, pierre.samson wrote:
 
   I'm building a new server and would like to use:
   php4
   apache 2.xxx
   mod_ssl
   MySQL
   mod_perl
  
   Is there any major hurdle?
  
   Thanks
  
   Pierre B. Samson
   CAMBAR
  
  
  
  
 



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



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




Re: [PHP] In version 4.2.1 ereg_replace break Apache

2002-08-12 Thread Danny Shepherd

Have you tried it on a non debug build?

Danny

- Original Message -
From: Marcello Lupo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 12, 2002 8:14 PM
Subject: [PHP] In version 4.2.1 ereg_replace break Apache


 ## A simple function to remove consonant ##
 $temp=thisisatry;
 $temp=ereg_replace([BCDFGHJKLMNPQRSTVWXYZ],,$temp);
 echo $temp;


 I get :

 [Mon Aug 12 18:13:29 2002] [notice] child pid 16363 exit signal
Segmentation
 fault (11)
 FATAL:  emalloc():  Unable to allocate 1087156712 bytes

 In apache logs.


 THis is my configure line:

 './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-debug'
 '--enable- calendar' '--enable-ftp'
 '--with-imap=../imap-2001.BETA.SNAP-0107022325' '-- with-mcrypt'
 '--with-mhash' '--with-mysql=/usr' '--enable-memory-limit' '--
 enable-track-vars' '--with-zlib' '--with-pdflib'
 '--with-ttf=/usr/local/include' '-- with-jpeg-dir=/usr'
 '--with-tiff-dir=/usr' '--with-system-regex=yes' '--with-gettext'
 '--with-openssl' '--with-fdftk'



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




Re: [PHP] dates greater than 2002-01-18 create error

2002-08-12 Thread Danny Shepherd

It's a fairly well known problem now but I'm sure we'll all be using (at
least) 64bit integers for storing this sort of stuff by 2038.

FYI, the current 32bit signed int allows for around 68years - a 64bit signed
int will give us a few billion years :)

Danny.

- Original Message -
From: John Wards [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 12, 2002 5:32 PM
Subject: Re: [PHP] dates greater than 2002-01-18 create error


 right am i missing something or is that not just an other Y2K bug
waiting
 to happen?

 Not that I plan to be coding php in 2038 but my kids might be.:-P

 John
 - Original Message -
 From: Adam Voigt [EMAIL PROTECTED]
 To: Jay Blanchard [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, August 12, 2002 5:26 PM
 Subject: RE: [PHP] dates greater than 2002-01-18 create error


  Dude, did you read the PHP Date manual page?
 
  I quote:
 
  Note:  The valid range of a timestamp is typically from Fri, 13 Dec 1901
  20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that
  correspond to the minimum and maximum values for a 32-bit signed
  integer). On windows this range is limited from 01-01-1970 to
  19-01-2038.
 



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




Re: [PHP] Whois...

2002-08-12 Thread Danny Shepherd

http://phpbuilder.com/snippet/download.php?type=snippetid=1086 - This one
works pretty well - checks most domain (everything except .tv and such)

HTH

Danny.

- Original Message -
From: David Freeman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 12, 2002 11:32 PM
Subject: RE: [PHP] Whois...



   I'd like to implement on my web site an whois to know the
   information about a domain name (.com, org, )

 There's an article about doing exactly this on devshed
 (www.devshed.com/Server_Side/PHP/) that you could have a look at. Looked
 like a pretty complete solution when I went looking for this yesterday
 and found the article.

 CYA, Dave




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



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




Re: [PHP] Include php code as variable

2002-08-03 Thread Danny Shepherd

http://www.php.net/eval

- Original Message - 
From: Alawi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 11:41 AM
Subject: [PHP] Include php code as variable


 How can I Include my php code code as variable and excute it ? 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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




Re: [PHP] string questions

2002-08-03 Thread Danny Shepherd

Try, 

list($test)=explode(' ',$address);

HTH

Danny

- Original Message - 
From: webmaster [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 02, 2002 5:35 PM
Subject: [PHP] string questions


 I know there has to be an easy way to do this, but I just can't find the
 answer.  I need to strip out the first part of a text string.  I've
 figured out out to strip out the last part of a string using the
 following:
 
 $address = (4455 N. 45th St.);
 
 $test = strstr($address,  );
 echo $test;
 
 The variable $test returns N. 45th St. without the 4455.  Is there a way
 to reverse this so I can just return 4455?


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




Re: [PHP] what is equivalent to Response.End ?

2002-08-03 Thread Danny Shepherd

http://php.net/die
http://php.net/exit

Both will stop your code. Dead.

Danny.

- Original Message -
From: Ing. Rajesh Kumar [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 3:50 PM
Subject: [PHP] what is equivalent to Response.End ?


 Hi everybody
 Can someone tell me what is the PHP equivalent code to ASP's Response.End
?
 I want to stop my code at a given position so i need this.

 thanks in advance
 Raja




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



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




Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd

try

\\1

- Original Message -
From: Phil Ewington [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 5:03 PM
Subject: [PHP] RegEx (back referencing)


 Hi,

 I am am writing a function to color code and indent JavaScript source
using
 regular expressions and cannot seem to get back referencing working. The
 pattern match is successful but the output is a single unrecognised
 character (a square).

 $string = eregi_replace((/?)(scr[^]*), «font
color=maroon»\1«/font»,
 $string);

 This results in opening and closing script/script tags being replaced
 with a square being wrapped in font tags. I have this working in Cold
Fusion
 but cannot seem to convert my scripts to PHP. Can anyone help?

 TIA

 Phil Ewington.


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



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




Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd

If you're trying to get scriptLots of javascript/script to look like
font color=maroonLots of javascript/font then this will be a start

$string = eregi_replace('(/?)(scr[^]*)', '\\1font
color=maroon',$string);

This will produce -  font color=maroonLots of javascript/font
color=maroon - not perfect, but a start.

Danny.

- Original Message -
From: Phil Ewington [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 5:52 PM
Subject: RE: [PHP] RegEx (back referencing)


 \\1 outputs nothing at all wrapped in font tags and closing tags \ wrapped
 in font tags :o(



  -Original Message-
  From: Danny Shepherd [mailto:[EMAIL PROTECTED]]
  Sent: 03 August 2002 17:47
  To: [EMAIL PROTECTED]; PHP General
  Subject: Re: [PHP] RegEx (back referencing)
 
 
  try
 
  \\1
 
  - Original Message -
  From: Phil Ewington [EMAIL PROTECTED]
  To: PHP General [EMAIL PROTECTED]
  Sent: Saturday, August 03, 2002 5:03 PM
  Subject: [PHP] RegEx (back referencing)
 
 
   Hi,
  
   I am am writing a function to color code and indent JavaScript source
  using
   regular expressions and cannot seem to get back referencing working.
The
   pattern match is successful but the output is a single unrecognised
   character (a square).
  
   $string = eregi_replace((/?)(scr[^]*), «font
  color=maroon»\1«/font»,
   $string);
  
   This results in opening and closing script/script tags
  being replaced
   with a square being wrapped in font tags. I have this working in Cold
  Fusion
   but cannot seem to convert my scripts to PHP. Can anyone help?
  
   TIA
  
   Phil Ewington.
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



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




Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd

What does the input string contain?

What does the output look like?

It might be a problem with php4.0.4 (I'm using 4.2.2) - why such an old
version?

Danny.

- Original Message -
From: Phil Ewington [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 6:23 PM
Subject: RE: [PHP] RegEx (back referencing)


 Danny,

 It still doesn't work, could this be a problem in 4.0.4pl1 ??



  -Original Message-
  From: Danny Shepherd [mailto:[EMAIL PROTECTED]]
  Sent: 03 August 2002 18:11
  To: [EMAIL PROTECTED]; PHP-General
  Subject: Re: [PHP] RegEx (back referencing)
 
 
  If you're trying to get scriptLots of javascript/script to look like
  font color=maroonLots of javascript/font then this will be a start
 
  $string = eregi_replace('(/?)(scr[^]*)', '\\1font
  color=maroon',$string);
 
  This will produce -  font color=maroonLots of javascript/font
  color=maroon - not perfect, but a start.
 
  Danny.
 
  - Original Message -
  From: Phil Ewington [EMAIL PROTECTED]
  To: Danny Shepherd [EMAIL PROTECTED]
  Sent: Saturday, August 03, 2002 5:52 PM
  Subject: RE: [PHP] RegEx (back referencing)
 
 
   \\1 outputs nothing at all wrapped in font tags and closing
  tags \ wrapped
   in font tags :o(
  
  
  
-Original Message-
From: Danny Shepherd [mailto:[EMAIL PROTECTED]]
Sent: 03 August 2002 17:47
To: [EMAIL PROTECTED]; PHP General
Subject: Re: [PHP] RegEx (back referencing)
   
   
try
   
\\1
   
- Original Message -
From: Phil Ewington [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 5:03 PM
Subject: [PHP] RegEx (back referencing)
   
   
 Hi,

 I am am writing a function to color code and indent
  JavaScript source
using
 regular expressions and cannot seem to get back referencing
working.
  The
 pattern match is successful but the output is a single
unrecognised
 character (a square).

 $string = eregi_replace((/?)(scr[^]*), «font
color=maroon»\1«/font»,
 $string);

 This results in opening and closing script/script tags
being replaced
 with a square being wrapped in font tags. I have this
  working in Cold
Fusion
 but cannot seem to convert my scripts to PHP. Can anyone help?

 TIA

 Phil Ewington.


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

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


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



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




Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd

Ok, a very slightly modified version of your first attempt should work then

$fcontent = eregi_replace((/?)(scr[^]*), «font
color=maroon»\\0«/font», $fcontent);

Note the \\0 instead of \\1

HTH

Danny.

- Original Message -
From: Phil Ewington [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 8:54 PM
Subject: RE: [PHP] RegEx (back referencing)


 Danny,

 OK, the input string is the contents of a file, the idea is to output
color
 coded and indented code in HTML. So searching for script and replace
with
 font color=maroonscript/font, so the script tag shows on a page. I
 am slowly converting a ColdFusion script which currently color codes CFML,
 HTML, JS  PHP code.

 // get file and pass into string
 $filename = /path_to_file/newsfeed.js;
 $fcontent = implode(, file($filename));

 // convert new lines, tabs and multiple spaces
 $fcontent = eregi_replace(chr(10), «br», $fcontent);
 $fcontent = eregi_replace(chr(9), nbsp;nbsp;nbsp;nbsp;, $fcontent);
 $fcontent = eregi_replace( {2,2}, nbsp;nbsp;, $fcontent);

 // color code script
 $fcontent = eregi_replace((/?)(scr[^]*), «font
 color=maroon»\\1«/font», $fcontent);

 // allow html tags in strings to print
 $fcontent = eregi_replace([^('|\)]br[^('|\)], «br», $fcontent);

 // allow script tags to display
 $fcontent = eregi_replace(, lt;, $fcontent);
 $fcontent = eregi_replace(, gt;, $fcontent);
 $fcontent = eregi_replace(«, , $fcontent);
 $fcontent = eregi_replace(», , $fcontent);


 // get filename from path
 $filename = explode(/, $filename);
 $filename = $filename[count($filename) - 1];

 // print formatted content
 print \n
 div
 div style=\font-family:verdana; font-size:x-small; color:#FF;
 background-color:#00; padding:5px;\$filename/div
 div style=\font-family:courier new, mono; font-size:x-small;
 background-color:#EE; padding:10px; border:1px #00
 solid;\$fcontent/div
 /div;

 ?

 The output looks as follows (so far)...
 http://www.n-igma.net/regex.php

 Got the indenting sorted, now needs to be color coded.

 I am using an old version as I know very little about *nix and compiling
the
 binaries for PHP on a RAQ3 was a headache, well for a Windows user any way
 ;o) I have not wanted to upgrade yet as I have a number of sites running
on
 the box and haven't had the balls to in case I screw it up again!


 Phil.
  -Original Message-
  From: Danny Shepherd [mailto:[EMAIL PROTECTED]]
  Sent: 03 August 2002 18:26
  To: [EMAIL PROTECTED]; PHP General
  Subject: Re: [PHP] RegEx (back referencing)
 
 
  What does the input string contain?
 
  What does the output look like?
 
  It might be a problem with php4.0.4 (I'm using 4.2.2) - why such an old
  version?
 
  Danny.
 
  - Original Message -
  From: Phil Ewington [EMAIL PROTECTED]
  To: PHP General [EMAIL PROTECTED]
  Sent: Saturday, August 03, 2002 6:23 PM
  Subject: RE: [PHP] RegEx (back referencing)
 
 
   Danny,
  
   It still doesn't work, could this be a problem in 4.0.4pl1 ??
  
  
  
-Original Message-
From: Danny Shepherd [mailto:[EMAIL PROTECTED]]
Sent: 03 August 2002 18:11
To: [EMAIL PROTECTED]; PHP-General
Subject: Re: [PHP] RegEx (back referencing)
   
   
If you're trying to get scriptLots of javascript/script
  to look like
font color=maroonLots of javascript/font then this will
  be a start
   
$string = eregi_replace('(/?)(scr[^]*)', '\\1font
color=maroon',$string);
   
This will produce -  font color=maroonLots of javascript/font
color=maroon - not perfect, but a start.
   
Danny.
   
- Original Message -
From: Phil Ewington [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 5:52 PM
Subject: RE: [PHP] RegEx (back referencing)
   
   
 \\1 outputs nothing at all wrapped in font tags and closing
tags \ wrapped
 in font tags :o(



  -Original Message-
  From: Danny Shepherd [mailto:[EMAIL PROTECTED]]
  Sent: 03 August 2002 17:47
  To: [EMAIL PROTECTED]; PHP General
  Subject: Re: [PHP] RegEx (back referencing)
 
 
  try
 
  \\1
 
  - Original Message -
  From: Phil Ewington [EMAIL PROTECTED]
  To: PHP General [EMAIL PROTECTED]
  Sent: Saturday, August 03, 2002 5:03 PM
  Subject: [PHP] RegEx (back referencing)
 
 
   Hi,
  
   I am am writing a function to color code and indent
JavaScript source
  using
   regular expressions and cannot seem to get back referencing
  working.
The
   pattern match is successful but the output is a single
  unrecognised
   character (a square).
  
   $string = eregi_replace((/?)(scr[^]*), «font
  color=maroon»\1«/font»,
   $string);
  
   This results in opening and closing script/script tags
  being replaced
   with a square being wrapped in font tags. I have this
working in Cold

Re: [PHP] Re: Protect PHP coding

2002-08-03 Thread Danny Shepherd

So, go write JSP for someone then and stop bugging us.

- Original Message -
From: Acer [EMAIL PROTECTED]
To: Scott [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 10:48 PM
Subject: RE: [PHP] Re: Protect PHP coding


 Scott wrote:
  You're kidding, right?  When was the last time you saw one the creator
of
  ASP on a mailing list personally answering code questions?

 Call me a cynic but to maintain your status as php god you have to
 contribute to the list so you can sign a book deal.

 Scott wrote:
  For what it's worth, I just left a 50,000 employee company that would
not
  let me use PHP in production until I showed them the Zend suite of
  products.  When I asked for the money to buy their IDE and it arrived I
  was allowed to move my PHP code to production.

 So zend charges a huge amount of money so that your boss can feel good
about
 making the right decision.  That's great but how's that working?  Is php
 becoming a contender?  Like I said before do a search for php developers,
 you won't find any demand for it.  Jsp is newer then php and they have a
lot
 more jobs available so something isn't working.



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




Re: [PHP] PHP Hosting

2002-08-02 Thread Danny Shepherd

Take a look at this directive :
http://www.php.net/manual/en/configuration.php#ini.open-basedir

Danny.

- Original Message -
From: Matt Babineau [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 02, 2002 2:04 PM
Subject: [PHP] PHP Hosting


 If any PHP hosts are out there I have a question:

 How do you keep users from erasing / altering files out side of their
 web folder with PHP? Doesn't PHP run in the system user context? Is is
 possible to prevent a user from using PHP to alter anything but in their
 Web folder?

 Matt Babineau
 MCWD / CCFD
 -
 e:  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 p: 603.943.4237
 w:  http://www.criticalcode.com/ http://www.criticalcode.com
 PO BOX 601
 Manchester, NH 03105




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




Re: [PHP] Form asking to refresh when I hit the back button

2002-08-01 Thread Danny Shepherd

This is generally caused by using POST as the form's methods. Try using GET
instead.

Danny.

- Original Message -
From: DonPro [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 3:57 PM
Subject: [PHP] Form asking to refresh when I hit the back button


 Not sure if this is a PHP question but I've traced the problem to a PHP
 statement.

 I have a form that when submitted, displays a PDF document in the browser
 (using a PDF library).  When I click on the back button, it should
redisplay
 my form but instead, displays a warning that data has expired and I need
to
 refresh.  Now this never happened until recently so I look at recent
changes
 and traced the problem to one single PHP statement at the top of my file:

 session_start();

 I am using sessions to pass values between pages and so added the
statement
 to my page so that I could check the value of a variable.  When I comment
 out the above statement, I am no longer prompted to refresh.

 Question: How can I have my cake and eat it to?

 Thanks,
 Don



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



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




Re: [PHP] web services and PHP

2002-08-01 Thread Danny Shepherd

I think he means XML WebServices (probably using SOAP)

It's not too difficult, there are a few SOAP classes for PHP now, simply
send your SOAP encoded request to the server, via HTTP, and decode the SOAP
response that you get back.

There's also a SOAP module for PHP (alpha release atm) at
http://phpsoaptoolkit.sourceforge.net/phpsoap/

If you're after an all in 1 solution you might want to look at nusoap - but
it was really buggy the last time I used it, so I don't recommend it at this
time.

I've heard something about another all in 1 solution that's quite
promising - but it's behind closed doors atm.

Danny.

- Original Message -
From: Bob Lockie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 4:09 PM
Subject: Re: [PHP] web services and PHP



 A'la ASP WebServices perhaps?
 
 Bob Lockie [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  I'd like to know if it's possible to use PHP to develop and implement
  Web Services. If so, please point me to sites, articles, or tutorials
  that discuss this topic in more detail. Thanks.
 
  How do you define web services?

 I know nothing about ASP.







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



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




Re: [PHP] mcrypt

2002-08-01 Thread Danny Shepherd

Just base64 encode the mcrypt output if the non printable chars bother you,
though I don't really see what the problem is, unless you're pushing the
output to a web page.

Danny.


- Original Message -
From: Randy Johnson [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 4:24 PM
Subject: [PHP] mcrypt


 I am looking into different password encryption solutions.

 i started using crypt()

 then changed to mcrypt()

 which was not any good cause of the high ascii characters

 then i read about converting the high ascii characters to hex .

 Is this the ideal way to encrypt passwords or is their something better.

 Thanks

 Randy



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



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




Re: [PHP] Problem with ?xml .... inside the PHP code, due to ?

2002-08-01 Thread Danny Shepherd

Try:

?php
$XML = .?xml version='1.0' encoding='UTF-8'?ProductApple/Product;
echo $XML;
?

HTH

Danny.

- Original Message -
From: Scott Fletcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 5:03 PM
Subject: [PHP] Problem with ?xml  inside the PHP code, due to ?


 Anyone know the workaround with the situation here?  Here is the sample
 script.  The problem is I include the XML tag into the PHP variable and it
 messed up everything.  It all had to do with ? here since PHP use it
also.

 --clip--
 ?php
 $XML = ?xml version='1.0' encoding='UTF-8'?ProductApple/Product;
 echo $XML;
 ?

 Thanks,
  FletchSOD



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



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




Re: [PHP] mcrypt

2002-08-01 Thread Danny Shepherd

Try setting the database field type to 'BLOB'

Danny.

- Original Message -
From: Randy Johnson [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 4:51 PM
Subject: Re: [PHP] mcrypt


 I found that the some of the high ascii characters would not store right
in
 the database or something cause when i went to compare them, the
comparison
 would fail.


 Randy

 - Original Message -
 From: Danny Shepherd [EMAIL PROTECTED]
 To: Randy Johnson [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, August 01, 2002 11:31 AM
 Subject: Re: [PHP] mcrypt


  Just base64 encode the mcrypt output if the non printable chars bother
 you,
  though I don't really see what the problem is, unless you're pushing the
  output to a web page.
 
  Danny.
 
 
  - Original Message -
  From: Randy Johnson [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Thursday, August 01, 2002 4:24 PM
  Subject: [PHP] mcrypt
 
 
   I am looking into different password encryption solutions.
  
   i started using crypt()
  
   then changed to mcrypt()
  
   which was not any good cause of the high ascii characters
  
   then i read about converting the high ascii characters to hex .
  
   Is this the ideal way to encrypt passwords or is their something
better.
  
   Thanks
  
   Randy
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 




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




Re: [PHP] Disabling Browser BACK button

2002-07-31 Thread Danny Shepherd

On processing page (I.e the form's action page - where the stuff is entered
into the db) set another session var so that your app knows that the form
has been submitted, data entered etc. The actual form page should have some
extra logic at the top which checks for this extra session var, redirecting
to an 'already done this' page if the var is set. I suppose this logic
should also exist in the action page, in case the user hits back and browser
reposts the data.

Example:

1. User fills out form on 'form.php' and hits submit - browser loads
'action.php'
2. action.php checks for $_SESSION['formIsFilled'] and redirects if found,
enters data into db otherwise.
3. user hits back and goes back to form.php - if browser has cached then
user will be able to resubmit but will be caught at step2. If the browser
didn't cache they'll be caught here.

This method will prevent them resubmitting for the length of their session
(or until $_SESSION['formIsFilled'] is unset)

HTH

Danny.
- Original Message -
From: Chris Boget [EMAIL PROTECTED]
To: Dan Vande More [EMAIL PROTECTED]; Petre [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, July 31, 2002 6:53 PM
Subject: Re: [PHP] Disabling Browser BACK button


  Page1 (fill in data)-Page2(write data, instant redirect to p1,
  unless dies from php/mysql)
  Then the only way to repost, is to push the forward button.

 Unless, of course, they hit the Submit button again and I think
 that was the point the original poster was getting at.  If the user
 cannot hit the back button, they cannot hit submit again.

 Chris



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



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




[PHP] Sessions - Informed Opinions

2002-07-30 Thread Danny Shepherd

Hello All,

So, I've been using my own implementation of session handling which is
mainly storing the userinfo in a cookie (an array, serialised and signed)
but I'm starting to come around to the idea of storing this info on the
server and just passing a session key about - but I have a couple of
reservations, which I'm hoping someone can confirm or resolve :

Assuming that sessions are stored on the filesystem by default:
1 How secure is this? Could someone with system level access simple
wander into the session store directory and start browsing though the
session data?
2 Are expired sessions removed from the filesystem automatically? How
often is this garbage collection performed?
3 How can I get a count of currently active (I.e non expired) sessions?
4 Are there any performance issues to worry about doing it this way?
5 Is it quicker to do it this way or store sessions in a db using
session_set_save_handler?

Like the subject says, I'm after informed opinions on this subject rather
than rumours and hearsay.

As for my setup - it's a BSD box - Apache2.0.39 + PHP4.2.2 (apache module) +
PHP4.3.0dev-Zend2alpha2 (cgi) - both compiled with pretty much everything.

Thanks a lot people,

Danny.


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




Re: [PHP] apache and php

2002-07-30 Thread Danny Shepherd

For release systems, the recommended setup is Apache 1.3.26 + PHP4.2.2

The developer systems, I'd go for (indeed have gone for) Apache 2.0.39 +
PHP4.2.2

HTH

Danny.
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 11:01 AM
Subject: [PHP] apache and php


 Hello,

 Which version of apache and which version of php are good for work
 together ?

 Thank for your help...

 Edward.



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



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




Re: [PHP] Sessions - Informed Opinions

2002-07-30 Thread Danny Shepherd

 Comments inline 

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Cc: PHP-General [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 11:24 AM
Subject: Re: [PHP] Sessions - Informed Opinions


  Assuming that sessions are stored on the filesystem by default:
  1 How secure is this? Could someone with system level access simple
  wander into the session store directory and start browsing though the
  session data?

 Well, at least as secure as passing this stuff out across the Internet to
 random clients where anybody can steal these cookies and present them back
 to you in a spoof attack.

Fair enough

  2 Are expired sessions removed from the filesystem automatically?
How
  often is this garbage collection performed?

 Sure.  You configure it.  See php.ini

  3 How can I get a count of currently active (I.e non expired)
sessions?

 Count the number of session files.
Can I be sure that the count will only include active sessions though?


  4 Are there any performance issues to worry about doing it this way?

 Not really

  5 Is it quicker to do it this way or store sessions in a db using
  session_set_save_handler?

 Should be slightly quicker if your database is nice and fast and your
 schema is sane.
Great


  As for my setup - it's a BSD box - Apache2.0.39 + PHP4.2.2 (apache
module) +
  PHP4.3.0dev-Zend2alpha2 (cgi) - both compiled with pretty much
everything.

 Why in the world are you running Apache2?  You are not running it threaded
 anyway (since you are on FreeBSD) so you are not gaining any of the
 threaded scalability that is Apache2's only real selling point right now.
 You are running code that acts just like Apache 1.3.x except it is much
 less stable (at least with PHP).

Can't say I've really noticed any stability issues - even with PHP (there
was that multiple cookie bug but even so). It's a dev box (the release boxes
all use Apache1.3.x) and TBH, I was playin' about some of Apache2's other
features, such as the dynamic vhosting, which might be useful to me later.

Thanks for the reply though,

Danny.


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




Re: [PHP] apache and php

2002-07-30 Thread Danny Shepherd


- Original Message - 
From: [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 11:30 AM
Subject: Re: [PHP] apache and php


 Danny Shepherd wrote:
 
  For release systems, the recommended setup is Apache 1.3.26 + PHP4.2.2
 
 They are good for work under Linux RedHat ( 6.x / 7.x ) system ?
 
Yeah, should be Ok. 

Danny.



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




Re: [PHP] Sessions - Informed Opinions

2002-07-30 Thread Danny Shepherd


- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Cc: PHP-General [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 11:52 AM
Subject: Re: [PHP] Sessions - Informed Opinions


3 How can I get a count of currently active (I.e non expired)
  sessions?
  
   Count the number of session files.
  Can I be sure that the count will only include active sessions though?

 By definition, if the session file is there, it is an active session.
 There is no such thing as counting active users on the Web.  You define a
 time window and count how many users accessed your site within that
 window.  Once a session has been idle for a time  than the configured
 session gc time, it will get deleted.  I tend to do this out of band
 though.  PHP has a mechanism for calling the session gc code, but I prefer
 to turn this off and run my own cron job that does this regularly.  And
 yes, this is easier to manage if you have a database where you can do a
 simple count() query to get the number of active sessions.

Right, db sessions seem to be the way for me, thanks Rasmus. (Oh, thanks for
PHP too :)

Danny.


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




[PHP] Serialised Data DBs

2002-07-30 Thread Danny Shepherd

Hi,

Is it necessary to perform addslashes() on serialised data before inserting
it into a database?

Thanks,

Danny.


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




Re: [PHP] Serialised Data DBs

2002-07-30 Thread Danny Shepherd


- Original Message -
From: 1LT John W. Holmes [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]; PHP-General
[EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 8:18 PM
Subject: Re: [PHP] Serialised Data  DBs

 Yes, it'd be really smart to. If any of the data in the serialized string
 has a ' or  in it, it could break your query. Or the user being able to
 enter a ' or  into the data could open you to SQL attacks.

 You want to do addslashes() on the result of serialize(), not the content
 going into it, too. PHP will introduct double quotes around any strings
that
 are serialized. These should be escaped or they could end up breaking your
 query.
Yeah, the contents are already stripslashed.

 Note that you don't have to do stripslashes() on the serialized string
when
 you pull it out.

Cool, didn't realise that - would've been hard to track down later too!

Thanks,

Danny.


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




Re: [PHP] Trouble Making 4.2.2

2002-07-30 Thread Danny Shepherd

I think your actual error is much further up - the sapi appears because
you're building PHP as an Apache module.

The actual error will have a (kind of) English description - post that along
with your config options and a more detailed description of your setup and
maybe we can help.

Danny.

- Original Message -
From: David Busby [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 8:16 PM
Subject: [PHP] Trouble Making 4.2.2


 List,
 I get this after make installis this thing trying to make sapi?  I
 want to run on Apache/RH7.3 so I don't know if I need it...couldn't find
 how to turn in with ./configure.  Please help

 TIA
 /B


 make[1]: Leaving directory `/usr/src/php-4.2.2/regex'
 Making install in .
 make[1]: Entering directory `/usr/src/php-4.2.2'
 make[1]: *** [install-sapi] Error 1
 make[1]: Leaving directory `/usr/src/php-4.2.2'
 make: *** [install-recursive] Error 1



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



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




Re: [PHP] Sessions - Informed Opinions

2002-07-30 Thread Danny Shepherd


- Original Message -
From: Tech Support [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 6:44 PM
Subject: Re: [PHP] Sessions - Informed Opinions


 If you're on a shared system it's very easy for other users on your
machine
 to read session data. All you have to do is opendir(/tmp) and then
 readdir() and copy the files into something you can read. I have
programmed
 a few commerce sites and this issue has bothered me a few times and with
 each new site I find better and more secure methods.

Yeah, the whole shared hosting thing has me bothered - until Apache can run
as a different user for each vhost (allowing tighter filesystem security on
the docroot), I'm steering well clear of the whole situation - thankfully
our clients generally own their own boxes :-)

 The beauty of sessions in php is that the user does not need to accept
 cookies for it to work. If you have --enable-trans-sid, which on by
default
 in 4.2.X you only need to manually add the session id in two cases:

 1. you are using a full URL in a form or a link. Even if it's your full
URL
 php will still assume it's off site and thus not append the session id to
 the query string.

 2. You use a header redirect (relative or full URL)

 I use mysql to store session data via session_set_save handler in favor of
 file type. It took me a long time to find code that worked because the
 documentation is not as clear as it could be. I found some code that half
 way worked but it would seg fault apache on my system so I search message
 boards and asked questions until I found the problem. I now have a set of
 functions that work great. Anyway, what I'm getting at is that, if you
want
 it, I would be happy to share it with you.

Thanks for the offer but guess what I've just finished doing? :-) I'll agree
that the docs were well flaky though!

Thanks,

Danny.



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




Re: [PHP] Re: Public Scripts in a commercial product

2002-07-30 Thread Danny Shepherd


- Original Message -
From: David Freeman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 6:09 AM
Subject: RE: [PHP] Re: Public Scripts in a commercial product



   Yes, I am afraid that regarding GPL I have to agree with
   Microsoft when they say it is a cancer. The problem is that if you
 want to
   distribute something that incorporates GPL licensed components, your
   software also needs to be distributed as GPL and so it gets
 contaminated.
   This means that you can't sell your closed source software if you
   incorporate GPL components.

 I'm quite happy to be corrected on this but I have always understood GPL
 licensing to mean that any GPL code you include should be available in
 source version.  The methods by which you use that GPL code doesn't
 necessarily have to be included.  The only relevant example I can think
 of is if you include a class in php that is GPL then you have to
 distribute the source even if you compile it with zend for your own
 application.

 It is my understanding, in this situation, that you aren't necessarily
 required to release the code you have written as GPL though.  Basically,
 I thought that once something is GPL it is pretty much public forever
 but that doesn't stop you from including it in your own proprietory work
 as long as you include the source for the GPL stuff.

Unfortunately, you are required to release your entire project as GPL if you
use GPL'd components - the GPL licence is quite clear.

Quoted from section 2 of the GPL: (http://www.gnu.org/licenses/gpl.txt)

b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

I think you're thinking of the much less restrictive LesserGPL (LGPL) which
requires you to make the source available for the LGPL components and any
changes you've made to those components but doesn't require you to release
the entire project.

Like most people I know, I'm totally against the GPL license and totally for
Apache/BSD and LGPL licenses.

HTH

Danny.



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




Re: [PHP] Array variable in Javascript PHP

2002-07-29 Thread Danny Shepherd

Try using:

input type=checkbox id=list1 name=list1[] value=Education
onclick=addList() Education
input type=checkbox id=list1 name=list1[] value=Profession
onclick=addList() Profession

That's what I used when doing something pretty similar to you.

HTH

Danny.


- Original Message -
From: Sheni R. Meledath [EMAIL PROTECTED]
To: PHP Masters [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 4:11 PM
Subject: [PHP] Array variable in Javascript  PHP


 Hello:

 In a form I am using a series of check boxes for a number of lists. Some
 calculations has to be done on the client side using Javascript depending
 upon the check box values. For this I am using a single variable name
 (array) for the check boxes in a list and another for the next list and so
 on. The format I have used is
 input type=checkbox name=list1 value=Education onclick=addList()
 Education
 input type=checkbox name=list1 value=Profession
onclick=addList()
 Profession

 I can access these variables from Javascript as list1[0]  list1[1].
 (document.form.list1['0'].checked  document.form.list1['1'].checked

 But when this form is submitted to the PHP script I am getting only the
 last value. list1 = 'Profession'. I am not getting an array of values.
 ?
 for ($i=0; $icount($list1); $i++)
 {
 $listall .= '$list1[$i],';
 }
 ?



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




Re: [PHP] Re: PostgreSQL

2002-07-29 Thread Danny Shepherd

Checkout this FAQ - http://www.ejip.net/faq/postgresql_win_setup_faq.jsp

HTH

Danny.

- Original Message -
From: 1LT John W. Holmes [EMAIL PROTECTED]
To: Richard Lynch [EMAIL PROTECTED]; Hadi [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 2:24 PM
Subject: Re: [PHP] Re: PostgreSQL


  I don't *think* PostgreSQL runs under Windows, really...
 
  You can maybe install the CygWin stuff (a Linux emulator under Windows)
 and
  get that to work, but:

 Can anyone confirm that PG will run under CygWin? Will it communicate with
 PHP running on Windows, too? I'm just looking for a way to get familar
with
 PG, nothing production level, so I don't care how slow it is or how often
it
 crashes...

 Or can PG be compiled for Windows?

 ---John Holmes...


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



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




Re: [PHP] Encrypting Passwords - Is it really necessary??

2002-07-29 Thread Danny Shepherd

Ok, here's how I do it:

1. User clicks the lost password page:
2. Email is sent to user's registered email address. Email contains a url to
the newpassword page and has a validation code. This validation code is also
stored in the userinfo table (it's the MD5 of current date + time + random
chars).
3. User clicks link and is taken to page.
4. If the supplied validation code checks out, the user gets to pick a new
password there and then.
5. If the user didn't want to change the password (i.e.. the abuse scenario
you talked of) they simply ignore the email - no change occurs.

So :
The passwords can be encrypted in the database.
The system is difficult to abuse.
Passwords are never sent out over email.
User gets to choose own password.

Well it works for me anyway :)

HTH

Danny.


- Original Message -
From: Monty [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 10:30 PM
Subject: [PHP] Encrypting Passwords - Is it really necessary??


 Is it really necessary to store passwords encrypted in a mySQL DB for a
 membership site if you're not storing sensitive info such as credit card
 numbers? How much security does that offer, really, and for whom?

 The reason I ask is because I'm trying to implement a forgot password
 feature on a membership site. But if I store passwords encrypted, I can't
 just send the password to their e-mail address, I have to generate a new
one
 before sending it, which essentially locks that member out of the site
until
 they get their new password. This has the potential to be abused by a
 vindictive person. All they need to know is the member's username or
e-mail
 address and they can keep re-generating new passwords (locking the member
 out of their own account) for a member to annoy them.

 If the password wasn't encrypted, I could just e-mail their existing
 password. The only annoyance then would be someone sending this password
 over and over to another user, but, at least they won't get 20 new
passwords
 and be locked out of their account as a result.

 If anyone else has dealt with this issue, I'd appreciate your insight.

 Thanks!

 Monty


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



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




Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble

2002-07-25 Thread Danny Shepherd

Try building apache2 and modphp4 using the FreeBSD ports system - that's how
I compiled and it works fine here.

HTH

Danny.
Apache2.0.39/PHP4.2.2/FreeBSD4.6

- Original Message -
From: Chad Day [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 5:38 PM
Subject: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble


 Simple build, no real complicated configure options
 (--with-mysql, --with-apxs2..) ..

 During make:

 php_functions.c:93: syntax error
 *** Error code 1

 Stop in /usr/local/php-4.2.2/sapi/apache2filter.

 etc
 etc


 Any idea what the problem would be?  I googled around for a little and
heard
 there might be problems getting the latest php to work with apache 2.0.39,
 but that was a couple weeks ago.. I thought the new 4.2.2 build might
 address it, but I guess if it's only a security fix like the site says,
 maybe not.. does 4.2.* just not work with Apache 2.0.39, or is something
 else amiss?

 Thanks,
 Chad


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



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




Re: [PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-18 Thread Danny Shepherd

Try using just '\n' not '\r\n' as notepad doesn't understand carriage
returns, hence the funny little square.

- Original Message -
From: Vincent Kruger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 18, 2002 9:11 AM
Subject: Re: [PHP] Re: Binary Files :: They Keep Adding Blocks


 yeah but your check i get this funny little square in note pad.
 it's a line carier... but if i take it out then everything is one line
which
 i don't want.
 and if i take it out and then put it in again i'm back to sqaure one.




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




Re: [PHP] Of Jobs and Certs

2002-07-17 Thread Danny Shepherd

I agree - nothing beats a good portfolio.

Danny.

- Original Message -
From: Miguel Cruz [EMAIL PROTECTED]
To: Martin Clifford [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, July 17, 2002 6:55 PM
Subject: Re: [PHP] Of Jobs and Certs


 On Wed, 17 Jul 2002, Martin Clifford wrote:
  I'd like to get everyone's input on Jobs and Certs.  I know there are a
  couple Certifications for web developers out there, such as the CIW and
  CWP certifications.

 I don't know if this is what you want to hear, but I can tell you that as
 a rule, I don't hire people who advertise certifications on their resume.

 I've found that they correlate pretty strongly with incompetence, to the
 point where nothing saves me more time when filtering through resumes than
 first throwing away the ones covered with acroyms starting with C or MC.

 People who have the skills, demonstrate it through their work experience,
 walking through their sample code with me, and their ability to explain
 how they would perform a task. People who trumpet certifications
 overwhelmingly seem to be people who were unable to advance their careers
 based on the strength of their skills, and so chose to resort to a paper
 method instead. I'm not saying anything about you here, just suggesting
 that you consider alternate means of impressing employers.



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




Re: [PHP] GIF Manipulation

2002-07-16 Thread Danny Shepherd

GD2 does have a compile time option which will re-enable support for writing
GIFs. AFAIK you're only legally allowed to enable it if you live outside of
the US/Canada.

HTH

Danny.

- Original Message -
From: Jason Reid [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Nick Oostveen [EMAIL PROTECTED]
Sent: Wednesday, July 17, 2002 12:04 AM
Subject: Re: [PHP] GIF Manipulation


 AFAIK there is a patch to re-add gif support to gd 1.8.4 (not sure about
 2.x). I saw the url for it the other day on a newsgroup, I'll see if i can
 dig it up and post it.

 Jason Reid
 [EMAIL PROTECTED]

 - Original Message -
 From: Nick Oostveen [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, July 16, 2002 3:58 PM
 Subject: [PHP] GIF Manipulation


  I'm currently developing a site which needs the ability to do
server-side
  image cropping and resizing.  I currently have a current version of GD
  installed with PHP, however the lack of support for GIFs is causing
 endless
  headaches.
 
  Is there any way to support GIFs in PHP without reverting to an older
  version of GD (and loosing PNG support in the process)?
 
  Nick Oostveen
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



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



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




Re: [PHP] mcrypt

2002-07-16 Thread Danny Shepherd

ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/

- Original Message -
From: Peter [EMAIL PROTECTED]
To: php_gen [EMAIL PROTECTED]
Sent: Wednesday, July 17, 2002 1:16 AM
Subject: [PHP] mcrypt


 Howdy all..
 does any one know of another place i can download a win32 ver of mcrypt
other than
 http://mcrypt.hellug.gr/  ?

 as that site crashes my browser when i click any link on the page...

 Cheers

 Peter
 the only dumb question is the one that wasn't asked



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




Re: [PHP] PHP 4.3.0-dev and gd

2002-07-11 Thread Danny Shepherd

You need to compile with GD2 if you want to use any of the 2.* functions in
PHP - phpinfo will say 'GD 2.0 or higher'

HTH

Danny.

- Original Message -
From: Kevin Waterson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 11, 2002 1:49 PM
Subject: [PHP] PHP 4.3.0-dev and gd


 trying to get the built in gd to work without luck
 I am using redhat and it has gd 1.8.4(or something)
 but the newer compiled version does not seem to install.

 I check with phpinfo and it just says 1.6.2 or higher
 but none of the 2.* functions work so I assume the
 new gd did not install. my config line looks like this..

./configure --with-apxs=/usr/sbin/apxs --with-mysql=/usr --with-ttf=/usr --e
nable-track-vars --enable-ftp --enable-imap --enable-ssl --enable-versioning
 --enable-trans-sid --enable-sysvsem --with-config-file-path=/etc --with-gd

 kind regards
 Kev

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



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




Re: [PHP] PHP and Apache2?

2002-07-10 Thread Danny Shepherd

Who knows when they'll officially state that PHP runs on Apache2 - I've been
running it for a while now without much trouble (4.2.1 + 2.0.36/2.0.39) -
the only problem that I've really seen (though not been affected by) is that
multiple cookies seem to break - only the last cookie is set (obviously
overwriting the previous cookie headers) but PHP know about this and it
should be fixed in the next release (it's probably fixed in CVS already).

I've not found any problems with the common compiled extensions. (check
http://phpinfo.kyboshed.com [anon/badpassword] for a list of the ones I'm
running)

If I were running a full scale production server I might think differently
and run with Apache 1.3.26 but I'm not, just a pro-development server.

HTH

Danny.

- Original Message -
From: Johan Holst Nielsen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 8:10 AM
Subject: [PHP] PHP and Apache2?


 Hi,

 Anyone know how long the developers is from a finale release that
 support Apache 2?

 Please advice!

 Regards,

 Johan


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



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




Re: [PHP] ???? etc

2002-07-10 Thread Danny Shepherd


- Original Message -
From: Mark Gallagher [EMAIL PROTECTED]
To: Ben Ramsey [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 10:14 AM
Subject: Re: [PHP]
??ØØ


 The list really can be a valuable resource (I don't know much PHP, so I
 don't contribute often - but I read a lot of it), so I'd urge you not to
 unsubscribe.  Or, if you do unsubscribe, to wait out until Erik is
 likely to have finally worked out how to leave, then re-subscribe.

Zeev's already banned him from all php.net lists - he can't post now, even
if he wanted too!

Danny.



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




Re: [PHP] Now a Question for all you ARRAY Junkies

2002-07-10 Thread Danny Shepherd

just sort($Lang);

A question: wouldn't it have been quicker to knock out a couple of test
files to see which is the right way?

HTH

Danny.

- Original Message -
From: vins [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 1:36 PM
Subject: [PHP] Now a Question for all you ARRAY Junkies


 I have an array
 $Lang = array('English','German','French','Zulu');
 I want it in alphabetical order

 do i reset the arrray first or usort it first 



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



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




Re: [PHP] Dos Paths

2002-07-10 Thread Danny Shepherd

The problem with this method is assuming the ~1 part. What if I have:

'My Directory'- MYDIRE~1
'My DirectoryForPics'  - MYDIRE~2

Now if your path has 'My DirectoryForPics' it's going to translate that into
MYDIRE~1 which won't work.

HTH

Danny.


- Original Message -
From: Michael Sims [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 1:48 PM
Subject: Re: [PHP] Dos Paths


On Wed, 10 Jul 2002 13:14:44 +0100, you wrote:

I've got an application that requires dos folder names (8.3 standard) as
input.

I also have PHP, which quite happily can cope with both.

Can someone help me write a function to translate full paths to dos paths

Thanks

Maybe this can get you started.  I don't have access to a PHP parser
right now so this is completely off the top of my head, but maybe it
will help a  bit.

The function below assumes that the path contains backslashes (not
forward slashes).  It also does not verify that the path is legal in
the first place (i.e. that it doesn't contain illegal characters).
Additionally, it doesn't deal with filenames, just directory names.
Maybe you can extend to handle filenames. :)

One last thing.  You can't really create a function like this without
accessing the filesystem that these files are going to be stored on.
For example, let's say you have a file called my resume.doc  The DOS
equivalent to this would be myresu~1.doc UNLESS there was already
another file in the same directory that had that DOS name.  So, let's
say there was already another file by the name of my results.doc in
the directory.  Then your my resume.doc would be called
myresu~2.doc  The function below does not account for this.

Come to think of it, maybe this isn't all that helpful. :-P

function fullpath2dospath ($fullpath) {

  if(preg_match(/^([A-Za-z]:)(.*)$/,$fullpath)) {
$driveletter = $matches[1];
$fullpath = $matches[2];
  }

  $dirs = explode(\,$fullpath);

  foreach($dirs as $index = $dir) {

/*
Directory only needs to be modified if it
contains spaces or is longer than 8
characters
*/
if(strlen($dir)  8 || strpos($dir, )) {
  $dir = strtr($dir, ,);
  $dir = substr($dir,0,6);
  $dirs[$index] = $dir.~1;
}
  }

  $dospath = $driveletter.implode(\,$dirs);
  return $dospath;

}

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



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




Re: [PHP] cookies

2002-07-10 Thread Danny Shepherd

To set a session cookie (one that is deleted when the browser window is
closed) set a cookie without any expire date/time.

To delete a cookie set a cookie of the same name with an expire date in the
past.

HTH

Danny.

- Original Message -
From: Alexander Ross [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 2:43 PM
Subject: [PHP] cookies


 How can I set a cookie which expires when the borwser is closed??  How can
I
 delete a cookie via PHP?

 Thanks



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



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




Re: [PHP] Dos Paths

2002-07-10 Thread Danny Shepherd

Ah, that'll teach me to actually read the post next time, not just the code
:)

Danny.


- Original Message -
From: Michael Sims [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 2:02 PM
Subject: Re: [PHP] Dos Paths


On Wed, 10 Jul 2002 13:56:39 +0100, you wrote:

Yeah, I mentioned that in my original post (see below).  I left that
particular issue as an exercise for the reader. :-)

- Original Message -
From: Michael Sims [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 1:48 PM
Subject: Re: [PHP] Dos Paths
[...]
One last thing.  You can't really create a function like this without
accessing the filesystem that these files are going to be stored on.
For example, let's say you have a file called my resume.doc  The DOS
equivalent to this would be myresu~1.doc UNLESS there was already
another file in the same directory that had that DOS name.  So, let's
say there was already another file by the name of my results.doc in
the directory.  Then your my resume.doc would be called
myresu~2.doc  The function below does not account for this.
[...]


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




Re: [PHP] Re: cookies

2002-07-10 Thread Danny Shepherd

No, I just tested it myself - if you set a cookie with no expire date it
exists until the browser window is closed.

My code:

?php

if (!isset($_COOKIE['TestCookie']))
{
 setcookie (TestCookie, FUD);
 echo Just Set a cookie - reload the page;
}
else
{
 echo Cookie is : {$_COOKIE['TestCookie']}brClose the window then return
and the cookie should be gone;
}

?

HTH

Danny.

- Original Message -
From: vins [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 3:34 PM
Subject: [PHP] Re: cookies


 Nope thats not they way
 If you don't specify a expire date it will live for ever or until you
delete
 it.

 The only way is to set it with an expiry date and then it will delete
 it'self when the browser closes.
 Check this by running a file on the same domain with phpinfo();


 Alexander Ross [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  How can I set a cookie which expires when the borwser is closed??  How
can
 I
  delete a cookie via PHP?
 
  Thanks
 
 



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



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




Re: [PHP] question varibles and url

2002-07-10 Thread Danny Shepherd

What version of PHP are you using? Have you got register_globals on? If
they're off you'll need to get the $sort variable by using
$HTTP_GET_VARS['sort'] (or $_GET['sort'] if you're using PHP4.1.0 or later)

You attachched the wrong file (html output instead of PHP source)

You really could do with a spell checker btw :-)

HTH

Danny.

- Original Message -
From: @cid
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 10:24 PM
Subject: [PHP] question varibles and url


on my page (lessen.php)

i have a variable $sort

if this varible is empty if enterd the page then it will be set on 'day'

i have 3 links in the page

lessen.php?sort=day
lessen.php?sort=game
lessen.php?sort=player

so these links refure to the same page (itself)
on clicked it opens itself and should set the varible to day, game or player
but that doesn't happen.
can somebody help me please


see attachmend

greetz @cid









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


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




Re: [PHP] header()

2002-07-09 Thread Danny Shepherd

header() simply sends response headers - I.e adds/replaces server headers -
it has no effect on request headers sent by the client.

If, for some reason, you want to alter the user-agent you've received from
the client (for testing maybe?) you can do this:

echo $_SERVER['HTTP_USER_AGENT'];
$_SERVER['HTTP_USER_AGENT']='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
5.1; .NET CLR 1.0.3705)';
echo $_SERVER['HTTP_USER_AGENT'];

HTH

Danny
- Original Message -
From: Taylor York [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 09, 2002 4:54 PM
Subject: [PHP] header()


 I'm trying to change some information in the header...lets say that User
 Agent for example...but it just wont change.

 putenv() will change the User Agent..but nothing else will

 ?
 $ua = Mozilla/4.0 (compatible;);

 header(User-Agent: $ua\n, TRUE);
 header(Accept: */*, TRUE);

 //putenv(HTTP_USER_AGENT=$ua);

 echo \nbruser agent: ;
 echo getenv(HTTP_USER_AGENT);
 ?

 Suggestions?



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



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




Re: [PHP] ??????????????????????????????????????????????????????````````````````````ØØØØØØØØØØ

2002-07-09 Thread Danny Shepherd

If read the earlier posts you'll find that this is the guy who was to thick
to unsubscribe himself this morning - he obviously still hasn't got it so
he's trying to get a lifetime ban.

So sad, so filtered :)

Danny.
- Original Message -
From: Rodolfo Gonzalez [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 09, 2002 8:32 PM
Subject: Re: [PHP]
??ØØ



 To the kind moderator of the list: please kick off this guy (Erik
 Hegreberg [EMAIL PROTECTED] ), he's really annoying. Or at least bounce
 his e-mails back to him ;) ).

 Thanks.


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



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




Re: [PHP] STARTTLS with IMAP?

2002-07-09 Thread Danny Shepherd

Not sure - but i've heard that this works:

$mbox = imap_open ({localhost:995/pop3/tls/novalidate-cert}, user_id,
password);

So maybe it does, no promises though :)

HTH

Danny.
- Original Message -
From: Alexander Skwar [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 09, 2002 8:17 PM
Subject: [PHP] STARTTLS with IMAP?


Hi!

Does imap_open in PHP 4.2.1 support STARTTLS?

Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.iso-top.de  |Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 2 days 11 hours 41 minutes

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


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




Re: [PHP] Time to Calculate Time

2002-07-08 Thread Danny Shepherd

Try this:

?php

function unixTime($time)
{
 $year=substr($time,0,4);
 $month=substr($time,4,2);
 $day=substr($time,6,2);
 $hour=substr($time,8,2);
 $min=substr($time,10,2);
 $sec=substr($time,12,2);

 return strtotime($year/$month/$day $hour:$min:$sec);
}

$time1='2002070714';
$time2='2002070716';

$timeDiff=unixTime($time2)-unixTime($time1);

echo The two times are $timeDiff seconds apart;
?

There's bound to be a way to do this much more neatly using a regexp but
this was quick to write and it works :)

HTH

Danny.


- Original Message -
From: vins [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 4:02 PM
Subject: [PHP] Time to Calculate Time


 Hey there ppl..

 One dam thing i've been trying to figure out for about 2 weeks now it how
 the hell to calculate time.

 i have variables $Start, $End each with a timestamp 2 hours apart
 (2002070714, 2002070716) respectively

 How do i calculate those to timestamps to get the answer 2?

 I've tried working them into unix timestamps and then calculating but no
 luck...

 any one got any ideas ??

 Thanx
 Vins



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



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




Re: [PHP] Time to Calculate Time

2002-07-08 Thread Danny Shepherd

You just knew there was a regexp version on the way, didn't you :)

Danny.

?php

function unixTime($time)
{
 $time=preg_replace('/(.{4})(.{2})(.{2})(.{2})(.{2})(.{2})/','\\1/\\2/\\3
\\4:\\5:\\6',$time);
 return strtotime($time);
}

$time1='2002070714';
$time2='2002070716';

$timeDiff=unixTime($time2)-unixTime($time1);

echo The two times are $timeDiff seconds apart;
?




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




Re: [PHP] Button can't see form!

2002-07-04 Thread Danny Shepherd

Actually, it's Netscape'sCrap, if you get specific :) Java's a totally
different kettle of crap.

Danny.

- Original Message -
From: Analysis  Solutions [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Thursday, July 04, 2002 4:05 PM
Subject: Re: [PHP] Button can't see form!

 And then folks with Java'sCrap turned off won't use your site.




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




Re: [PHP] Problem with Apache2/PHP4.2.1

2002-06-27 Thread Danny Shepherd

Try actually looking in the Apache2 manual -
http://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo

HTH

Danny.

- Original Message -
From: Simon Grabowski [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, June 23, 2002 3:08 PM
Subject: [PHP] Problem with Apache2/PHP4.2.1

 This same approach has worked perfectly for me
 in apache 1.3.26, and it correctly launched
 script go when someone opened URL such
 as http://www.mydomain.com/go/something/somewhere

 Unfortunately, with Apache 2.0.39 only
 http://www.mydomain.com/go works okay, but
 http://www.mydomain.com/go/bla/bla results in a 404 error.
 (it looks as if Apache treats 'go' as directory, not as
 a script - despite the settings in .htaccess - and therefore
 it can't find the location)



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




Re: [PHP] PHP and OOP

2002-06-27 Thread Danny Shepherd

This article's been around for ages. I OO design wherever I think it'll make
the code more portable and extendable later on. From what I've seen, the
slow down is negligible rather than considerable.

But you write how you want to write and I'll write how I want to write.

HTH

Danny.

- Original Message -
From: Barýþ Mert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 27, 2002 11:04 AM
Subject: [PHP] PHP and OOP


 i want to build a site in fully OO style but that will
 significantly slow down execution time and i'm about
 to make a u turn to procedural PHP programming on my
 project.
 that article is responsible of changing my decision:

 http://zend.com/zend/art/mistake1.php#Heading13

 besides it will be more modular, reusable, e.t.c...

 PHP is not a OO language but supports them so should
 classes bu used ONLY where needed, NOT where
 procedural programming can do fine?

 a forum topic for this subject is also at:
 http://www.zend.com/phorum/read.php?num=3id=18612loc=0thread=18612


 __
 Do You Yahoo!?
 Yahoo! - Official partner of 2002 FIFA World Cup
 http://fifaworldcup.yahoo.com

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



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




Re: [PHP] imap support breaking...

2002-06-21 Thread Danny Shepherd

I got that error once - turned out that I'd forgotten to compile the IMAP
lib with SSL support. Try recompiling your IMAP libs and then recompiling
everything else.

Danny.
FreeBSD 4.5/Apache 1.3.26/PHP4.2.1

- Original Message -
From: Rick Kukiela [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 19, 2002 7:58 PM
Subject: [PHP] imap support breaking...


 I couldn't get sessions working on my old broke install so i formatted and
 im redoing everything... this time i want to incorporate IMAP support so i
 can run IMP on my server. I'm compiling PHP 4.2.1 with Apache 1.3.26 with
 mod_ssl and mod_perl and when mod_perl is building apache I get this
error:

 modules/php4/libphp4.a(php_imap.o): In function `zm_startup_imap':
 /usr/local/src/php-4.2.1/ext/imap/php_imap.c(.text+0x353): undefined
 reference
 o `ssl_onceonlyinit'
 *** Error code 1

 Stop in /usr/local/src/apache_1.3.26/src.
 *** Error code 1

 Stop in /usr/local/src/apache_1.3.26.
 *** Error code 1

 Stop in /usr/local/src/apache_1.3.26.
 *** Error code 1

 Stop in /usr/local/src/mod_perl-1.27.

 anyone know? i searched google groups and only found people asking about
 this problem but no one responding to it...

 Thanks,
 Rick


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



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




Re: [PHP] printf()

2002-06-15 Thread Danny Shepherd

On Sunday 16 June 2002 12:46 am, Gerard Samuel wrote:
 Im trying to make a dynamic printf().
 By that I mean -

 function this($foo, $bar)
 {
 if (strlen($bar) == '0')
 {
  print($foo);
 }
 else
 {
 printf($foo, $bar);
 }
 }

 Now it works if there is one argument passed, but it doesn't when there
 is more than one.

 $str = 'should';
 this('This %s work', $str);  // work

 $str = 'is, a';
 this('This %s just %s test', $str);  // doesn't work

 So I guess, arguments passed to it has to be physical arguments, and not
 represented in a string.
 Am I banging my head on a wall with this??
 Thanks

Try this :

?php

function this($string,$params=)
{
if ($params!=)
{
eval(printf(\$string,$params););
}
else
print $string;

return;
}

this('Hello, World :)br /');
this('Hello %sbr /','World');
this('Hello %s %sbr /','Wide, World');

?

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




Re: [PHP] printf()

2002-06-15 Thread Danny Shepherd

On Sunday 16 June 2002 1:13 am, Gerard Samuel wrote:

 check to see if $bar is an array and
 feed the array to vprintf()

Wow, didn't even know that one existed! Might come in handy though :)

Danny.

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




Re: [PHP] OO Question

2002-06-10 Thread Danny Shepherd

Yes, you can do that and yes that's how you do it :)

Danny.

- Original Message - 
From: Jay [EMAIL PROTECTED]
To: Php-General (E-mail) [EMAIL PROTECTED]
Sent: Monday, June 10, 2002 5:17 PM
Subject: [PHP] OO Question


 I was wondering can I create a new Object inside of a different class?  
 
 class One
 {
 //constructor
 function One
 {
 $this-two = new Two;
 $this-test = $this-two-test();
 }
 }
 
 Can you do that? If so is that how you do it?
 
 Thanks.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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




Re: [PHP] ForceType hack with Apache 2?

2002-06-10 Thread Danny Shepherd

I ran into this problem too - but there is a conf directive to handle it now
(even on FreeBSD, which I use) -
http://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo

Danny

- Original Message -
From: a.h.s.boy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 10, 2002 7:14 PM
Subject: [PHP] ForceType hack with Apache 2?


 I've built an application framework in PHP that makes heavy use of the
 smart URL technique for passing variables, which works great with
 Apache 1.3.22. I have reports, however, that it breaks under Apache 2.x,
 and would like to verify whether or not anyone can confirm this.

 I'm using URLs to pass parameters in the manner of the relatively
 well-known method, e.g.

 http://www.server.com/info/display/123/index.php

 with

 Location info
ForceType  application/x-httpd-php
 /Location

 in the httpd.conf file. It works like a charm (on Linux, anyway). I've
 run into problems with it under FreeBSD, but I was forewarned that it
 might not work there.

 Another user of the framework, however, just installed Apache 2/PHP
 4.2.1 on Linux, and reports that the smart URLs aren't being so smart,
 and generate 404s.

 Strangely, the URL

 http://www.server.com/info

 will correctly execute as PHP a script called info, but

 http://www.server.com/info/display/123

 will NOT execute the info script, instead looking for a directory path
 that doesn't exist, and generating a 404 error.

 Since I don't have Apache 2 installed, I can't test it myself. Has
 anyone used this trick (and made it work) with Apache 2? I don't know
 whether to blame a fundamental change in Apache 2, or to look for some
 other configuration error in the user's system.

 Cheers,
 spud.


 ---
 a.h.s. boy
 spud(at)nothingness.orgas yes is to if,love is to yes
 http://www.nothingness.org/
 PGP Fingerprint: 7B5B 2E7A FA96 865A D9D9  5D6D 54CD D2C1 3429 56B4
 ---


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



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




Re: [PHP] Gettext and PHP4.2.0?

2002-05-17 Thread Danny Shepherd

My guess is that it's something to do with the =shared. In your phpinfo()
output, there should be a table about half way down which says

 GetText Support enabled

When I compiled (bsd so it may be different for you) I
used --with-gettext=/usr/local/ the gettext binary is in /usr/local/bin and
the lib is in /usr/local/lib - find out where gettext is on your setup and
adjust the config option accordingly.

HTH

Danny.

- Original Message -
From: Bram van Leur [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 16, 2002 6:38 PM
Subject: [PHP] Gettext and PHP4.2.0?


 Hi everyone,

 I've recently (for once in my life!) succesfully compiled PHP4.2.0 using
 the following configure command-line:
 './configure' '--prefix=/usr' '--with-config-file-path=/etc'
 '--disable-debug' '--enable-pic' '--enable-inline-optimization'
 '--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin'
 '--with-regex=system' '--with-gettext=shared' '--with-zlib'
 '--with-gdbm' '--with-layout=GNU' '--enable-debugger'
 '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem=shared'
 '--enable-sysvshm=shared' '--enable-track-vars' '--enable-yp'
 '--enable-ftp' '--enable-wddx' '--without-unixODBC' '--without-oracle'
 '--without-oci8' '--with-mysql=/usr' '--with-gd-dir=/usr' '--with-flex'
 '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-ttf'

 As you can see it contains --with-gettext so I'd expect a function
 like bindtextdomain() is availible. However, Horde (chora, actually)
 reports:
 Fatal error: Call to undefined function: bindtextdomain() in
 /home/virtual/site4/fst/var/www/html/horde/lib/Lang.php on line 91

 What could have gone wrong and how can I fix it?

 Thanks in advance

 --
 Bram v. Leur
 The Netherlands

 Proud to PHP!


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



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




Re: [PHP] Cool PHP Tricks/Features ?

2002-05-15 Thread Danny Shepherd

No, that's not a problem either!

snip from manual
Before ob_gzhandler() actually sends compressed data, it determines what
type of content encoding the browser will accept (gzip, deflate or none
at all) and will return it's output accordingly. All browsers are supported
since it's up to the browser to send the correct header saying that it
accepts compressed web pages.
/snip from manual

HTH

Danny.

- Original Message -
From: Sqlcoders.com Programming Dept [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 1:25 PM
Subject: Re: [PHP] Cool PHP Tricks/Features ?


 Just remember that not every browser understands gzip compression, but
also
 remember that a probably larger percentage of visitors have ECMAScript
 (JavaScript) switched off.
 You takes your chances, you makes your choice...



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




Re: [PHP] DOMXML in 4.2.0 problems

2002-05-15 Thread Danny Shepherd

Well it works just fine for me :)

PHP 4.2.0 / Apache 2.0.36 / FreeBSD 4.5

DOM/XML enabled
libxml Version 2.4.21
HTML Support enabled
XPath Support enabled
XPointer Support enabled

As you can see, I'm using a later version of libxml than you are - maybe
that's the problem.
I am also forced to use the old functions - maybe the new names only apply
in PHP 4.3.0+?

If you need any more info:

http://phpinfo.kyboshed.dyndns.org
http://tests.kyboshed.dyndns.org/domtest.php
http://tests.kyboshed.dyndns.org/domtest-source.php

HTH

Danny.

- Original Message -
From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, May 10, 2002 1:05 AM
Subject: [PHP] DOMXML in 4.2.0 problems


 I'm trying to get DOMXML to work with PHP4.2.0. I've compiled
with --with-dom and phpinfo() says it's there:
 DOM/XML enabled
 libxml Version 2.4.18
 HTML Support enabled
 XPath Support enabled
 XPointer Support enabled

 The following program though doesn't seem to work:

 $xmlstring='a valid xml document here';
 $domdoc=xmldoc($xmlstring);
 $root=$doc-document_element(); --- throw error

 I get an error regarding the call to DomDocument-document_element(). Also
I'm forced to use xmldoc() instead of the newer domxml_open_mem() because it
is also not recognized. What am I missing?

 thanks in advance,
 Thalis


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



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




Re: [PHP] Cool PHP Tricks/Features ?

2002-05-15 Thread Danny Shepherd

Modem compression will only affect data between the modem and the ISP.

A point you don't appear to have considered is that by compressing at the
server a host can significantly reduce outgoing bandwidth (i.e. the stuff
they pay for) - the less you use, the less you pay. Compressing pages is
very lightweight on a cpu and i'd advise enabling compression by default,
only disabling it if there is a noticable decrease in server performance.
Processing power is probably cheaper today than bandwidth is.

HTH.

Danny.

- Original Message -
From: George Whiffen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Sqlcoders.Com Programming Dept
[EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 1:24 PM
Subject: Re: [PHP] Cool PHP Tricks/Features ?


 Ummm,

 This output compression sounded cool to me when I came across it,
 but I wasn't sure it really helped or was appropriate for us to use:

 1. My biggest concern is the slowest user i.e. at the end of a modem
 on the other side of the planet.  I thought they would almost certainly
 have modem compression so doing our own compression doesn't
 really help them at all i.e. actual download speeds stay the same, it's
 just we/they do the work rather than the modems.

 2. I was surprised when I got ISDN dial-up that it didn't seem
 to have automatic compression on the line, but assumed that was
 going to change.  Am I too hopeful?

 3. But surely, ASDL, cable, the backbone and decent intranets
 must all do hardware compression, don't they?  Or are they
 secretly not very keen on decreasing network traffic?

 4. Finally, if the network hardware isn't handling compression
 for us, I would have thought it was a good job for a web server.
 I guess I'd have to ask the Apache guys, but I would guess this
 can be really neatly done with some fancy mod_rewrite, custom
 extension or whatever.

 In summary, I can't agree more that all pages should be compressed,
 but  don't feel it should be our job.   Maybe I'm wrong and this is
another
 case of the poor old application developer having to do all the *
work,
 just because the rest of the computing industry is too busy counting its
 profits to do its own job properly ;).


 What's everyone else think?

 George


 Sqlcoders.Com Programming Dept wrote:

  I've seen real-life examples of 100k pages going down to around 30k,
  considering that decrease in size, when you remember that CPU time is
  relatively cheap compared to bandwidth, it's worth the processing
overhead
  in my opinion.
 
  Small (20k) pages probably aren't worth it,
  for anything larger then as it's been mentioned, even if visitors have
no
  idea the pages are smaller, if they load in 1/3 of the time it's useful,
  wanted, and definitely cool.
 
  Just remember that not every browser understands gzip compression, but
also
  remember that a probably larger percentage of visitors have ECMAScript
  (JavaScript) switched off.
  You takes your chances, you makes your choice...
 
  William.
 
  - Original Message -
  From: SP [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; 'Girish Nath'
[EMAIL PROTECTED];
  [EMAIL PROTECTED]
  Sent: May 14 2002 06:29 PM
  Subject: RE: [PHP] Cool PHP Tricks/Features ?
 
   Well if his normal page is 100k and he can cut the
   size down to 50k with gzip then instead of having
   a monthly transfer of 100 GB for example, he would
   only be paying for 50 GB.  Seems like it's useful
   for extremely large sites.
  
  
  
   -Original Message-
   From: John Holmes
   [mailto:[EMAIL PROTECTED]]
   Sent: May 14, 2002 6:43 PM
   To: 'Girish Nath'; [EMAIL PROTECTED]
   Subject: RE: [PHP] Cool PHP Tricks/Features ?
  
  
   Why do you think this is useful to you? I remember
   reading an article on
   this and its conclusion was that zipping the
   output was only beneficial
   for large data between fast computers over a slow
   pipe. You have to look
   at who your clients are and if it's beneficial to
   have their machine use
   up extra time (processing power) unzipping things
   or not. Also, you're
   using more processing time on your computer having
   to do the zipping for
   every request, too.
  
   ---John Holmes...
  
-Original Message-
From: Girish Nath
   [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 9:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Cool PHP Tricks/Features ?
   
Hi
   
I've been using PHP for about 2 years now but
   only just discovered
ob_gzhandler and gzip/compressing http output.
It's something i wish i'd found out about
   earlier because even though
   it's
a
simple concept the result blew me away :)
   
Anyway, i just wanted to know of any other cool
   tricks/features that
   you
guys are using that others could have
   overlooked.
   
Thanks
   
   
Girish
--
www.girishnath.co.uk
   
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
   http://www.php.net/unsub.php
  
  

Re: [PHP] Tellwhich browser

2002-05-15 Thread Danny Shepherd

$_SERVER['HTTP_USER_AGENT']

That's the variable which holds the browser's user agent string (browser
name, version, platform etc);

You may also find this helpful

http://www.php.net/manual/en/function.get-browser.php

HTH

Danny.

- Original Message -
From: Diana Castillo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 3:09 PM
Subject: [PHP] Tellwhich browser


 What is the code to tell whether the user is on IE or Netscape?



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



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




Re: [PHP] Re: Getting PHP on FreeBSD to talk to MSSQL Server 7...

2002-05-15 Thread Danny Shepherd

In my expierence you'll have much greater chance of sucess if you compile
with --with-sybase-ct :)

I just used --with-sybase-ct=/usr/local  - I didn't bother with --with-mssql
or --with-sybase

Paticulars:
FreeBSD 4.5
PHP 4.2.0
FreeTDS 0.53

Of course, using this methods means you also have to use the sybase commands
not the mssql commands but they're pretty much identical in function - just
the names that are different.

HTH

Danny.

- Original Message -
From: Michael Kimsal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 11, 2002 2:08 AM
Subject: [PHP] Re: Getting PHP on FreeBSD to talk to MSSQL Server 7...


 Glenn Sieb wrote:
  Hi.. it's me again :)
 
  We have a few different servers here, most of which are FreeBSD,
  including our internal web server (Apache 1.3.24). We have PHP 4.2.0
  installed as well.
 
  Currently I'm running my MSSQL query scripts on a Win2k webserver, as I
  can't seem to get PHP to talk to MSSQL on the FreeBSD side. I'd really
  prefer to have my PHP scripts all running on the FreeBSD side, rather
  than on Win2k.
 
  We do have Perl able to talk to the MSSQL server using FreeTDS and the
  DBI::Sybase package on the same FreeBSD machine.
 
  My ./configure:
 
   ./configure --prefix=/usr/local
  --with-apache=/home/src/Apache/Apachetoolbox
  -1.5.56/apache_1.3.24 --enable-exif --enable-track-vars
  --with-calendar=shared -
  -enable-safe-mode --enable-magic-quotes --enable-trans-sid --enable-wddx
  --enabl
  e-ftp --with-gd=/usr/local --with-zlib --enable-gd-native-tt
  --with-t1lib=/usr/l
  ocal --with-jpeg-dir=/usr/local --with-png-dir=/usr/local
  --with-zlib-dir=/usr -
  -with-ttf --with-freetype-dir=/usr/local
  --with-unixodbc=/usr/local/unixODBC --w
  ith-openssl=/usr/local --with-curl=/usr/local --enable-apc
  --with-mysql=/sw/mysq
 
l --with-mssql=/usr/local/etc/freetds --with-sybase=/usr/local/etc/freetds
 
  (built using ApacheToolbox, 1.5.56)
 
  FreeTDS' interfaces file is located in /usr/local/etc/freetds, which it
  is/was my understanding that this is what's supposed to be there. Yet
  not only does PHP give me:

 the --with-sybase= line needs to point to where freetds was compiled,
 not the interfaces file.  We don't use the interfaces file, which seems
 to be primarily a way to map names to IPs.  We just use the IP address
 directly in the mssql_connect() functions and it works.

 Michael Kimsal
 http://www.phphelpdesk.com




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



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




Re: [PHP] phpmysqladmin ? still viable?

2002-05-15 Thread Danny Shepherd

I think you're looking for phpMyAdmin and yes, it's very viable and PHP4
compatible.

http://www.phpwizard.net/projects/phpMyAdmin/

HTH

Danny.

- Original Message -
From: Erik Gilchrist [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 16, 2002 1:15 AM
Subject: [PHP] phpmysqladmin ? still viable?


 First off, I am a total newbie to php and DB stuff.  Pardon the intrusion
on
 your busy schedules.  Really.

 My host is having a hard time finding phpmysqladmin and he touted this as
a
 solution to my wanting to get into the DB arena as well as php.  Does
anyone
 know where to get it?   All of my evening has now been wasted googling
 looking for it and perhaps there is a better solution.

 And no, I really am out of my game here, but I figured it was a good place
 to ask.  The only caveat the host said was that it MUST be PHP4.x
 compatible.

 I sincerely apologize for the intrusion if it's not on topic enough.  I
know
 I need to go further in my exploration that the net has via tutorials and
 PHP manual, but if anyone has time I would sincerely appreciate it.  I
have
 been lurking for a week or two.  Good stuff to be found here.  Indeed.

 I could have all the assumptions above all wrong and some bad
 data/opinions...  sorry.  please explain.  If I am in the wrong place to
 ask, please tell me where the best place to look/ask is.  I don't want to
 waste anybodys time.  I surely would not want mine wasted.

 BTW-- I am on DIGEST, so a CC: would be appreciated dearly.

 TIA.
 Erik

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


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



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




Re: [PHP] Apache2

2002-05-13 Thread Danny Shepherd

Hi,

Yes, I have both 1.3.24 and 2.0.36 installed - both with the PHP4.2.0 mod
compiled. You simply compile and install both servers and the compile modphp
for each server (i.e. once with --with-apxs and once with --apxs2) abd
that's all there is to it.

I'm running FreeBSD 4.5 btw, but I don't see how how situation would require
anything different.

HTH

Danny.

- Original Message -
From: Frank Miller [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 13, 2002 7:17 PM
Subject: [PHP] Apache2


 All,
  I've gotten some very good answers from the knowledgable
 people on this list so I thought I would ask a question that I've been
 wondering about and maybe other people have too.  I'm running a Linux 7.2
 server with MySQL, Php 4.20 and Apache 1.3.24. I followed some
instructions
 and copied each into /usr/src and installed all three into /usr/local.  I
 used Apache 1.3.24 because I needed frontpage extensions.  I'm now curious
 about Apache 2.0.36.  Can I have two installations of Apache  both with
 MySQL and php support? If so do I have to compile MySQL and PHP over again
 for the second installion of Apache? I know I'll have to change the port
 number on the second Apache installion. What I'm wondering is has anyone
 done this and, if so, what steps you used to accomplish this.



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




Re: [PHP] httpS connection with FILE

2002-05-10 Thread Danny Shepherd

It will be really cool when we can do that (in PHP4.3) but until then you'll
have to make do with cURL (http://www.php.net/manual/en/ref.curl.php)

HTH

Danny.

- Original Message -
From: Bert Buckley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 11, 2002 12:07 AM
Subject: [PHP] httpS connection with FILE



 I would like very much to retrieve data from an
 https server using the file function, but it only
 supports an http call.

 1. Can someone suggest a good alternative

 2. I understand this will be in PHP 4.3.  Does
 anyone know a possible release date.

 Thanks

 Bert


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



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




Re: [PHP] Question for you guys on best tools for a job

2002-04-29 Thread Danny Shepherd

Hi,

Well you could take care of the backend of the system using PHP and feed the
output to a flash application, which updates every so often by re-requesting
the PHP page (this page is merely returning variables to flash).

Of course, if  you know java then you'd probably want to take that route.

Aside from Java and Flash you could still achieve a similar effect using the
meta refresh tag - updating the page every 60 seconds or so.

HTH

Danny.

- Original Message -
From: Michael Champagne [EMAIL PROTECTED]
To: PHP General Mailing List [EMAIL PROTECTED]
Sent: Monday, April 29, 2002 10:35 PM
Subject: [PHP] Question for you guys on best tools for a job


 I'm not even sure this is possible without doing a client side java applet
of
 some sort.

 We are considering porting a standard client/server application to the web
 which updates itself dynamically in real time based on values in a
database.

 For instance, a field on the screen will change in real time between
 'Pending', 'Working', 'Cancelled', etc. etc. based on a flag in the
database.
 What would be the best tools for the job for an application of this sort?
 I've used PHP extensively and don't really see how it could be used in
this
 case.  Any ideas?

 Thanks in advance for any responses.

 --
 Michael Champagne, Software Engineer
 Capital Institutional Services, Inc.
 wk: [EMAIL PROTECTED]
 hm: [EMAIL PROTECTED]



 **
 This communication is for informational purposes only.  It is not
 intended as an offer or solicitation for the purchase or sale of
 any financial instrument or as an official confirmation of any
 transaction, unless specifically agreed otherwise.  All market
 prices, data and other information are not warranted as to
 completeness or accuracy and are subject to change without
 notice.  Any comments or statements made herein do not
 necessarily reflect the views or opinions of Capital Institutional
 Services, Inc.  Capital Institutional Services, Inc. accepts no
 liability for any errors or omissions arising as a result of
 transmission.  Use of this communication by other than intended
 recipients is prohibited.
 **

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




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




Re: [PHP] need urgent session help, since new php version broke my code

2002-04-22 Thread Danny Shepherd

Well, since you fail to mention which versions of PHP you were using before
and after the upgrade it's a little difficult to diagnose your problem.

You should really have checked the change log
(http://www.php.net/ChangeLog-4.php) before upgrading anyway (a lot changed
in the 4.0.x - 4.1.x releases - including some variable names)

HTH

Danny.

- Original Message -
From: nospam [EMAIL PROTECTED]
To: 'Php-General [EMAIL PROTECTED]
Sent: Monday, April 22, 2002 11:02 AM
Subject: [PHP] need urgent session help, since new php version broke my code


 Hi all

 all the links in my page link to not existing html pages.
 i redirect the 404 to a php script. when users had disabeled cookies,
 i parsed the request_uri for phpsessid and then set
 $HTTP_GET_VARS['PHPSESSID']=the parsed one.
 when i after that called session_start(), php was using the id from
 $HTTP_GET_VARS['PHPSESSID'].
 after upgrade to the latest php version this does not work anymore. i
 get a new PHPSESSID on every
 request. is there any way to keep the sessionid with these redirects?

 *extremecryforhelpsincepageisbrokenfornoncookieusers*

 Sebastian





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




Re: [PHP] Database and files

2002-04-22 Thread Danny Shepherd

- Original Message -
From: David Russell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 22, 2002 11:19 AM
Subject: [PHP] Database and files

 I have a database. It receives from my users files - which could be word
 documents, Adobe PDF files, text docs, anything...

 I store these in a BLOB field of the database.

If you get multiple requests for files, expect the db to fall over very
quickly - what's wrong with storing them on the filesystem and having a list
of them in the db?

[SNIP]

 Finds out the attachment mime type

 Sends a:

 Header(Content-type: mime-type);
 Header(Header(Content-Disposition: attachment;
filename=\File65.doc\ );
 Stream the contents of the blob to the browser.

WTF is up with Header(Header( ??
Surely this should be Header(Content-Disposition: attachment;
filename=\File65.doc\ );

Here's how I do it

header(content-type: $mime);
header(content-disposition: attachment; filename=\$displayName\);
echo $data;

One thing - note that that the header names and the actual mimetype are in
lower case. Got weird results with anything different.

HTH

Danny


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




Re: [PHP] Database and files

2002-04-22 Thread Danny Shepherd

- Original Message -
From: Richard Archer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 22, 2002 11:40 AM
Subject: Re: [PHP] Database and files


 At 11:25 AM +0100 22/4/02, Danny Shepherd wrote:

 If you get multiple requests for files, expect the db to fall over very
 quickly - what's wrong with storing them on the filesystem and having a
list
 of them in the db?

 If your DB falls over, get a better one. You wouldn't do this with
 Access, but MySQL or PostgreSQL will handle this with no problems.

I've tried it in MySQL  - it didn't work - after inserting aprox 8Mbs of
data the MySQL server died with a 'server has gone away' message. And more
than 2-3 users symltaneously requesting files of only a few hundred kb
really seemed to kill performance.

 And storing them in the file system requires the web server process to
 have write access to the directory in which the files are stored. And
 so will any other users on that server. Security nightmare.

Having other users on your server is the security mightmare :) If you setup
the webserver to have its own user ('apache' instead of 'nobody') and only
allow the apache user access to those files, that should lessen the problem.

 One thing - note that that the header names and the actual mimetype are in
 lower case. Got weird results with anything different.

 Interesting tip. I'll try that out on Mac IE which never did download
 properly, IIRC.



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




Re: [PHP] Daemon starting

2002-04-22 Thread Danny Shepherd

Not played with them myself but you might want to take a look at the
system() and shell_exec() functions.

HTH

Danny.

- Original Message -
From: Gilles Nedostoupof [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 22, 2002 12:28 PM
Subject: [PHP] Daemon starting


 Hi all,

 I'm looking for a simple method to start a linux daemon from a php
script...
 I've already tried to use sudo by giving rights to apache user to execute
 some scripts from /etc/rc.d/init.d ; I do a exec (sudo
 /etc/rc.d/init.d/daemon start);
 Sometimes the daemon startup, sometimes no... I need to re-run the script
2
 or 3 times to start the daemon correctly.
 (Same problem with stopping the daemon...)

 Anybody have an idea?

 Gilles.



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




Re: [PHP] Pb with socket_set_timeout()

2002-04-22 Thread Danny Shepherd

I don't think the windwos version of PHP supports sockets.

use fsockopen instead. (http://uk.php.net/manual/en/function.fsockopen.php)

HTH

Danny.

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 22, 2002 1:59 PM
Subject: [PHP] Pb with socket_set_timeout()


 
 Hi the ML
 
 I received the following error message on my web page when I try to
 communicate with My SMTP server:
 
 Warning: socket_set_timeout() is not supported in this PHP build
 
 My config is
 
 PHP 4.0.6
 Win Nt 4
 Apache 1.3.22
 
 Any information on this function ?
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




Re: [PHP] eregi() problem

2002-04-21 Thread Danny Shepherd

Try:

if (!eregi('^[a-z_\-]{0,}$', $_POST['vpis_ime']))
  echo wrong char;

That'll sort it for everything except [ and ], which I can't find any way of
checking for :-( Anyone else have any ideas?

HTH anyway.

Danny.

- Original Message -
From: Gregor Jaksa [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 22, 2002 1:04 AM
Subject: [PHP] eregi() problem


 if (!eregi(^[[:alpha:]]$, $HTTP_POST_VARS[vpis_ime]))
   echo wrong char;

 why does this always return wrong char no matter what value is in
vpis_ime
 ... i tried blah, 242234 bla242h .. every single time i get wrong
 char. im using PHP 4.1.2

 basicly is what i want is to check string if it contains only charaters
from
 a to z and chars _ - [ ] . Can somebody write me a working function ?

 thx in advance


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




Re: [PHP] Discarded extension on file download

2002-04-19 Thread Danny Shepherd

Hi,

I recently had this problem and, after hours of hair pulling, found that it
seems to work best if you send
the words Content-Type and Content-Disposition in **lower case**. Not sure
why it has to be like that but it was the only way I found.

HTH,

Danny.


- Original Message -
From: Tomas Mikulecky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 19, 2002 9:40 AM
Subject: [PHP] Discarded extension on file download


 Hi

 I am trying to offer downloading files from a web server, using PHP.

 The files are gzipped text and have all .txt.gz extensions. Now while on
 Windows systems both IE and Netscape offers to download it under the
 full name (althought IE adds [some_number] to the base of the file
 name), under Unix or Linux systems (tested with netscape 4.7) the '.gz'
 part is discarded from the file name and the file is saved with .txt
 only. Downloaded file is still gzipped.

 The part of script serving the files is as follows:

 header(Content-type: application/octet-stream);
 header(Content-Disposition: attachment; filename=$my_filename);
 echo($file_body);

 What am-I doing wrong? Thanks in advance

 Tom


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




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




Re: [PHP] Date function

2002-04-19 Thread Danny Shepherd

MySQL (I assume that's the database you're inserting into) requires dates to
be sent in -MM-DD format. You appear to be sending a unix timestamp.

Try:

date(Y-m-d,time()) // Sends a MySQL style date.

or even:

$SQL = INSERT INTO orders (Customer_Id, Order_Date) VALUES($CustID,NOW());
// uses MySQL's builtin date function to store the current date.

HTH,

Danny.

- Original Message -
From: Alia Mikati [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 19, 2002 10:28 AM
Subject: [PHP] Date function


 Hello
 I have the following SQL and I wanna insert the current date in one of
 the table fields but it's not working. Can u tell me whats the problem?
 (I'm using mysql and php)
 Thx a lot

 $SQL = INSERT INTO orders (Customer_Id, Order_Date).
  VALUES($CustID,date());



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




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




Re: [PHP] .inc over .php

2002-04-19 Thread Danny Shepherd

A third way could be to append .php onto those files too, giving .inc.php,
.class.php etc.

Danny.

 There are two ways to counter this:

 1) have the .inc files in a directory outside the scope of the webserver
 directory.

 2) set the webserver to treat .inc files as php files.




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




Re: [PHP] Determine the difference between two dates

2002-04-19 Thread Danny Shepherd

Firstly, I assume you mean Y-m-j H:i:s for the date format.

To get the difference between 2 time strings :

?php

// orginal time strings
$firstTime=2002-04-19 13:49:00;
$lastTime=2002-04-19 14:00:00;

// convert to unix timestamps
$firstTime=strtotime($firstTime);
$lastTime=strtotime($lastTime);

// perform subtraction to get the difference (in seconds) between times
$timeDiff=$lastTime-$firstTime;

//echo out the difference
printf (Difference is %d seconds,$timeDiff);

?

HTH

Danny.

- Original Message - 
From: Ron Allen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 19, 2002 1:08 PM
Subject: [PHP] Determine the difference between two dates


 If I have two variables of time both in the format of Y-m-j J:i:s
 How would I go about and get the difference?



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




  1   2   >