[PHP] Re: method to prevent multiple logons of same account

2003-10-06 Thread PHP Webmaster

"Chris W. Parker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi.

Ok I've got the logging in of customer accounts settled but what I need
to work into the system is that of preventing more than one instance of
the same account.

If I logon right now as testuser1 on ComputerA and then go to ComputerB
and login as testuser1 it'll work just fine. What I want to do is one of
the following: (a) prevent the second instance of testuser1 from
succeeding, (b) logoff the first instance of testuser1 when the second
instance authenticates.

I know I'll have to keep a database and store the following: username
(or user id), session id, time of login, and/or time of last action.

Option A is very easy. I can easily look in the database and see if that
person is already logged in. If they are found in the db I just refuse
the second login attempt. Option B on the other hand seems a little more
difficult. As far as I've thought it out so far I'll have to check the
db on each page request to see if the user is still valid. That is to
say, if the second attempt is allowed to login I would have to change
the users session id from the first instance to the second instance.
Then when the first instance goes to a new page the application would
say "Hey wait a minute buddy! Your session id is different than the one
in the database. You've either timed out or someone else has logged in
with the same username."


Am I thinking this through correctly? Comments?



Chris.

I created a Members script a while ago and to prevent multiple logins with
the same username/password combination, I had a column called logged_in
inside the members table which would be marked '1' when the user was logged
in and '0' when the user logged out. When any user attempts to login, it
checks that the logged_in column is first marked as '0'.

I personally don't see anything wrong with the above method.

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



Re: [PHP] method to prevent multiple logons of same account

2003-10-06 Thread PHP Webmaster

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This has been discused several times befor and the conclusion is that
> these obstructions are wrong. What if the user loses its credentials and
> he is still considered loged in. He cannot log in again. If you bind the
> session to a IP address then you create problems for users behind proxy
> farms. Your option (b) is virtualy the same as doing nothing about it at
> all.
>
> Chris W. Parker wrote:
> > Hi.
> >
> > Ok I've got the logging in of customer accounts settled but what I need
> > to work into the system is that of preventing more than one instance of
> > the same account.
> >
> > If I logon right now as testuser1 on ComputerA and then go to ComputerB
> > and login as testuser1 it'll work just fine. What I want to do is one of
> > the following: (a) prevent the second instance of testuser1 from
> > succeeding, (b) logoff the first instance of testuser1 when the second
> > instance authenticates.
> >
> > I know I'll have to keep a database and store the following: username
> > (or user id), session id, time of login, and/or time of last action.
> >
> > Option A is very easy. I can easily look in the database and see if that
> > person is already logged in. If they are found in the db I just refuse
> > the second login attempt. Option B on the other hand seems a little more
> > difficult. As far as I've thought it out so far I'll have to check the
> > db on each page request to see if the user is still valid. That is to
> > say, if the second attempt is allowed to login I would have to change
> > the users session id from the first instance to the second instance.
> > Then when the first instance goes to a new page the application would
> > say "Hey wait a minute buddy! Your session id is different than the one
> > in the database. You've either timed out or someone else has logged in
> > with the same username."
> >
> >
> > Am I thinking this through correctly? Comments?
> >
> >
> >
> > Chris.
> >

This problem could be easily fixed by using a "Forgotten password" script
with the membership system which logs the user out once the
username/password has been sent to an e-mail address.

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



Re: [PHP] ps command in php

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 14:55:56 +0800, you wrote:

>I'm trying to have the output of the "ps -ef" command in Linux to my
>browser. Can anyone help how to properly have the output in proper format.
>I've used the passthru() function but the output is scrambled.

Scrambled how, exactly? Remember, your browser is expecting HTML.

Personally, I'd try adding a Content-Type: text/plain header before the
output...

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



Re: [PHP] ps command in php

2003-10-06 Thread Mike Migurski
>I'm trying to have the output of the "ps -ef" command in Linux to my
>browser. Can anyone help how to properly have the output in proper
>format. I've used the passthru() function but the output is scrambled.

What do you mean by 'scrambled'? The following works for me:
echo '', `ps -ef`, '';

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

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



Re: [PHP] ps command in php

2003-10-06 Thread Michael P. Carel
I'm doing like this:
 $ps = (passthru("ps -ef));

echo $ps;

my output is something like this:
UID PID PPID C STIME TTY TIME CMD root 1 0 0 Sep19 ? 00:00:04 init [3] root
2 1 0 Sep19 ? 00:00:00 [kflushd] root 3 1 0 Sep19 ? 00:00:09 [kupdate] root
4 1 0 Sep19 ? 00:00:00 [kpiod] root 5 1 0 Sep19 ? 00:00:04 [kswapd] root 6 1
0 Sep19 ? 00:00:00 [mdrecoveryd] bin 404 1 0 Sep19 ? 00:00:00 [portmap] root
429 1 0 Sep19 ? 00:03:33 syslogd -m 0 root 438 1 0 Sep19 ? 00:00:01 klogd
nobody 452 1 0 Sep19 ? 00:00:00 identd -e -o nobody 454 452 0 Sep19 ?
00:00:00 identd -e -o nobody 457 454 0 Sep19 ? 00:00:00 identd -e -o nobody
458 454 0 Sep19 ? 00:00:00 identd -e -o nobody 459 454 0 Sep19 ? 00:00:00
identd -e -o daemon 470 1 0 Sep19 ? 00:00:00 /usr/sbin/atd root 484 1 0
Sep19 ? 00:00:01 crond root 502 1 0 Sep19 ? 00:00:00 inetd root 539 1 0

What  i want is to format it just like what  it seen in the console:

UIDPID  PPID  C STIME TTY  TIME CMD
root 1 0  0 Sep19 ?00:00:04 init [3]
root 2 1  0 Sep19 ?00:00:00 [kflushd]
root 3 1  0 Sep19 ?00:00:09 [kupdate]
root 4 1  0 Sep19 ?00:00:00 [kpiod]
root 5 1  0 Sep19 ?00:00:04 [kswapd]

any idea?




> >I'm trying to have the output of the "ps -ef" command in Linux to my
> >browser. Can anyone help how to properly have the output in proper
> >format. I've used the passthru() function but the output is scrambled.
>
> What do you mean by 'scrambled'? The following works for me:
> echo '', `ps -ef`, '';
>
> -
> michal migurski- contact info and pgp key:
> sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] image upload

2003-10-06 Thread Yury B .
Sorry, there was typo in the code I sent previously. Here is the 
right code but the same problem - secont image is with incorrect 
header:



On 6 Oct 2003 at 8:09, Jason Wong wrote:

> On Monday 06 October 2003 00:32, Yury B. wrote:
> > Hi I need to upload two resized images out from one jpg image. I use
> > following code to do it:
> 
> [snip]
> 
> 
> > This code is working perfectly but produces only one uploaded and
> > resized image (I comented out the lines that I add for second image)
> > If I take out comments from the code on the second image - this
> > script doesn't work - it produces two files on the server but only
> > one of them is working the other one shows error of wrong hedding.
> > How should I upload two resized files? I know it's possible but how
> > can I fit everything in one portion of code?
> 
> Check the values of all your variables -- in particular $rw, as it doesn't 
> seem to be initialised.
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> One thing about the past.
> It's likely to last.
>   -- Ogden Nash
> */
> 

<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org/

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



Re: [PHP] ps command in php

2003-10-06 Thread Mike Migurski
>my output is something like this:
>UID PID PPID C STIME TTY TIME CMD root 1 0 0 Sep19 ? 00:00:04 init [3] root
>2 1 0 Sep19 ? 00:00:00 [kflushd] root 3 1 0 Sep19 ? 00:00:09 [kupdate] root

>
>any idea?

Yeah, see David Otton's response, or look at the HTML source of your
output.

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

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



Re: [PHP] ps command in php

2003-10-06 Thread Nitin
your question has already been answered:

use:

echo " $ps ";
It should definitely help

Nitin

- Original Message - 
From: "Michael P. Carel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 06, 2003 12:51 PM
Subject: Re: [PHP] ps command in php


> I'm doing like this:
>  $ps = (passthru("ps -ef));
>
> echo $ps;
>
> my output is something like this:
> UID PID PPID C STIME TTY TIME CMD root 1 0 0 Sep19 ? 00:00:04 init [3]
root
> 2 1 0 Sep19 ? 00:00:00 [kflushd] root 3 1 0 Sep19 ? 00:00:09 [kupdate]
root
> 4 1 0 Sep19 ? 00:00:00 [kpiod] root 5 1 0 Sep19 ? 00:00:04 [kswapd] root 6
1
> 0 Sep19 ? 00:00:00 [mdrecoveryd] bin 404 1 0 Sep19 ? 00:00:00 [portmap]
root
> 429 1 0 Sep19 ? 00:03:33 syslogd -m 0 root 438 1 0 Sep19 ? 00:00:01 klogd
> nobody 452 1 0 Sep19 ? 00:00:00 identd -e -o nobody 454 452 0 Sep19 ?
> 00:00:00 identd -e -o nobody 457 454 0 Sep19 ? 00:00:00 identd -e -o
nobody
> 458 454 0 Sep19 ? 00:00:00 identd -e -o nobody 459 454 0 Sep19 ? 00:00:00
> identd -e -o daemon 470 1 0 Sep19 ? 00:00:00 /usr/sbin/atd root 484 1 0
> Sep19 ? 00:00:01 crond root 502 1 0 Sep19 ? 00:00:00 inetd root 539 1 0
>
> What  i want is to format it just like what  it seen in the console:
>
> UIDPID  PPID  C STIME TTY  TIME CMD
> root 1 0  0 Sep19 ?00:00:04 init [3]
> root 2 1  0 Sep19 ?00:00:00 [kflushd]
> root 3 1  0 Sep19 ?00:00:09 [kupdate]
> root 4 1  0 Sep19 ?00:00:00 [kpiod]
> root 5 1  0 Sep19 ?00:00:04 [kswapd]
>
> any idea?
>
>
>
>
> > >I'm trying to have the output of the "ps -ef" command in Linux to my
> > >browser. Can anyone help how to properly have the output in proper
> > >format. I've used the passthru() function but the output is scrambled.
> >
> > What do you mean by 'scrambled'? The following works for me:
> > echo '', `ps -ef`, '';
> >
> > -
> > michal migurski- contact info and pgp key:
> > sf/cahttp://mike.teczno.com/contact.html
>
> -- 
> 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] image upload

2003-10-06 Thread Yury B .
Thank you for all help I have just figured out that there is other 
variable prob. See pointer "--->":

 //$c2=$rw/w; <
$nh=$h*$c; //The Height Of The Thumbnails
//$rh=$h*$c2; //The Height Of The Large Pictures

$img = LoadJpeg($file);
//$img2 = LoadJpeg($file);
$thumb = imagecreatetruecolor($nw,$nh);
//$large = imagecreatetruecolor($rw,$rh);

imagecopyresampled($thumb,$img,0,0,0,0,$nw,$nh,$w,$h);
//  imagecopyresampled($large,$img2,0,0,0,0,$rw,$rh,$w,$h);
imagejpeg($thumb,$thname,95);
//  imagejpeg($large,$rname,95);

imagedestroy($img2);
?>

On 6 Oct 2003 at 8:09, Jason Wong wrote:

> On Monday 06 October 2003 00:32, Yury B. wrote:
> > Hi I need to upload two resized images out from one jpg image. I use
> > following code to do it:
> 
> [snip]
> 
> 
> > This code is working perfectly but produces only one uploaded and
> > resized image (I comented out the lines that I add for second image)
> > If I take out comments from the code on the second image - this
> > script doesn't work - it produces two files on the server but only
> > one of them is working the other one shows error of wrong hedding.
> > How should I upload two resized files? I know it's possible but how
> > can I fit everything in one portion of code?
> 
> Check the values of all your variables -- in particular $rw, as it doesn't 
> seem to be initialised.
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> One thing about the past.
> It's likely to last.
>   -- Ogden Nash
> */
> 

<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org/

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



[PHP] How to upload files

2003-10-06 Thread Nitin
Hi all,

I'm looking for a method to enable my users to upload thier html files and embedded 
pictures to my server. I think it should be something very easy, but as I'm doing it 
for the first time, I thought it would be better to seek help from the experienced 
one. So any idea, how can I do it easly and safely and what are the precautions I 
should take to check the files for valid HTML and pic files, so that they cann't 
upload any thing destructive. Any help or suggestions will be highly appreciated.

Thanks in advance
Nitin

Re: [PHP] $_ENV not working for me with PHP 4.2.0

2003-10-06 Thread Burhan Khalid
John Wilcox wrote:
I've been trying to make a simple script which just
outputs the username that the script is currently
executing under (in order to test that suexec is
working properly).  I've tried using the following
line:


and it fails to produce any output and returns the
following error in my log file: "[Sun Oct  5 14:02:35
2003] [error] PHP Notice:  Undefined index:  USER in
/home/test/test.php on line 1"
Now, I've tried the same command on another server
running PHP 4.2.0 and it correctly outputs the
username as expected.  Both these machines are running
Debian Linux.
Try echo ""; print_r($_ENV); echo "";
to see what information is available in the ENV array.
Are both servers running the same implementation of PHP? (CGI/SAPI, etc.)

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ps command in php

2003-10-06 Thread Michael P. Carel
When I do this:


  

  


I can also see the HTML code, i need to put  the output  inside the table.
Is there any solution for this?




> your question has already been answered:
>
> use:
>
> echo " $ps ";
> It should definitely help
>
> Nitin
>
> - Original Message - 
> From: "Michael P. Carel" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 06, 2003 12:51 PM
> Subject: Re: [PHP] ps command in php
>
>
> > I'm doing like this:
> >  $ps = (passthru("ps -ef));
> >
> > echo $ps;
> >
> > my output is something like this:
> > UID PID PPID C STIME TTY TIME CMD root 1 0 0 Sep19 ? 00:00:04 init [3]
> root
> > 2 1 0 Sep19 ? 00:00:00 [kflushd] root 3 1 0 Sep19 ? 00:00:09 [kupdate]
> root
> > 4 1 0 Sep19 ? 00:00:00 [kpiod] root 5 1 0 Sep19 ? 00:00:04 [kswapd] root
6
> 1
> > 0 Sep19 ? 00:00:00 [mdrecoveryd] bin 404 1 0 Sep19 ? 00:00:00 [portmap]
> root
> > 429 1 0 Sep19 ? 00:03:33 syslogd -m 0 root 438 1 0 Sep19 ? 00:00:01
klogd
> > nobody 452 1 0 Sep19 ? 00:00:00 identd -e -o nobody 454 452 0 Sep19 ?
> > 00:00:00 identd -e -o nobody 457 454 0 Sep19 ? 00:00:00 identd -e -o
> nobody
> > 458 454 0 Sep19 ? 00:00:00 identd -e -o nobody 459 454 0 Sep19 ?
00:00:00
> > identd -e -o daemon 470 1 0 Sep19 ? 00:00:00 /usr/sbin/atd root 484 1 0
> > Sep19 ? 00:00:01 crond root 502 1 0 Sep19 ? 00:00:00 inetd root 539 1 0
> >
> > What  i want is to format it just like what  it seen in the console:
> >
> > UIDPID  PPID  C STIME TTY  TIME CMD
> > root 1 0  0 Sep19 ?00:00:04 init [3]
> > root 2 1  0 Sep19 ?00:00:00 [kflushd]
> > root 3 1  0 Sep19 ?00:00:09 [kupdate]
> > root 4 1  0 Sep19 ?00:00:00 [kpiod]
> > root 5 1  0 Sep19 ?00:00:04 [kswapd]
> >
> > any idea?
> >
> >
> >
> >
> > > >I'm trying to have the output of the "ps -ef" command in Linux to my
> > > >browser. Can anyone help how to properly have the output in proper
> > > >format. I've used the passthru() function but the output is
scrambled.
> > >
> > > What do you mean by 'scrambled'? The following works for me:
> > > echo '', `ps -ef`, '';
> > >
> > > -
> > > michal migurski- contact info and pgp key:
> > > sf/cahttp://mike.teczno.com/contact.html
> >
> > -- 
> > 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] ps command in php

2003-10-06 Thread Pavel Jartsev
Michael P. Carel wrote:
When I do this:


  

  

I can also see the HTML code, i need to put  the output  inside the table.
Is there any solution for this?
Just remove first line of Your code or replace 'text/plain' with 
'text/html'.

And put  inside -tags, as anwsered previously.

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


[PHP] Wrapping code inside [code]xxx[/code] tags.

2003-10-06 Thread PHP Webmaster
Hi all,

I have on my site a part where users' can submit articles and no doubt their
articles will contain code. Code is wrapped inside of [code] tags, i.e.
[code][/code]

However, there is other text in the same article, so I need to format the
code inside of the [code] and [/code] tags using htmlspecialchars, nl2br and
highlight_file and the rest of the code needs to be formatted with nl2br,
strip_tags and possibly stripslashes/wordwrap.

A typical example:

---
Count number of rows inside of MySQL table

[code]

[/code]

Save the above code into a file called count.php
---

The code inside of the [code] and [/code] tags needs htmlspecialchars,
nl2br, highlight_file and the outside text needs nl2br, strip_tags,
stripslashes/wordwrap.

Sorry for being repetitive, but just need to make sure I make sense!
Any ideas appreciated

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



Re: [PHP] Wrapping code inside [code]xxx[/code] tags.

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 10:06:44 +0100, you wrote:

>I have on my site a part where users' can submit articles and no doubt their
>articles will contain code. Code is wrapped inside of [code] tags, i.e.
>[code][/code]
>
>However, there is other text in the same article, so I need to format the
>code inside of the [code] and [/code] tags using htmlspecialchars, nl2br and
>highlight_file and the rest of the code needs to be formatted with nl2br,
>strip_tags and possibly stripslashes/wordwrap.

I'd suggest using string-handling functions (explode, split, preg_split,
etc) to chop the incoming text into seperate code and text blocks.

Then use highlight_string() (not highlight_file()) on the code blocks.

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



[PHP] .htaccess - Still asking for login information although already sent through address bar

2003-10-06 Thread PHP Webmaster
Hi all,

Iv'e got a .htaccess file protecting a site using HTTPS. I have tried using
a form to send the login details to the site through the address bar
(http://user:[EMAIL PROTECTED]) but the .htaccess password protection box
still appears asking for the username and password!

The only thing I can think of is me sending invalid information, but I know
I'm not!

Any ideas appreciated.

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



Re: [PHP] Wrapping code inside [code]xxx[/code] tags.

2003-10-06 Thread Burhan Khalid
PHP Webmaster wrote:

Hi all,

I have on my site a part where users' can submit articles and no doubt their
articles will contain code. Code is wrapped inside of [code] tags, i.e.
[code][/code]
You can use any number of the bbcode parsing classes available to take 
care of this.

http://www.phpclasses.org

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: .htaccess - Still asking for login information although already sent through address bar

2003-10-06 Thread PHP Webmaster

"Php Webmaster" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> Iv'e got a .htaccess file protecting a site using HTTPS. I have tried
using
> a form to send the login details to the site through the address bar
> (http://user:[EMAIL PROTECTED]) but the .htaccess password protection
box
> still appears asking for the username and password!
>
> The only thing I can think of is me sending invalid information, but I
know
> I'm not!
>
> Any ideas appreciated.

Just a quick update.

To ensure that invalid login info was not being sent, I copied the text that
was in the address bar after submitting the login form, closed down IE,
pasted in the text and it went straight in without any login boxes appearing
?!!?

It seems to be only happening after I use a form!

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



[PHP] [O|T] XML/XHTML

2003-10-06 Thread Becoming Digital
A friend asked me to recommend a good XML/XHTML reference or guide.  I was able to 
point him to a number of websites, but he said that he would prefer a book.  Sadly, I 
don't know of any, so I'm hoping some of you can offer up your favourites.  Thanks a 
lot, and sorry for the OT.

Edward Dudlik
Becoming Digital
www.becomingdigital.com

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



Re: [PHP] Newbie

2003-10-06 Thread Burhan Khalid
John Hicks wrote:

Hi list,

I have just installed PHP4.3.3-Win32. I have a book that said create a
phpinfo.php (  ) file and place it in my Apache 2 htdocs
file. I did this and when I run it opens in a blank page of DreamweaverMX.
I tried to "open with" Internet Explorer and it does nothing.
First thing to check, is Apache running? If you are on Windows XP or 
2000, Apache2 installs as a service (you should see an icon in your task 
bar -- where the clock is).

If you are also using IIS, stop IIS first. By default IIS and Apache 
both run on port 80, so if one is running, the other won't start.

To find out if IIS is running, you can follow the following steps :

Start --> Run --> services.msc [enter]

This will pull up a list of services running on your system, where you 
can check the status of Apache and IIS.

My question is what file would tell it to open in DWMX or how do I get to
the opening set-up page of PHP.
By default, when you install Dreamweaver, it associates itself with 
files that it can edit (these include .php files). So, when you are 
double clicking the file in Windows, you are asking Windows to execute 
the default action for that file, which is to open it with dreamwever 
(the registered editor for that file type).

In order to view the file itself, you will have to access it via the 
browser. You can do this by typing in the URL to your webserver (usually 
http://localhost/). This is also a good way to check if your webserver 
is running or not.

I used php4.3.3-installer.exe but I got the message that it would have to be
installed manually.
This tells me that you are NOT running IIS because the Windows installer 
sets up PHP for IIS automatically, but it doesn't for Apache.

I have a tutorial that might help you out. You can find it at my website 
(in the signature). Here is the direct link :

http://www.meidomus.com/node/view/3

Post a comment there, or you can email me if you have another question. :)

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[4]: [PHP] OO parent/child relationship

2003-10-06 Thread Tom Rogers
Hi,

Monday, October 6, 2003, 2:10:46 PM, you wrote:
RC> On Sun, 2003-10-05 at 23:37, Tom Rogers wrote:
>> Hi,
>> 
>> Well I must have missed that one :)
>> My answer, if GLOBALS were not meant to be used they wouldn't be there..
>> So if they make life easier go ahead and use them. I notice a lot of 'purists'
>> on this list that want things done a certain way but the bottom line is do what
>> your comfortable with and works for you. Of course you have to keep security
>> issues under control as well, it would be no good doing this if you run with
>> register globals set to on as the array could very easily be trashed.

RC> All fine and dandy till you decide to use some other class or library
RC> that just happened to use the same global names you've used. Then you
RC> have a mess :) But sure, if that's not an issue, go ahead and globalize
RC> everything.

RC> Cheers,
RC> Rob.

No one was suggesting globalising everything :)

-- 
regards,
Tom

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



[PHP] Re: php5 and possible oop features/questions

2003-10-06 Thread Tit \"Black\" Petric
Not really what i was getting at dude, i dont see how defining a class
variable will let me define a method outside of a given class, or to
dynamically extend/implement other classes inside a general one?

try again ;)

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



Re: [PHP] Re: php5 and possible oop features/questions

2003-10-06 Thread Eugene Lee
On Mon, Oct 06, 2003 at 12:36:49PM +0200, Tit Black Petric wrote:
: 
: Not really what i was getting at dude, i dont see how defining a class
: variable will let me define a method outside of a given class, or to
: dynamically extend/implement other classes inside a general one?

Why the desire to define a method outside of a class definition besides
the primary reason of syntactical sugar?

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



Re: [PHP] .htaccess - Still asking for login information although already sent through address bar

2003-10-06 Thread Mika Tuupola
On Mon, 6 Oct 2003, PHP Webmaster wrote:

> Iv'e got a .htaccess file protecting a site using HTTPS. I have tried using
> a form to send the login details to the site through the address bar
> (http://user:[EMAIL PROTECTED]) but the .htaccess password protection box

That does not look like https. Try changing to

https://user:[EMAIL PROTECTED]/

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/

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



Re: [PHP] .htaccess - Still asking for login information although already sent through address bar

2003-10-06 Thread Nathan Taylor
Does it continuously ask or just twice?  I've found a weird issue with .htaccess where 
if the domain name is a mask for a subdomain host and you try to access an .htaccess 
protected page it will prompt you for the password, redirect you to the subdomain and 
then prompt you again.

Nathan 
  - Original Message - 
  From: Mika Tuupola 
  To: PHP Webmaster 
  Cc: [EMAIL PROTECTED] 
  Sent: Monday, October 06, 2003 7:12 AM
  Subject: Re: [PHP] .htaccess - Still asking for login information although already 
sent through address bar


  On Mon, 6 Oct 2003, PHP Webmaster wrote:

  > Iv'e got a .htaccess file protecting a site using HTTPS. I have tried using
  > a form to send the login details to the site through the address bar
  > (http://user:[EMAIL PROTECTED]) but the .htaccess password protection box

  That does not look like https. Try changing to

  https://user:[EMAIL PROTECTED]/

  -- 
  Mika Tuupola  http://www.appelsiini.net/~tuupola/

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



Re: [PHP] Newbie

2003-10-06 Thread Burhan Khalid
Wang Feng wrote:

To find out if IIS is running, you can follow the following steps :
Start --> Run --> services.msc [enter]
This will pull up a list of services running on your system, where you
can check the status of Apache and IIS.


Where did you *learn* the services.msc command? How and where can I know
these kind of commands and Windows internal stuff? Please advise.
Well, I don't remember to be honest. I know that .msc is the extension 
for "Microsoft Console". These are all the snap-ins that are available 
to the mmc (Microsoft Management Console).


I have a tutorial that might help you out. You can find it at my website
(in the signature). Here is the direct link :
http://www.meidomus.com/node/view/3

Post a comment there, or you can email me if you have another question. :)


Very nice web site! I like it.
Thanks

I'm so curious: do you code html yourself for the whole web site OR do you
use any tool like Dreamweaver or Frontpage?
No, the HTML is done without the use of a wysiwyg editor.

Do you host the web site your self or pay for the hosting company?
I pay to have it hosted.

In addititon to PHP, JavaScript and MySQL, what other technologies do you
use to create the web site?
Drupal (which provides a OOP backend)
http://www.drupal.org
I used drupal as a framework and then expanded on that to build some 
modules.

Fireworks (minor image manipulation) 
http://www.macromedia.com/products/fireworks

CSS for layout
http://www.w3.org/Style/CSS
http://glish.com/css
Email me off list if you have any other questions :)

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] How to upload files

2003-10-06 Thread Jay Blanchard
[snip]
I'm looking for a method to enable my users to upload thier html files
and embedded pictures to my server. I think it should be something very
easy, but as I'm doing it for the first time, I thought it would be
better to seek help from the experienced one. So any idea, how can I do
it easly and safely and what are the precautions I should take to check
the files for valid HTML and pic files, so that they cann't upload any
thing destructive. Any help or suggestions will be highly appreciated.
[/snip]

My suggestion would be to start with the manual at
http://us4.php.net/manual/en/features.file-upload.php

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



RE: [PHP] Wrapping code inside [code]xxx[/code] tags.

2003-10-06 Thread Jay Blanchard
[snip]
I have on my site a part where users' can submit articles and no doubt
their
articles will contain code. Code is wrapped inside of [code] tags, i.e.
[code][/code]
[/snip]

A simple way would be to replace the [code] tags with  tags for
display. Also Evolt.org does a nifty thing with code in iframes within
articles.

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



[PHP] php classes

2003-10-06 Thread Cameron Metzke
Anybody know of any real world php class tutorials?, so far ive read ones
about building car and cake classes but i tend to learn better from actually
follow a tutorial and building something though it and i done know jack
about building cars lol.

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



Re: [PHP] php classes

2003-10-06 Thread daniel
pear dude, check it out ..

> Anybody know of any real world php class tutorials?, so far ive read
> ones about building car and cake classes but i tend to learn better
> from actually follow a tutorial and building something though it and i
> done know jack about building cars lol.
>
> --
> 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 classes

2003-10-06 Thread Jay Blanchard
[snip]
Anybody know of any real world php class tutorials?, so far ive read
ones
about building car and cake classes but i tend to learn better from
actually
follow a tutorial and building something though it and i done know jack
about building cars lol.
[/snip]

There is a reason for class "tutorials" in this manner, it is because
the relationships between properties (variables) and methods (functions)
are important to understand. But here is one (Google is your friend)

http://www.phpfreaks.com/tutorials/85/0.php

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



Re: [PHP] Re: mail() function, how to get it work?

2003-10-06 Thread Burhan Khalid
Manuel Lemos wrote:

Hello,

On 10/03/2003 12:44 PM, Kristian Snabb wrote:

How do I set up the mail() function in php.ini.
How do I define the username and password? My smtp service requires me 
to log on.

I'm using Apache 2.0.47 on WinXP Pro.


There is no way to set SMTP authentication using the mail() function.
Since you are one WinXP Pro -- you can download something like postcast 
http://www.postcast.com (a free SMTP server), and use that instead.

However, the original statement is correct ... mail() doesn't support 
SMTP authentication.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php classes

2003-10-06 Thread Cameron Metzke
Yep thanx guys they look really cool :), and yes your right google is my
friend lol, ive been looking for days on google with more search terms than
ever but i missed these 2. take care and again thanx :D
"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
Anybody know of any real world php class tutorials?, so far ive read
ones
about building car and cake classes but i tend to learn better from
actually
follow a tutorial and building something though it and i done know jack
about building cars lol.
[/snip]

There is a reason for class "tutorials" in this manner, it is because
the relationships between properties (variables) and methods (functions)
are important to understand. But here is one (Google is your friend)

http://www.phpfreaks.com/tutorials/85/0.php

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



Re: [PHP] Wrapping code inside [code]xxx[/code] tags.

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 07:12:07 -0500, you wrote:

>Also Evolt.org does a nifty thing with code in iframes within
>articles.

Just a .

CSS's overflow: property is a possible text-within-text solution, too.

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



Re: [PHP] php classes

2003-10-06 Thread Jeremy Johnstone
I don't know if these will help you, but maybe take a look here:

phpclasses.org (code samples to read over)
hotscripts.com (complete programs to read over)
devshed.com (heard they had good articles, never really been there)

Jeremy

On Mon, 2003-10-06 at 07:13, Cameron Metzke wrote:
> Anybody know of any real world php class tutorials?, so far ive read ones
> about building car and cake classes but i tend to learn better from actually
> follow a tutorial and building something though it and i done know jack
> about building cars lol.

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



Re: [PHP] attach file with mail() function??

2003-10-06 Thread Steve Buehler
At 06:34 PM 10/5/2003, Roy W wrote:
Is there a way to attach a file with the mail() function?

Thanks!
Yes.  Take a look at http://www.php.net/mail

Steve

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


Re: Re[4]: [PHP] OO parent/child relationship

2003-10-06 Thread Robert Cummings
On Mon, 2003-10-06 at 06:22, Tom Rogers wrote:
> >> 
> >> Well I must have missed that one :)
> >> My answer, if GLOBALS were not meant to be used they wouldn't be there..
> >> So if they make life easier go ahead and use them. I notice a lot of 'purists'
> >> on this list that want things done a certain way but the bottom line is do what
> >> your comfortable with and works for you. Of course you have to keep security
> >> issues under control as well, it would be no good doing this if you run with
> >> register globals set to on as the array could very easily be trashed.
> 
> RC> All fine and dandy till you decide to use some other class or library
> RC> that just happened to use the same global names you've used. Then you
> RC> have a mess :) But sure, if that's not an issue, go ahead and globalize
> RC> everything.
> 
> No one was suggesting globalising everything :)
> 

I was! If the global issue isn't an issue, and you really feel like
using globals, and you are comfortable with using them, and you don't
ever expect conflicts then go ahead and use them :) Its almost
impossible not to use at least one, unless you use a function as the
entry point to your code, in which case the name of the function has all
of the same issues. Personally I use a single array withing the global
scope to hold any necessary global configuration data. For example:

$GLOBALS['interJinn']['pageCompression'] = true;

This minimizes the chance of conflict IMHO.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] null character - file related function

2003-10-06 Thread Martin Straka
Hi,

Is somewhere documented that everything after NULL (0x00 %00) character
is ignored for example in functions include, fopen etc?



Martin Straka

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



Re: [PHP] null character - file related function

2003-10-06 Thread Marek Kilimajer
You cannot have chr(0) in filenames

Martin Straka wrote:

Hi,

Is somewhere documented that everything after NULL (0x00 %00) character
is ignored for example in functions include, fopen etc?

Martin Straka

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


[PHP] IRC

2003-10-06 Thread Paulo Nunes
How can i build a chat using PHP and without refreshing a frame every x
seconds?
Thanks!!!

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



Re: [PHP] IRC

2003-10-06 Thread Marek Kilimajer
Search for "hidden iframe"

Paulo Nunes wrote:

How can i build a chat using PHP and without refreshing a frame every x
seconds?
Thanks!!!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] null character - file related function

2003-10-06 Thread Mark Charette
On Mon, 6 Oct 2003, Martin Straka wrote:
>
> Is somewhere documented that everything after NULL (0x00 %00) character
> is ignored for example in functions include, fopen etc?

Interestingly, no, it's not documented in the manual (at least I couldn't
find any official documentation on NULL terminated strings as a definition
when I searched through the official docs). However, strings in PHP follow
the C convention of being NULL terminated.

Mark C.

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



[PHP] proc_open to return an encrypted string?

2003-10-06 Thread Robert Van Overmeiren
Hello,

I want to take a String variable and GPG encrypt it, then email the
encrypted string.

One of our developers suggested using "proc_open" and to "set the process to
'gpg -a --encrypt -r 0x35E891B0'", but couldn't clarify.

How is this done? Would it be something like this...?
-

$message = "Text or HTML string";

$pipes = "-a --encrypt -r 0x35E891B0";

$descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2
=> array("file", "/tmp/error-output.txt", "a"));

$process = proc_open("gpg", $descriptorspec, $pipes);

if (is_resource($process)) {
fwrite($pipes[0], $message);
fclose($pipes[0]);
while(!feof($pipes[1])) {
echo fgets($pipes[1], 1024);
}
fclose($pipes[1]);
$return_value = proc_close($process);
}

send_mail($smtp_server, $smtp_port, $sender_email, $recipient_email,
$subject, $message, $headers);



Thank you,
Bob Van

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



Re: [PHP] null character - file related function

2003-10-06 Thread Robert Cummings
On Mon, 2003-10-06 at 11:29, Mark Charette wrote:
> On Mon, 6 Oct 2003, Martin Straka wrote:
> >
> > Is somewhere documented that everything after NULL (0x00 %00) character
> > is ignored for example in functions include, fopen etc?
> 
> Interestingly, no, it's not documented in the manual (at least I couldn't
> find any official documentation on NULL terminated strings as a definition
> when I searched through the official docs). However, strings in PHP follow
> the C convention of being NULL terminated.

Strings in PHP are binary safe and thus do not rely on null temrination.
You can see this via the following example:

http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] IRC

2003-10-06 Thread Chris Shiflett
--- Paulo Nunes <[EMAIL PROTECTED]> wrote:
> How can i build a chat using PHP and without refreshing a frame
> every x seconds?

Use chunked transfers. The flush command can help you achieve this:

http://www.php.net/flush

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] null character - file related function

2003-10-06 Thread Mark Charette
On 6 Oct 2003, Robert Cummings wrote:
>
> Strings in PHP are binary safe and thus do not rely on null temrination.

You are, of course, right (just a brainfart on my part ...).

There are a number of functions that depend on null termination of 
strings; handing a string with embedded nulls in it to those functions may 
result in "interesting" things happening 

Mark C.

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



[PHP] functions using other functions inside of classes?

2003-10-06 Thread Kirk Babb
If I have a class with several functions, and one of the functions is used
by the other functions in the class, how do I get to it?  In particular I'd
like the dbConnect, fail and success functions to be seen by the other
functions in the class.  I guess I just don't understand the way to use OO
yet.

Also, any comments on improving the logic to make sure I don't get duplicate
entries would be much appreciated  (I'm auto_incrementing a field named 'id'
upon insert).

here's the code:
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] null character - file related function

2003-10-06 Thread Martin Straka
Hi,

On Mon, 6 Oct 2003, Mark Charette wrote:

> > Strings in PHP are binary safe and thus do not rely on null temrination.
>
> You are, of course, right (just a brainfart on my part ...).
>
> There are a number of functions that depend on null termination of
> strings; handing a string with embedded nulls in it to those functions may
> result in "interesting" things happening 

And is somewhere written which functions depend on null termination?

example 1:
 I know that this URL is not the correct one (RFC 1738), but if the 0x01
 is encoded to \x01 why the 0x00 is not?

 $a = "http://xxx/test?a=aaa".chr(1).chr(2).chr(0)."bbb";
 include($a);

 (it is requesting: http://xxx/test?a=aaa\x01\x02)

example 2:

 $a = "1234 abc".chr(1).chr(0)."def";
 $b = escapeshellcmd($a);
 echo $b;

 [$b is "1234 abc".chr(1)]

Martin Straka

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



[PHP] File read and sort question

2003-10-06 Thread Susan Ator
I have a directory with an ever-changing number of files. Some will be
removed and others added on a continuing basis.

The files are ascii with the following layout:

 Name
 Subject line
 mm/dd/
 hh:mm

I can easily get a list of files and pull the necessary information. I need,
however to be able to sort by RELEASE_DATE *and* RELEASE_TIME

Philosophically, what is the best way to handle this? I'm hesitant to pull
all the information into an array and use ksort since there are, on average,
~1000 messages in this directory which need to be processed.

Susan

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



Re: [PHP] File read and sort question

2003-10-06 Thread Robert Cummings
On Mon, 2003-10-06 at 12:10, Susan Ator wrote:
> I have a directory with an ever-changing number of files. Some will be
> removed and others added on a continuing basis.
> 
> The files are ascii with the following layout:
> 
>  Name
>  Subject line
>  mm/dd/
>  hh:mm
> 
> I can easily get a list of files and pull the necessary information. I need,
> however to be able to sort by RELEASE_DATE *and* RELEASE_TIME
> 
> Philosophically, what is the best way to handle this? I'm hesitant to pull
> all the information into an array and use ksort since there are, on average,
> ~1000 messages in this directory which need to be processed.

Smells like a job for a database :)  Otherwise you'll need to either
read all the data in, or create another file heirarchy with the
appropriate redundancy to retrieve in sorted order, which incidentally
probably loads all the file names then sorts. Really it's a database,
database, database issue *grin*.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] .htaccess - Still asking for login information although already sent through address bar

2003-10-06 Thread PHP Webmaster

"Mika Tuupola" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Mon, 6 Oct 2003, PHP Webmaster wrote:
>
> > Iv'e got a .htaccess file protecting a site using HTTPS. I have tried
using
> > a form to send the login details to the site through the address bar
> > (http://user:[EMAIL PROTECTED]) but the .htaccess password protection
box
>
> That does not look like https. Try changing to
>
> https://user:[EMAIL PROTECTED]/
>
> --
> Mika Tuupola  http://www.appelsiini.net/~tuupola/

Oops, sorry. I meant HTTPS. I did also check again!

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



Re: [PHP] .htaccess - Still asking for login information although already sent through address bar

2003-10-06 Thread PHP Webmaster

"Nathan Taylor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Does it continuously ask or just twice?  I've found a weird issue with
.htaccess where if the domain name is a mask for a subdomain host and you
try to access an .htaccess protected page it will prompt you for the
password, redirect you to the subdomain and then prompt you again.

Nathan
  - Original Message -
  From: Mika Tuupola
  To: PHP Webmaster
  Cc: [EMAIL PROTECTED]
  Sent: Monday, October 06, 2003 7:12 AM
  Subject: Re: [PHP] .htaccess - Still asking for login information although
already sent through address bar


  On Mon, 6 Oct 2003, PHP Webmaster wrote:

  > Iv'e got a .htaccess file protecting a site using HTTPS. I have tried
using
  > a form to send the login details to the site through the address bar
  > (http://user:[EMAIL PROTECTED]) but the .htaccess password protection
box

  That does not look like https. Try changing to

  https://user:[EMAIL PROTECTED]/

  --
  Mika Tuupola  http://www.appelsiini.net/~tuupola/

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

If I use my login form, the login box pops up only once. If I copy the text
from the address bar (generated by the form) and paste it into the address
bar (after restarting the browser) the logon box does not appear.

Weird eh?

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



Re: [PHP] Newbie

2003-10-06 Thread John Hicks
Hi John--

Your name caught my eye, so I had to reply!

Unfortunately I run PHP on Linux so can't be sure about 
your situation with Windex.

But I think your problem is that you are opening your 
phpinfo.php file from your local file system. You 
should instead open it through your webserver. (i.e. 
enter your local domain name or IP address into your 
browser).

To explain: phpinfo() is a PHP function that simply 
lists a lot of useful information about your PHP 
setup. But for it to be invoked, it must be run 
through the PHP interpreter. If you open it via your 
local file system, you bypass PHP. (When you installed 
Dreamweaver, it probably configured Winduhs to invoke 
DW whenever you open a .php file locally.)

Hope this helps.

Regards,

(Another) John Hicks


On Sunday 05 October 2003 01:28 pm, John Hicks wrote:
> Hi list,
>
> I have just installed PHP4.3.3-Win32. I have a book
> that said create a phpinfo.php (  )
> file and place it in my Apache 2 htdocs file. I did
> this and when I run it opens in a blank page of
> DreamweaverMX.
>
> I tried to "open with" Internet Explorer and it does
> nothing.
>
> My question is what file would tell it to open in
> DWMX or how do I get to the opening set-up page of
> PHP.
>
> I used php4.3.3-installer.exe but I got the message
> that it would have to be installed manually.
>
> Any help or direction would be appreciated.
>
> John H.

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



RE: [PHP] File read and sort question

2003-10-06 Thread Susan Ator
The problem with using a database is the files within the directory are
changing on, sometimes, a minute by minute basis. I think reading them into
the database then deleting them when they are deleted from the directory
would be a huge amount of overhead. No?

Something else which I did not make clear in my previous post; when the
files are removed from the directory I no longer want them displaying in my
web page.

Susan

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003 12:18 PM
To: Susan Ator
Cc: PHP-General
Subject: Re: [PHP] File read and sort question


On Mon, 2003-10-06 at 12:10, Susan Ator wrote:
> I have a directory with an ever-changing number of files. Some will be
> removed and others added on a continuing basis.
> 
> The files are ascii with the following layout:
> 
>  Name
>  Subject line
>  mm/dd/
>  hh:mm
> 
> I can easily get a list of files and pull the necessary information. I
need,
> however to be able to sort by RELEASE_DATE *and* RELEASE_TIME
> 
> Philosophically, what is the best way to handle this? I'm hesitant to pull
> all the information into an array and use ksort since there are, on
average,
> ~1000 messages in this directory which need to be processed.

Smells like a job for a database :)  Otherwise you'll need to either
read all the data in, or create another file heirarchy with the
appropriate redundancy to retrieve in sorted order, which incidentally
probably loads all the file names then sorts. Really it's a database,
database, database issue *grin*.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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

2003-10-06 Thread Richard Baskett
on 10/2/03 7:00, Jay Blanchard at [EMAIL PROTECTED] wrote:

> [snip]
>> Because it is not a bug, it is bad code design! 8000+ lines of $x = 1; is
>> just
>> downright goofy! Did you happen to try it with 8000+ repeated blocks of any
>> other type? My bet is that it would quit then too.
> 
> Yeah no crash because that's only a couple lines of code :)  And yeah it
> doesn¹t matter what you have in there just as long as you have that many
> lines.. 
> 
> I didn't try include files, but apparently that counts as lines of codes
> also.. so 8000+ total lines.. I agree, but it does crash and apparently the
> guy that found the bug does write that many lines of code.. don't ask me.. I
> don't know why :)
> [/snip]
> 
> You said you looped - "I created a loop that assigned $x = 1; a whole bunch of
> times"
> 
> But anyhow, I digress. We have several files that exceed 8000 (we try not to
> write them that big, but YMMV) lines of code that there are no problems with.
> My bet is that it has to do with memory amount and allocation, which would
> explain differences between yours and his.

Actually PHP.net released new code that fixed it.. enough OS X people were
commenting on it that they finally decided to research the problem and sure
enough they found the problem and fixed the problem.  So it's all good..  I
had not run up against that line limit in any of my code, but apparently
there are packages out there that do include that many lines of code..
anyways it's fixed now so no worries.

Cheers!

Rick

"The flame of inspiration needs to be encouraged. Put a glass around that
small candle and protect it from discouragement or ridicule." - Mary Higgins
Clark

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



Re: [PHP] .htaccess - Still asking for login information although already sent through address bar

2003-10-06 Thread Jason Wong
On Tuesday 07 October 2003 00:32, PHP Webmaster wrote:

> If I use my login form, the login box pops up only once. If I copy the text
> from the address bar (generated by the form) and paste it into the address
> bar (after restarting the browser) the logon box does not appear.

Perhaps you could show some code?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
A reverend wanted to telephone another reverend.  He told the operator,
"This is a parson to parson call."
*/

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



Re: [PHP] null character - file related function

2003-10-06 Thread Curt Zirzow
* Thus wrote Martin Straka ([EMAIL PROTECTED]):
> Hi,
> 
> On Mon, 6 Oct 2003, Mark Charette wrote:
> 
> > > Strings in PHP are binary safe and thus do not rely on null temrination.
> >
> > You are, of course, right (just a brainfart on my part ...).
> >
> > There are a number of functions that depend on null termination of
> > strings; handing a string with embedded nulls in it to those functions may
> > result in "interesting" things happening 
> 
> And is somewhere written which functions depend on null termination?

Well, the source code for escapeshellcmd has:

/* {{{ php_escape_shell_cmd
   Escape all chars that could possibly be used to
   ...

   *NOT* safe for binary strings
*/

Some functions are documented as binary safe, i'm not entirely sure
what php's policy is on noting if a function is binary safe or not.


Curt
-- 
List Stats: http://zirzow.dyndns.org/html/mlists/php_general/

"I used to think I was indecisive, but now I'm not so sure."

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



RE: [PHP] File read and sort question

2003-10-06 Thread Robert Cummings
On Mon, 2003-10-06 at 12:36, Susan Ator wrote:
> The problem with using a database is the files within the directory are
> changing on, sometimes, a minute by minute basis. I think reading them into
> the database then deleting them when they are deleted from the directory
> would be a huge amount of overhead. No?

Not if they are changing on a minute by minute basis. Most of your
queries will be selects.

> Something else which I did not make clear in my previous post; when the
> files are removed from the directory I no longer want them displaying in my
> web page.

Double delete, from filesystem and from database. You pretty much have 3
choices that I can think of here:

  1. use a database which is suited to your task
  2. Use the filesystem but load the list everytime and apply ksort
 (you already said you don't want to do this).
  3. Use the filesystem, sort the entries, and cache the sorted result.
 (this is very database like).

Cheers,
Rob.

> 
> Susan
> 
> -Original Message-
> From: Robert Cummings [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 06, 2003 12:18 PM
> To: Susan Ator
> Cc: PHP-General
> Subject: Re: [PHP] File read and sort question
> 
> 
> On Mon, 2003-10-06 at 12:10, Susan Ator wrote:
> > I have a directory with an ever-changing number of files. Some will be
> > removed and others added on a continuing basis.
> > 
> > The files are ascii with the following layout:
> > 
> >  Name
> >  Subject line
> >  mm/dd/
> >  hh:mm
> > 
> > I can easily get a list of files and pull the necessary information. I
> need,
> > however to be able to sort by RELEASE_DATE *and* RELEASE_TIME
> > 
> > Philosophically, what is the best way to handle this? I'm hesitant to pull
> > all the information into an array and use ksort since there are, on
> average,
> > ~1000 messages in this directory which need to be processed.
> 
> Smells like a job for a database :)  Otherwise you'll need to either
> read all the data in, or create another file heirarchy with the
> appropriate redundancy to retrieve in sorted order, which incidentally
> probably loads all the file names then sorts. Really it's a database,
> database, database issue *grin*.
> 
> Cheers,
> Rob.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] File read and sort question

2003-10-06 Thread Chris Sherwood
Susan

It appears that you will want to use a database. and update it when the
files are removed. (possibly provide a page to do uploading, modifications
and deletions with .. this way you can automate the db)

other than that you will have to recreate everything each time you process
or display the file list.
and dont read the file into the db unless your gonna do the modifications
there
just store a reference link in the db that way your overhead stays small.

Chris


> The problem with using a database is the files within the directory are
> changing on, sometimes, a minute by minute basis. I think reading them
into
> the database then deleting them when they are deleted from the directory
> would be a huge amount of overhead. No?
>
> Something else which I did not make clear in my previous post; when the
> files are removed from the directory I no longer want them displaying in
my
> web page.
>
> Susan

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



[PHP] How can I get a function name?

2003-10-06 Thread RDias
How can I get a function name?

>From inside a function / method, i need discover it name.
How can i do this?

thanks

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



Re: [PHP] How can I get a function name?

2003-10-06 Thread Leif K-Brooks
RDias wrote:

How can I get a function name?

If  you're using PHP 4.3.0+, try the __FUNCTION__ magic constant. 
http://us2.php.net/manual/en/language.constants.predefined.php

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


Re: [PHP] File read and sort question

2003-10-06 Thread Brad Pauly
Susan Ator wrote:

The problem with using a database is the files within the directory are
changing on, sometimes, a minute by minute basis. I think reading them into
the database then deleting them when they are deleted from the directory
would be a huge amount of overhead. No?
Something else which I did not make clear in my previous post; when the
files are removed from the directory I no longer want them displaying in my
web page.
[snip]

On Mon, 2003-10-06 at 12:10, Susan Ator wrote:

I have a directory with an ever-changing number of files. Some will be
removed and others added on a continuing basis.
The files are ascii with the following layout:

 Name
 Subject line
 mm/dd/
 hh:mm
I can easily get a list of files and pull the necessary information. I
Would it be possible to take advantage of the way the files are named? 
If you included the RELEASE_DATE and RELEASE_TIME in the name of the 
file it would save you the step of reading the files. Just getting the 
contents of the directory should provide all the information. Of course 
you would still need to put that in an array and sort it.

- Brad

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


[PHP] Multiple attachments in an email

2003-10-06 Thread Ajay Singh
Hi,

Please guide how to send multiple attachments in one mail through php mail script. The 
following code is working for the one attachment:

Thanks & regards,
Ajay


 // Read POST request params into global vars
$to  = $_POST['to'];
$from= $_POST['from'];
$subject = $_POST['subject'];
$message = $_POST['message'];

// Obtain file upload vars
$fileatt  = $_FILES['fileatt']['tmp_name'];
$fileatt_type = $_FILES['fileatt']['type'];
$fileatt_name = $_FILES['fileatt']['name'];

$headers = "From: $from";

if (is_uploaded_file($fileatt)) {
  // Read the file to be attached ('rb' = read binary)
  $file = fopen($fileatt,'rb');
  $data = fread($file,filesize($fileatt));
  fclose($file);

  // Generate a boundary string
  $semi_rand = md5(time());
  $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

  // Add the headers for a file attachment
  $headers .= "\nMIME-Version: 1.0\n" .
  "Content-Type: multipart/mixed;\n" .
  " boundary=\"{$mime_boundary}\"";

  // Add a multipart boundary above the plain message
  $message = "This is a multi-part message in MIME format.\n\n" .
 "--{$mime_boundary}\n" .
 "Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
 "Content-Transfer-Encoding: 7bit\n\n" .
 $message . "\n\n";

  // Base64 encode the file data
  $data = chunk_split(base64_encode($data));

// Add file attachment to the message
  $message .= "--{$mime_boundary}\n" .
  "Content-Type: {$fileatt_type};\n" .
  " name=\"{$fileatt_name}\"\n" .
  //"Content-Disposition: attachment;\n" .
  //" filename=\"{$fileatt_name}\"\n" .
  "Content-Transfer-Encoding: base64\n\n" .
  $data . "\n\n" .
  "--{$mime_boundary}--\n";
}

// Send the message
$ok = @mail($to, $subject, $message, $headers);
if ($ok) {
  echo "Mail sent! ";
} else {
  echo "Mail could not be sent. Sorry!";
}
?>


RE: [PHP] OO parent/child relationship

2003-10-06 Thread Andy Crain
This all seems like a perfect case for the singleton pattern. See
http://www.phppatterns.com/index.php/article/articleview/6/1/1/ and
http://www.phppatterns.com/index.php/article/articleview/75/1/1/
Andy

> -Original Message-
> From: Evan Nemerson [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 06, 2003 2:07 AM
> To: Robert Cummings; Curt Zirzow
> Cc: PHP List
> Subject: Re: [PHP] OO parent/child relationship
> 
> Aye. PHP already reserves function names prepended with __ as magic.
But
> really one could make this argument ad infinitum. If everyone wants to
> start
> their variables with a *insert random character here*, "*grin*"
> 
> IMHO it's good advice to "prepend global vars with '__' or something".
I
> usually prepend my global vars with the application name. For
instance,
> $wiki_DSN, $wiki_title, $wiki_authors, etc.
> 
> 
> 
> On Sunday 05 October 2003 09:58 pm, Robert Cummings wrote:
> > On Mon, 2003-10-06 at 00:48, Curt Zirzow wrote:
> > > On the global topic, I would suggest establishing a standard
> > > naming convention for your common globals that are used, I do
> > > something like:
> > >   $__object_something__;
> > >
> > > With your global var I can see myself writing something that will
> > > overwrite that $class_ref, Like say if I'm handling something that
> > > has to do with referee's in school classes :)  Preceeding the
> > > global vars with '__' or something will keep the namespace
clashing
> > > cases down to a minimum.
> >
> > But if everyone fallows your advice for using __ as a prefix...
*grin*.
> >
> > Rob.
> 
> --
> Evan Nemerson
> [EMAIL PROTECTED]
> 
> --
> "To achieve adjustment and sanity and the conditions that follow from
> them, we
> must study the structural characteristics of this world first and,
then
> only,
> build languages of similar structure, instead of habitually ascribing
to
> the
> world the primitive structure of our language."
> 
> -Alfred Korzybski
> 
> --
> 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] php 4.3.3 / pcntl_signal problem?

2003-10-06 Thread Karl Pielorz
Hi All,

[This is quite a long post, my apologies :(]

I have the CLI version of PHP 4.3.3 running under FreeBSD 5.1-Release. I 
seem to have encountered some 'strange' behaviour with signals...

I may have missed the plot so far as signals go under PHP, but from within 
my signal handler routine - I appear to only be able to call '1 level' of 
user functions, i.e. If I call a user function, which in turn calls another 
user-function, my signal handler appears never gets returned to.

e.g.

function my_sig_handler( $signo ){

 if( $signo == SIGTERM ){
   echo( "Term received, cleaning up...\n" );
   do_cleanup();
   echo( "Clean up done.\n" );
   exit();
 }
}

Appears to work, but _IF_ "do_cleanup()" in turn calls another routine, e.g.

function do_cleanup(){

 echo( "Cleaning up...\n" );
 write_my_log_entry( "Cleaning up" );
 echo( "Clean up is now complete.\n" );
}

All I see on the output is:

"
Term received, cleaning up...
Cleaning up...
[log entry written]
devbox>
"
If I comment out the "write_my_log_entry" function in do_cleanup() - I get:

"
Term received, cleaning up...
Cleaning up...
Done cleaning up
Clean up is now complete.
devbox>
"
Which is what I'd expect.

I have thoroughly checked "write_my_log_entry()" - and even if I just 
change that to a simple "echo" routine [i.e. no actual code] - if it's 
called from the signal handler, as a function being called by a function - 
the signal handler never see's the light of day once write_my_log_entry() 
has finished.

I can kind of work around this, by in-lining the code from the actual 
functions - but I'd rather not (for obvious reasons).

Anyone else out there done a lot of work with PHP signals who might be able 
to shed some light on this?

Thanks in advance,

-Karl

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


[PHP] Array of Classes

2003-10-06 Thread Rob Wiltbank
Greetings..

Doing some persistant connection socket-based PHP stuff and I'm trying to
figure out a few things:

1) How can I create an array of classes so they could be referenced, for
instance: $array[$uniqueID][$class->var] = 10; ?

2) Would it instantiate when that particular element was used and would the
constructor run at that point?

3) Any way to dispose/destroy of an object once it's done being used to free
up the resources?

Thanks,
Rob

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



[PHP] Compiled Regular Expressions?

2003-10-06 Thread Manuel Vázquez Acosta
Hi all:

I need to know if PHP compiles regular expressions. If it does so, is there
any way to cache the compiled resource in order to speed up next calls to
preg_* functions?

Manu.

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



RE: [PHP] File read and sort question

2003-10-06 Thread Susan Ator
I have no control over

1) file naming
2) file inclusion in the directory
3) file removal from the directory

This is all being handled through another program written in C.

So far I have been able to put the relevant info from each file into the
database then display with a simple order by.

Now, I'm attempting to get the correct flow for checking if the file is in
the database but not in the directory so I can delete it from the database.
Trial and error.

Susan

-Original Message-
From: Brad Pauly [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003 1:06 PM
To: PHP-General
Subject: Re: [PHP] File read and sort question


Susan Ator wrote:

> The problem with using a database is the files within the directory are
> changing on, sometimes, a minute by minute basis. I think reading them
into
> the database then deleting them when they are deleted from the directory
> would be a huge amount of overhead. No?
> 
> Something else which I did not make clear in my previous post; when the
> files are removed from the directory I no longer want them displaying in
my
> web page.

[snip]

> On Mon, 2003-10-06 at 12:10, Susan Ator wrote:
> 
>>I have a directory with an ever-changing number of files. Some will be
>>removed and others added on a continuing basis.
>>
>>The files are ascii with the following layout:
>>
>> Name
>> Subject line
>> mm/dd/
>> hh:mm
>>
>>I can easily get a list of files and pull the necessary information. I

Would it be possible to take advantage of the way the files are named? 
If you included the RELEASE_DATE and RELEASE_TIME in the name of the 
file it would save you the step of reading the files. Just getting the 
contents of the directory should provide all the information. Of course 
you would still need to put that in an array and sort it.

- Brad

-- 
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] Array of Classes

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 13:41:22 -0400, you wrote:

>1) How can I create an array of classes so they could be referenced, for
>instance: $array[$uniqueID][$class->var] = 10; ?
>
>2) Would it instantiate when that particular element was used and would the
>constructor run at that point?
>
>3) Any way to dispose/destroy of an object once it's done being used to free
>up the resources?

Created");
}

function B ($s = "None") {
echo ("input : $s");
}
}

$C = array();

for ($i = 0; $i < 3; $i++)
{
$C[$i] = new A();
}

for ($i = 0; $i < 3; $i++)
{
$C[$i]->B($i);
}

for ($i = 0; $i < 3; $i++)
{
unset ($C[$i]);
}

?>

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



[PHP] Re: PHP & CSS

2003-10-06 Thread erythros
people will still be able to see your style sheet, by folling the link to
your css file.
how are you apling the variables in the first place? now that you are link
to a style sheet what has changed (apperance wise) with the output of the
page. is the formating not being applied? can you send a sample of what you
are trying to do?

"Raquel Rice" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm currently building a dynamic site which draws page configuration
> variables from config (ini) files.  To use those variables from the
> ini files, I write the style sheet in the header of each page.
>
> Here's my problem.  I want to link to a style sheet rather than
> writing it to the page head, so that it's not visible by viewing the
> page source.  I'm not sure how to draw the variable values from the
> ini file and apply them to the style sheet.  Does anyone have any
> help?
>
> --
> Raquel
> 
> He who possesses the source of enthusiasm will achieve great things.
>  Doubt not. You will gather friends around you as a hair clasp
> gathers the hair.
>   --I Ching (B.C. ?)

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



Re: [PHP] OO parent/child relationship

2003-10-06 Thread Gerard Samuel
Andy Crain wrote:

This all seems like a perfect case for the singleton pattern. See
http://www.phppatterns.com/index.php/article/articleview/6/1/1/ and
http://www.phppatterns.com/index.php/article/articleview/75/1/1/
Andy
Im currently trying to wrap the brain around the Singleton Registry article.
Wish me luck :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHP & CSS

2003-10-06 Thread Chris Hubbard
Raquel,
this is an HTML question, not PHP.  And here's the answer:
The following goes in the < head > section of your html:


-Original Message-
From: Raquel Rice [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003 10:13 AM
To: PHP-General
Subject: [PHP] PHP & CSS


I'm currently building a dynamic site which draws page configuration
variables from config (ini) files.  To use those variables from the
ini files, I write the style sheet in the header of each page.

Here's my problem.  I want to link to a style sheet rather than
writing it to the page head, so that it's not visible by viewing the
page source.  I'm not sure how to draw the variable values from the
ini file and apply them to the style sheet.  Does anyone have any
help?

--
Raquel

He who possesses the source of enthusiasm will achieve great things.
 Doubt not. You will gather friends around you as a hair clasp
gathers the hair.
  --I Ching (B.C. ?)

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

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 11:13:04 -0700, you wrote:

>I'm currently building a dynamic site which draws page configuration
>variables from config (ini) files.  To use those variables from the
>ini files, I write the style sheet in the header of each page.
>
>Here's my problem.  I want to link to a style sheet rather than
>writing it to the page head, so that it's not visible by viewing the
>page source.  I'm not sure how to draw the variable values from the
>ini file and apply them to the style sheet.  Does anyone have any
>help?

How often will they change, realistically? There's a case for just
hard-coding them - a CSS file is pretty much a config file anyway.

Or running a script as a cron job that updates the CSS once a day from the
config file.

Of neither of those are acceptable... CSS files don't actually have to end
with .css.

Rename your *.css file to *.php, and add a



line at the top of the file. If you go this route, make sure you've got your
caching headers set up correctly - if the browser comes back for the CSS
file every single time, you've defeated the object of having it.

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



Re: [PHP] File read and sort question

2003-10-06 Thread Marek Kilimajer
Susan Ator wrote:
I have no control over

1) file naming
2) file inclusion in the directory
3) file removal from the directory
This is all being handled through another program written in C.

So far I have been able to put the relevant info from each file into the
database then display with a simple order by.
Now, I'm attempting to get the correct flow for checking if the file is in
the database but not in the directory so I can delete it from the database.
Trial and error.
Susan
You have 2 possibilities:
- empty the daabase before (or after) each run
- create an index on RELEASE_DATE and RELEASE_TIME and use REPLACE, but 
RELEASE_DATE and RELEASE_TIME must be unique

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


RE: [PHP] PHP & CSS

2003-10-06 Thread Jay Blanchard
[snip]
This is a question as to how I would apply variables from an ini file to
the file called in the
manner you so nicely explained to me.
[/snip]

Using fopen() you would then write the variables to the CSS file. As
long as you fclose the CSS file before you get to the link rel in the
HTML you'll be OK

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



Re: [PHP] Multiple attachments in an email

2003-10-06 Thread Curt Zirzow
* Thus wrote Ajay Singh ([EMAIL PROTECTED]):
> Hi,
> 
> Please guide how to send multiple attachments in one mail through php mail script. 
> The following code is working for the one attachment:

If you look at it closely you are already sending two attachements.

For a guide read and implement:
  rfc-822
  rfc-2045
  rfc-2047
  rfc-2046
  rfc-2048


Curt
-- 
List Stats: http://zirzow.dyndns.org/html/mlists/php_general/

"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Anybody know of a good web site on how to create P3P privacy policies?

2003-10-06 Thread Dan Anderson
Does anyone know of a good web site on how to create a P3P Privacy
policy?  When I googled I kept getting other people privacy policies and
proprietary tools.

Thanks in advance,

-Dan

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



Re: [PHP] Array of Classes

2003-10-06 Thread Rob Wiltbank
Cheers!  Just what I was looking for. :)

Rob
"David Otton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Mon, 6 Oct 2003 13:41:22 -0400, you wrote:
>
> >1) How can I create an array of classes so they could be referenced, for
> >instance: $array[$uniqueID][$class->var] = 10; ?
> >
> >2) Would it instantiate when that particular element was used and would
the
> >constructor run at that point?
> >
> >3) Any way to dispose/destroy of an object once it's done being used to
free
> >up the resources?
>
> 
> class A {
> function A () {
> echo ("Created");
> }
>
> function B ($s = "None") {
> echo ("input : $s");
> }
> }
>
> $C = array();
>
> for ($i = 0; $i < 3; $i++)
> {
> $C[$i] = new A();
> }
>
> for ($i = 0; $i < 3; $i++)
> {
> $C[$i]->B($i);
> }
>
> for ($i = 0; $i < 3; $i++)
> {
> unset ($C[$i]);
> }
>
> ?>

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



Re: [PHP] proc_open to return an encrypted string?

2003-10-06 Thread Curt Zirzow
* Thus wrote Robert Van Overmeiren ([EMAIL PROTECTED]):
> Hello,
> 
> I want to take a String variable and GPG encrypt it, then email the
> encrypted string.
> 
> One of our developers suggested using "proc_open" and to "set the process to
> 'gpg -a --encrypt -r 0x35E891B0'", but couldn't clarify.
> 
> How is this done? Would it be something like this...?

I'm not familiar with proc_open being that it is knew but yes the
idea is correct.

> -
> 
> $message = "Text or HTML string";
> 
> $pipes = "-a --encrypt -r 0x35E891B0";

The $pipes parameter isn't the arguments to the script but an array
that is returned with the pipe you defiend below.

> 
> $descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2
> => array("file", "/tmp/error-output.txt", "a"));

In most cases you may want your #2 stream (the error stream) to go to
a pipe back to this script. so you want

 2=> array('pipe', 'r')

> 
> $process = proc_open("gpg", $descriptorspec, $pipes);

Pass your parameters like so:
   $process = proc_open("gpg -a --encrypt ...", $descriptorspec, $pipes);
  
> 
> if (is_resource($process)) {
> fwrite($pipes[0], $message);
> fclose($pipes[0]);

Now you can check the error stream and do some error checking:
 while(!feof($pipes[2])) {
   $errors .= fgets($pipes[2], 1024);
 }
 fclose($pipes[2]);
 //... error checking stuff.

> while(!feof($pipes[1])) {
> echo fgets($pipes[1], 1024);
> }
> fclose($pipes[1]);
> $return_value = proc_close($process);
> }
> 
> send_mail($smtp_server, $smtp_port, $sender_email, $recipient_email,
> $subject, $message, $headers);
> 

I believe you need to set some headers to tell the email program
that this message is encrypted, but I might be wrong.


Curt
-- 
List Stats: http://zirzow.dyndns.org/html/mlists/php_general/

"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Anybody know of a good web site on how to create P3P privacy policies?

2003-10-06 Thread Chris Shiflett
--- Dan Anderson <[EMAIL PROTECTED]> wrote:
> Does anyone know of a good web site on how to create a P3P Privacy
> policy?

Here are the two URLs I find most helpful:

1. http://www.w3.org/P3P/develop.html - This page is specifically for
developers and gives you the information you need to be considered
P3P-compliant.
2. http://www.w3.org/P3P/validator.html - This page will validate your policy
file or you entire site for compliance.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] timeout question

2003-10-06 Thread David Coleman
I have a PHP page that for some reason is taking an ungodly long time to
execute.  I suspect that this is simply b/c I’m running Apache 1.3 /
MySQL 4.013-nt, PHP 4, Zend studio 3.0, and MySQL GUI on a 266 MhZ win2K
server.  (Yes people, I know I’m choking the poor thing, but I can’t
afford a new server right now.)
 
My question to the group is:
 
Does anyone know how I can increase my timeouts on page generation?
Halfway through the rowset, the page stops generating and returns to the
browser cut off at whatever point the server (apache, PHP or MySQL, I
dunno which) gave up and decided the page was taking too long.  It seems
to be a 90 second html response timeout imbedded somewhere in my
configuration, but I have no idea where to look to change this value to
unlimited, or maybe to 600 seconds or something more reasonable for the
hideous rowsets that my project is dealing with.
 
I don’t know if this is a PHP question, but I’m trying PHP, Apache, and
MySQL in case there is a cursor timeout or something…
 
Anyone feel like sharing some nifty tricks to help me tweak my
performance?  I don’t care if the page takes 10 hours to generate, I’m
on a local secure network and I want my connections open that long. (I’d
also like to know if there’s any tricks to not using cursors and loading
re-usable recordset-style objects into mysql_result variables, so I
don’t have to hit the db every time I want to re-use a loaded rowset.
But let’s get my pages to finish generating first.
 
:-)
 
Thanks a bunch everyone!
 
Dave Coleman
Software Engineer
TeraByte Software Solutions LLC
[EMAIL PROTECTED]
 


Re: [PHP] Compiled Regular Expressions?

2003-10-06 Thread Curt Zirzow
* Thus wrote Manuel Vázquez Acosta ([EMAIL PROTECTED]):
> Hi all:
> 
> I need to know if PHP compiles regular expressions. If it does so, is there
> any way to cache the compiled resource in order to speed up next calls to
> preg_* functions?

caching is built into pcre library, all your expressions are
cached. I'm not sure about POSIX regular expression.

HTH,

Curt
-- 
List Stats: http://zirzow.dyndns.org/html/mlists/php_general/

"I used to think I was indecisive, but now I'm not so sure."

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



RE: [PHP] timeout question

2003-10-06 Thread Vail, Warren
http://www.php.net/manual/en/function.set-time-limit.php

Warren Vail

-Original Message-
From: David Coleman [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 02, 2003 11:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] timeout question


I have a PHP page that for some reason is taking an ungodly long time to
execute.  I suspect that this is simply b/c I'm running Apache 1.3 /
MySQL 4.013-nt, PHP 4, Zend studio 3.0, and MySQL GUI on a 266 MhZ win2K
server.  (Yes people, I know I'm choking the poor thing, but I can't
afford a new server right now.)
 
My question to the group is:
 
Does anyone know how I can increase my timeouts on page generation?
Halfway through the rowset, the page stops generating and returns to the
browser cut off at whatever point the server (apache, PHP or MySQL, I
dunno which) gave up and decided the page was taking too long.  It seems
to be a 90 second html response timeout imbedded somewhere in my
configuration, but I have no idea where to look to change this value to
unlimited, or maybe to 600 seconds or something more reasonable for the
hideous rowsets that my project is dealing with.
 
I don't know if this is a PHP question, but I'm trying PHP, Apache, and
MySQL in case there is a cursor timeout or something...
 
Anyone feel like sharing some nifty tricks to help me tweak my
performance?  I don't care if the page takes 10 hours to generate, I'm
on a local secure network and I want my connections open that long. (I'd
also like to know if there's any tricks to not using cursors and loading
re-usable recordset-style objects into mysql_result variables, so I
don't have to hit the db every time I want to re-use a loaded rowset.
But let's get my pages to finish generating first.
 
:-)
 
Thanks a bunch everyone!
 
Dave Coleman
Software Engineer
TeraByte Software Solutions LLC
[EMAIL PROTECTED]
 

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



Re: [PHP] php5 and possible oop features/questions

2003-10-06 Thread Marek Kilimajer
Tit "Black" Petric wrote:
will something in the likes of this be possible in php5?

/***/

class some_classname
{
function some_function();
}
function some_classname::some_function($prefix, $text) {
return $prefix.": ".$text."\n";
}
$test = new some_classname;
$test->some_function("Output","Hello World!");
This is not necessery in php. As I know C++ has this feature but only so 
the class definition can be separated from its implementation. 
Definition goes to a header file so it can be included in other .cpp 
files in the same project.

Marek

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


Re: [PHP] timeout question

2003-10-06 Thread Curt Zirzow
* Thus wrote David Coleman ([EMAIL PROTECTED]):
> I have a PHP page that for some reason is taking an ungodly long time to
> execute.  I suspect that this is simply b/c I’m running Apache 1.3 /
> MySQL 4.013-nt, PHP 4, Zend studio 3.0, and MySQL GUI on a 266 MhZ win2K
> server.  (Yes people, I know I’m choking the poor thing, but I can’t
> afford a new server right now.)
>  
> My question to the group is:
>  
> Does anyone know how I can increase my timeouts on page generation?
> Halfway through the rowset, the page stops generating and returns to the
> browser cut off at whatever point the server (apache, PHP or MySQL, I
> dunno which) gave up and decided the page was taking too long.  It seems
> to be a 90 second html response timeout imbedded somewhere in my
> configuration, but I have no idea where to look to change this value to
> unlimited, or maybe to 600 seconds or something more reasonable for the
> hideous rowsets that my project is dealing with.
SEE:

In your php.ini:
  max_execution_time = 30; ;default value

Apache conf:
  Timeout 300  #default value in seconds
  
  
Curt
-- 
List Stats: http://zirzow.dyndns.org/html/mlists/php_general/

"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: functions using other functions inside of classes?

2003-10-06 Thread Kirk Babb
I'm reading up on OO and PHP, so I'll retract the previous question until I
can ask something better.  Just ignore it.

Thanks,
Kirk

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



Re: [PHP] php5 and possible oop features/questions

2003-10-06 Thread Tit \"Black\" Petric
yeah i know, php5 would benefit greatly from something like this

the problem with php in general is that you cant seperate a class over
multiple files (as you must have one file with the class sometimes quite
big, over 50kb)

i guess you can split it someways with the implements feature, having a
class implementing multiple ones, but its not very dynamic. for a scripting
engine the new OOP stuff seems just a bit too static to enjoy.

extending arbitary classes dynamically would be a nice option, but so far
its just static, which may proove to be a bit of a problem, since the php
dev's think java is the way to go, but java just like any other language
needs to be compiled to bytecode only once, php on the fly. why not think
more out of the box, like andrei did with aggregate in php4?

it may proove useful, only extending a class with the functions you wish
depending on arbitary inputs over http or databases or whatnot, think of a
modular system where you only need 1 classname from 5 beeing
extended/implemented, having such features would benefit overall execution
of the code, since you could "hack" a complete system with only the
components you need instead of all of them, in the end splitting class
definition and class members in different files, making it easier to write
documentation and also helping the overall managebility of the code itself -
why search for a function in a 80kb class file when you can select a file
only applying to the function scope, and then search that, much smaller
file.

in general scope the following is what i learned with php in the last 3
years i've been developing with it:

OOP lacks dynamic patterns - in general it's a step back with what you could
do with it, php5's oop support is just laugable.
(i mean, what is it with the __constructor() and __destructor()? whats wrong
with classname() and ~classname() ? and the different naming conventions?
all_i_want() getMeSomeIcecream() - pick one or both, and stick with it)
the more code files you use with a project, the more likely it is that your
project will preform slowly.. including one huge file is faster than 5 small
ones
huge files dont do anything for code management, more time you are searching
for the function itself, than acctually coding new stuff

sometime you have to decide what do you like better, clean code which is
inneficient, or dirty code which is efficient, staying in the middle with
the existing OOP syntax takes a lot of work, and you cant please everyone.

personally i preffer clean & efficient, but you really cant win if you have
to include every class of a bigger OOP project, instead of just the ones you
need to be loaded..

i consider spawning lots of instances of "needed" objects and using them
from others et cetera just as bad/good as not using oop at all. you dont use
OOP untill you acctually use classes for more than just embedding functions
into them.

i hope i make sense?

- Original Message - 
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Tit "Black" Petric" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, October 06, 2003 7:36 PM
Subject: Re: [PHP] php5 and possible oop features/questions


> Tit "Black" Petric wrote:
> > will something in the likes of this be possible in php5?
> >
> > /***/
> >
> > class some_classname
> > {
> > function some_function();
> > }
> >
> > function some_classname::some_function($prefix, $text) {
> > return $prefix.": ".$text."\n";
> > }
> >
> > $test = new some_classname;
> > $test->some_function("Output","Hello World!");
> >
>
> This is not necessery in php. As I know C++ has this feature but only so
> the class definition can be separated from its implementation.
> Definition goes to a header file so it can be included in other .cpp
> files in the same project.
>
> Marek
>
>

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



Re: [PHP] .htaccess - Still asking for login information although already sent through address bar

2003-10-06 Thread PHP Webmaster

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tuesday 07 October 2003 00:32, PHP Webmaster wrote:
>
> > If I use my login form, the login box pops up only once. If I copy the
text
> > from the address bar (generated by the form) and paste it into the
address
> > bar (after restarting the browser) the logon box does not appear.
>
> Perhaps you could show some code?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> A reverend wanted to telephone another reverend.  He told the operator,
> "This is a parson to parson call."
> */

Sure,

This is the code for the login form: (login_form.html)



Control Panel Login



Domain Name: 
Username: 
Password: 





This is the code for the login processor file: (login_process.php)

Error:One or more form fields have been left
blank.";
 echo "Please use your browsers' back button and fill in all form
fields.";
 exit;
 }
 else {
 $redirect_url = "https://"; . $username . ":" . $password . "@" . $domain .
":2083/frontend/x/index.html";
 header("Location: $redirect_url");
 exit;
 }
}
else {
header("Location: login_form.html");
exit;
}

?>

I know that there is no username/password validation code inside the
login_process.php file, but this is not my priority at the moment.

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



Re: [PHP] php5 and possible oop features/questions

2003-10-06 Thread Marek Kilimajer
In this case you will benefit from the new _call() interceptor method:

class Dynamic {

	_call($methodName, $parameters) {
		/* detect what method name is to be used and get its implementation 
from a file or a database */
	}
}

Tit "Black" Petric wrote:
yeah i know, php5 would benefit greatly from something like this

the problem with php in general is that you cant seperate a class over
multiple files (as you must have one file with the class sometimes quite
big, over 50kb)
i guess you can split it someways with the implements feature, having a
class implementing multiple ones, but its not very dynamic. for a scripting
engine the new OOP stuff seems just a bit too static to enjoy.
extending arbitary classes dynamically would be a nice option, but so far
its just static, which may proove to be a bit of a problem, since the php
dev's think java is the way to go, but java just like any other language
needs to be compiled to bytecode only once, php on the fly. why not think
more out of the box, like andrei did with aggregate in php4?
it may proove useful, only extending a class with the functions you wish
depending on arbitary inputs over http or databases or whatnot, think of a
modular system where you only need 1 classname from 5 beeing
extended/implemented, having such features would benefit overall execution
of the code, since you could "hack" a complete system with only the
components you need instead of all of them, in the end splitting class
definition and class members in different files, making it easier to write
documentation and also helping the overall managebility of the code itself -
why search for a function in a 80kb class file when you can select a file
only applying to the function scope, and then search that, much smaller
file.
in general scope the following is what i learned with php in the last 3
years i've been developing with it:
OOP lacks dynamic patterns - in general it's a step back with what you could
do with it, php5's oop support is just laugable.
(i mean, what is it with the __constructor() and __destructor()? whats wrong
with classname() and ~classname() ? and the different naming conventions?
all_i_want() getMeSomeIcecream() - pick one or both, and stick with it)
the more code files you use with a project, the more likely it is that your
project will preform slowly.. including one huge file is faster than 5 small
ones
huge files dont do anything for code management, more time you are searching
for the function itself, than acctually coding new stuff
sometime you have to decide what do you like better, clean code which is
inneficient, or dirty code which is efficient, staying in the middle with
the existing OOP syntax takes a lot of work, and you cant please everyone.
personally i preffer clean & efficient, but you really cant win if you have
to include every class of a bigger OOP project, instead of just the ones you
need to be loaded..
i consider spawning lots of instances of "needed" objects and using them
from others et cetera just as bad/good as not using oop at all. you dont use
OOP untill you acctually use classes for more than just embedding functions
into them.
i hope i make sense?

- Original Message - 
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Tit "Black" Petric" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, October 06, 2003 7:36 PM
Subject: Re: [PHP] php5 and possible oop features/questions



Tit "Black" Petric wrote:

will something in the likes of this be possible in php5?

/***/

class some_classname
{
   function some_function();
}
function some_classname::some_function($prefix, $text) {
   return $prefix.": ".$text."\n";
}
$test = new some_classname;
$test->some_function("Output","Hello World!");
This is not necessery in php. As I know C++ has this feature but only so
the class definition can be separated from its implementation.
Definition goes to a header file so it can be included in other .cpp
files in the same project.
Marek






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


[PHP] Any idea how to do this?

2003-10-06 Thread Ryan A
Hi,
Sometime back I used to visit this URL:
http://www.groundbreak.com/graphics.html
to make the graphics for some products as it was easy to use and give pretty
decent results, but now i see that the owner has converted it into a paysite
and is asking for a whopping 200$ per membership :-(

So I have decided that I am going to try to make the same thing on our site
but offer it free to the public...only problem is...I dont know where to
start and was hopeing someone here can give me tips/urls or links to boost
me on my way...

Any help appreciated thanks in advance.

Cheers,
-Ryan

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



Re: [PHP] Any idea how to do this?

2003-10-06 Thread CPT John W. Holmes
From: "Ryan A" <[EMAIL PROTECTED]>

> Sometime back I used to visit this URL:
> http://www.groundbreak.com/graphics.html
> to make the graphics for some products as it was easy to use and give
pretty
> decent results, but now i see that the owner has converted it into a
paysite
> and is asking for a whopping 200$ per membership :-(
>
> So I have decided that I am going to try to make the same thing on our
site
> but offer it free to the public...only problem is...I dont know where to
> start and was hopeing someone here can give me tips/urls or links to boost
> me on my way...

I've also come across a site called www.google.com. Can anyone tell me how
to make that for my site, also? If you can just send me the script, that'd
be great.

---John Holmes...

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



Re: [PHP] php5 and possible oop features/questions

2003-10-06 Thread Curt Zirzow
* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
> In this case you will benefit from the new _call() interceptor method:
> 
> class Dynamic {
> 
>   _call($methodName, $parameters) {
>   /* detect what method name is to be used and get its 
>   implementation from a file or a database */
>   }
> }

Time to figure out what this thing goes: .05
Time to implement what it found out: .03

Very expensive for a web app, and would strongly discourage this for
a web app.  maybe for a gui audio player I could understand this
overhead.



Curt
-- 
List Stats: http://zirzow.dyndns.org/html/mlists/php_general/

"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Any idea how to do this?

2003-10-06 Thread Chris Shiflett
--- "CPT John W. Holmes" <[EMAIL PROTECTED]> wrote:
> I've also come across a site called www.google.com. Can anyone tell
> me how to make that for my site, also? If you can just send me the
> script, that'd be great.

Here you go:

http://www.google.com/";>
http://www.google.com/'); ?>

:-)

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] include() problems

2003-10-06 Thread Burhan Khalid
Gustave Bernier wrote:

I'm new to PHP and I'm trying to use the include function but with no 
success... My server's ini file is  set as (allow_url_fopen, 0) so I'm 
having some trouble to pass different values for the php file I'm 
calling. The address is: http://mydomain.com/forums/ssi.php?a=active

The code I'm trying now is:
$_GET['a'] = 'active';
include('forums/ssi.php');
Well, since everyone has commented on the including-same-file idea, 
might I point that this : $_GET['a'] = 'active'; looks a bit strange.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com

Tip : In your replies, please trim out the signature of
person you are replying to. No need to see the same
disclaimer 5 times. Leads to bloat.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Any idea how to do this?

2003-10-06 Thread Ryan A
HEHEHEHE good one Chris, John seems unusally snappy today...
But seriously, this cant be ALL that hard, not even a suggestion of where to
start?
I have searched on google but have never really tried any of php's image
stuff so need help from someone who has...or atleast a starting point.

Cheers,
-Ryan




> > I've also come across a site called www.google.com. Can anyone tell
> > me how to make that for my site, also? If you can just send me the
> > script, that'd be great.
>
> Here you go:
>
> http://www.google.com/";>
> http://www.google.com/'); ?>
>
> :-)
>
> Chris
>
> =
> My Blog
>  http://shiflett.org/
> HTTP Developer's Handbook
>  http://httphandbook.org/
> RAMP Training Courses
>  http://www.nyphp.org/ramp
>
> -- 
> 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 and possible oop features/questions

2003-10-06 Thread Tit \"Black\" Petric
one small stone in a pond of stones, but what this pond needs is a bridge to
an island in the middle.

From: "Marek Kilimajer" <[EMAIL PROTECTED]>
> In this case you will benefit from the new _call() interceptor method:
>
> class Dynamic {
>
> _call($methodName, $parameters) {
> /* detect what method name is to be used and get its implementation
> from a file or a database */
> }
> }
>
> Tit "Black" Petric wrote:
> > yeah i know, php5 would benefit greatly from something like this
> >
> > the problem with php in general is that you cant seperate a class over
> > multiple files (as you must have one file with the class sometimes quite
> > big, over 50kb)
> >
> > i guess you can split it someways with the implements feature, having a
> > class implementing multiple ones, but its not very dynamic. for a
scripting
> > engine the new OOP stuff seems just a bit too static to enjoy.
> >
> > extending arbitary classes dynamically would be a nice option, but so
far
> > its just static, which may proove to be a bit of a problem, since the
php
> > dev's think java is the way to go, but java just like any other language
> > needs to be compiled to bytecode only once, php on the fly. why not
think
> > more out of the box, like andrei did with aggregate in php4?
> >
> > it may proove useful, only extending a class with the functions you wish
> > depending on arbitary inputs over http or databases or whatnot, think of
a
> > modular system where you only need 1 classname from 5 beeing
> > extended/implemented, having such features would benefit overall
execution
> > of the code, since you could "hack" a complete system with only the
> > components you need instead of all of them, in the end splitting class
> > definition and class members in different files, making it easier to
write
> > documentation and also helping the overall managebility of the code
itself -
> > why search for a function in a 80kb class file when you can select a
file
> > only applying to the function scope, and then search that, much smaller
> > file.
> >
> > in general scope the following is what i learned with php in the last 3
> > years i've been developing with it:
> >
> > OOP lacks dynamic patterns - in general it's a step back with what you
could
> > do with it, php5's oop support is just laugable.
> > (i mean, what is it with the __constructor() and __destructor()? whats
wrong
> > with classname() and ~classname() ? and the different naming
conventions?
> > all_i_want() getMeSomeIcecream() - pick one or both, and stick with it)
> > the more code files you use with a project, the more likely it is that
your
> > project will preform slowly.. including one huge file is faster than 5
small
> > ones
> > huge files dont do anything for code management, more time you are
searching
> > for the function itself, than acctually coding new stuff
> >
> > sometime you have to decide what do you like better, clean code which is
> > inneficient, or dirty code which is efficient, staying in the middle
with
> > the existing OOP syntax takes a lot of work, and you cant please
everyone.
> >
> > personally i preffer clean & efficient, but you really cant win if you
have
> > to include every class of a bigger OOP project, instead of just the ones
you
> > need to be loaded..
> >
> > i consider spawning lots of instances of "needed" objects and using them
> > from others et cetera just as bad/good as not using oop at all. you dont
use
> > OOP untill you acctually use classes for more than just embedding
functions
> > into them.
> >
> > i hope i make sense?
> >
> > - Original Message - 
> > From: "Marek Kilimajer" <[EMAIL PROTECTED]>
> > To: "Tit "Black" Petric" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Monday, October 06, 2003 7:36 PM
> > Subject: Re: [PHP] php5 and possible oop features/questions
> >
> >
> >
> >>Tit "Black" Petric wrote:
> >>
> >>>will something in the likes of this be possible in php5?
> >>>
> >>>/***/
> >>>
> >>>class some_classname
> >>>{
> >>>function some_function();
> >>>}
> >>>
> >>>function some_classname::some_function($prefix, $text) {
> >>>return $prefix.": ".$text."\n";
> >>>}
> >>>
> >>>$test = new some_classname;
> >>>$test->some_function("Output","Hello World!");
> >>>
> >>
> >>This is not necessery in php. As I know C++ has this feature but only so
> >>the class definition can be separated from its implementation.
> >>Definition goes to a header file so it can be included in other .cpp
> >>files in the same project.
> >>
> >>Marek
> >>
> >>
> >
> >
> >
> >
>
>

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



RE: [PHP] Any idea how to do this?

2003-10-06 Thread Chris W. Parker
Ryan A 
on Monday, October 06, 2003 1:34 PM said:

> HEHEHEHE good one Chris, John seems unusally snappy today...
> But seriously, this cant be ALL that hard, not even a suggestion of
> where to start?
> I have searched on google but have never really tried any of php's
> image stuff so need help from someone who has...or atleast a starting
> point. 

php's gd lib is what you want, me thinks.



c.

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



Re: [PHP] File read and sort question

2003-10-06 Thread Burhan Khalid
Susan Ator wrote:

I have no control over

1) file naming
2) file inclusion in the directory
3) file removal from the directory
This is all being handled through another program written in C.
Hrmm what can you do to the files? If this is a linux system, you can 
write a shell script that will do this sort of thing for you, and spit 
the contents out in another directory. Kinda overheadish too, but 
atleast its something different than "database, database, database" ... 
which to be frank, is what I would have said also.

You can create a small script that will quite simply ... do what your 
php script does, but at an interval. You can then take the delay out of 
the the php script, and just run a cron job that repeats the script.

Something tells me a that PERL or even some fancy shell scripting 
trickery would be faster than doing it from php, but I couldn't give you 
a factual calculation of execution times.

Just the thoughts of someone that obviously is lacking in sleep.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] null character - file related function

2003-10-06 Thread Burhan Khalid
Curt Zirzow wrote:

Some functions are documented as binary safe, i'm not entirely sure
what php's policy is on noting if a function is binary safe or not.
I believe for some, it states in the manual. Something like "this 
function became binary safe as of PHP version ___".

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Any idea how to do this?

2003-10-06 Thread Paul van Schayck
Hello,

[EMAIL PROTECTED] (Ryan A) wrote in
> So I have decided that I am going to try to make the same thing on our
> site but offer it free to the public...only problem is...I dont know
> where to start and was hopeing someone here can give me tips/urls or
> links to boost me on my way...

You know PHP? Take a look at the image functions:
http://www.php.net/manual/en/ref.image.php

You can do all sort of things with images.

Polleke

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



  1   2   >