Re: [PHP] PNGs & PHP feedback

2003-09-30 Thread Eugene Lee
On Tue, Sep 30, 2003 at 02:40:42AM -0400, Joe Harman wrote:
: 
: I am looking for some guidance... I am using PHP to make dynamic
: buttons... Is the PNG image format a pretty safe thing to go with...
: Standard wise?

PNG support in M$ IE is still shaky.

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



Re: [PHP] captcha WAS Please visit my php program

2003-09-30 Thread Veniamin Goldin
Do somebody has any snipet for this stuff ?

- Original Message -
From: "Ryan A" <[EMAIL PROTECTED]>
To: "Chris W. Parker" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, September 30, 2003 1:46 AM
Subject: Re: [PHP] captcha WAS Please visit my php program


> Hey,
>
> /*
> Exactly what is the purpose of this? Let me clarify. I know that it's
> supposed to prevent computers from submitting forms automatically
> because they cannot read the graphic, but what I don't understand is in
> what cases this is useful?
> */
> Its more of a hassle and requires the entity who is submitting the form to
> be human as computers cant 100% be sure of whats in the picture, they cant
> "see" it 100% of the time even with todays OCR technoligy while humans can
> make it out in a fraction of a second...mostly.
>
> /*
> And specifically Ryan, where will you be using this?
> */
> Am using this on a voteing form at bestwebhosters.com which will be opened
> in 2-5 days.
> This idea was suggested to me by a few guys on this very list...the first
> names that come to mind are john & chris.
>
> /*
> I'm trying to gauge whether or not this would be worthwhile for a
> project I'm working on right now.
> */
> Ok, i like it coz it adds a bit of the "fancy" element to the same old
> boring forms but it has much more serious uses of course.
>
> /*
> Thanks,
> Chris.
> */
>
> No problem, tell me if you have any more q's although my replies may be a
> little long in the coming.
>
> HTH.
>
> Cheers,
> -Ryan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

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



[PHP] function mail()

2003-09-30 Thread hiaer
I use mail() function in php, but there's no living mail from my system.
MUST be mail() function turn on in some special place (ini file, &...)
??

THANKS.

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



[PHP] Form Actions

2003-09-30 Thread Shaun
Hi,

I have a number of forms on my site, and each form can be accessed from a
number of different pages. Can anyone suggest a way I can monitor this so
that when the submit button is pressed the user is returned to the page they
were on before. This is also complicated by the fact that I have a system
that returns the user to the same page if there are errors on the form...

Thanks for your help

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



RE: [PHP] How many Mondays in a month?

2003-09-30 Thread Greg Wiley
> -Original Message-
> From: Cristian Lavaque [mailto:[EMAIL PROTECTED] 
> 
> You could also put the input values in dropdown menus, at 
> least day and month. That way you make sure the input to the 
> funtion is correct everytime.
> 

The code is just a function it's not a "page" in itself. I use it
in a form that display checkboxes for each Sunday in a month.
Someone else may use it by providing the arguments via a form in
the manner you suggest. The function, however, is just that, a
function.

Cheers, Greg.
-- 
Greg Wiley
http://wileysworld.org/ 



Mail was checked for spam by the Freeware Edition of No Spam Today!
The Freeware Edition is free for personal and non-commercial use.
You can remove this notice by purchasing a full license! To order
or to find out more please visit: http://www.no-spam-today.com


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



RE: [PHP] Form Actions

2003-09-30 Thread Greg Wiley
> -Original Message-
> From: Shaun [mailto:[EMAIL PROTECTED] 
>
> Hi,
> 
> I have a number of forms on my site, and each form can be 
> accessed from a number of different pages. Can anyone suggest 
> a way I can monitor this so that when the submit button is 
> pressed the user is returned to the page they were on before. 
> This is also complicated by the fact that I have a system 
> that returns the user to the same page if there are errors on 
> the form...
> 
I do this by passing a hidden value in the post. The value can
identify anything you like, on mine it identifies the domain the
form was submitted from (though thinking about this now I can do
this without a hidden value, but you get the idea!).

The problem with this is that it means you have to have a separate
copy of each form unless you can construct the hidden input value
using other variables.

Cheers, Greg.
-- 
Greg Wiley
http://wileysworld.org/ 



Mail was checked for spam by the Freeware Edition of No Spam Today!
The Freeware Edition is free for personal and non-commercial use.
You can remove this notice by purchasing a full license! To order
or to find out more please visit: http://www.no-spam-today.com

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



Re: [PHP] date() is hours behind

2003-09-30 Thread PHP Webmaster

"Jon Kriek" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well I meant just
>
> putenv('TZ=US/Eastern');
>
> But you get the idea.
>
> --
> Jon Kriek
> http://phpfreaks.com
>
> "Jon Kriek" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > See the putenv() function. For example to get the correct Eastern
Standard
> > Time
> >
> > http://www.php.net/putenv
> >
> >  > putenv('TZ=US/Eastern');
> > echo 'Last modified: ' . date('d/m/y H:i', getlastmod());
> > ?>
> >
> > --
> > Jon Kriek
> > http://phpfreaks.com
> >
> > "Php Webmaster" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Hi all,
> > >
> > > I currently use:
> > >
> > > date("l jS F Y, g:i A");
> > >
> > > To format the current date/time to my personal preference.
> > >
> > > However, at 12:19 AM on my machine, date("l jS F Y, g:i A"); shows
> > 4:19PM...
> > > 8 hours slow :(
> > >
> > > Any ideas on how to correct this? Am I right in saying that there is a
> > > timezone problem?
> > >
> > > Any ideas appreciated.

I'm in London and and my timezone is GMT, so what should I use?

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



RE: [PHP] $_SESSION stuffs that come with php.ini

2003-09-30 Thread esctoday.com | Wouter van Vliet
Hmm .. I haven't been on the list for a while so it took me some time to
answer ;).. Anyways, what I believe is a possible cause for your problem is
that there simply ain't no session started. Maybe the "always start session
before the php page request" setting was On if not configured, but is now
Off in your ini file.

783 ; Initialize session on request startup.
784 session.auto_start = 0

Might wants to be changed to

783 ; Initialize session on request startup.
784 session.auto_start = 1 

Also check this one

773 ; Whether to use cookies.
774 session.use_cookies = 1

In combination with

850 ; trans sid support is disabled by default.
851 ; Use of trans sid may risk your users security.
852 ; Use this option with caution.
853 ; - User may send URL contains active session ID
854 ;   to other person via. email/irc/etc.
855 ; - URL that contains active session ID may be stored
856 ;   in publically accessible computer.
857 ; - User may access your site with the same session ID
858 ;   always using URL stored in browser's history or bookmarks.
859 session.use_trans_sid = 0

If both are set to "0", sessions simply won't work since PHP cannot know
about the session id. If session.use_cookies is enabled, and
session.use_trans_sid is not than you should have Cookies enabled in your
browser for sessions to work. 

Or if you're on Windows, pay special attention to

771 session.save_path = /tmp

Which should then be changed to smth like c:\temp

That's pretty much what I can say about it .. If neither of those work, just
read the entire [Session] section in the php.ini file.

Wouter

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 26, 2003 9:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] $_SESSION stuffs that come with php.ini

I have been building the website for 6 months with everything and I didn't
have hte php.ini on it.  Just didn't realize it, so I create the php.ini
that come from php.ini_dist that came with php source code.  Now the
$_SESSION doesn't work.  I'm not able to make the php.ini to be like the one
that php work without it.  So, anyone know what is the default session
configuration?

Thanks...

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

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



[PHP] Output data repeatedly more than once

2003-09-30 Thread irinchiang


Hi all, 
   I am creating a simple receipt system whereby user will enter relevant
info   
via a text form and using echo method to output and print the receipt data. I've
used CSS as the front-end . My question is, is it possible to output the receipt
information more than once on a single page (Browser) as I would need to
print out the receipt thrice for the different department as required.

Regards, 
Irin

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



RE: [PHP] Checking mail with `mail`

2003-09-30 Thread esctoday.com | Wouter van Vliet
By advising you something like this

  2  '.$Line."\n";
  7 };
  8 ?>

Would I apply for the bonus points? It would generate output similar to

> Mail version 8.1 6/6/93.  Type ? for help.
> "/var/spool/mail/wouter": 6 messages 6 unread
> >U  1 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
>  U  2 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
>  U  3 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
>  U  4 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
>  U  5 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
>  U  6 [EMAIL PROTECTED]  Tue Sep 30 11:17  24/786   "test"
> Message 1:
> From [EMAIL PROTECTED]  Tue Sep 30 11:17:32 2003
> Date: Tue, 30 Sep 2003 11:17:31 +0200
> From: Wouter van Vliet <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: test
>
> #!/usr/bin/php -q
>  exec('echo "p 1" | mail', $Lines);
>
> foreach($Lines as $Line) {
>   print '> '.$Line."\n";
> };
> ?>
>
> Saved 1 message in mbox
> Held 5 messages in /var/spool/mail/wouter 

(in this test, I mailed the contents of my script to myself)

Hope it helps ya,
Wouter

-Original Message-
From: Dan Phiffer [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 26, 2003 1:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Checking mail with `mail`

Is it practical to check for new mail from PHP using the UNIX mail utility?
This would mainly be used to check for bounces from large mailings. Bonus
points for anyone who can find me an article explaining the technique.

Thanks!
-Dan

-- 
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] Page cannot be displayed

2003-09-30 Thread Olivier Simah
Hi,
I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
Windows XP.
When I try to see a HTML pages, everything is ok but when it comes to PHP
pages nothing works
I have this message with IE : "The page cannot be displayed"
with Opera 7, Mozilla : nothing

HELP

Thanks
Olivier

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



Re: [PHP] Page cannot be displayed

2003-09-30 Thread Martin Clarke
On Tue, Sep 30, 2003 at 11:56:23AM +0200, Olivier Simah wrote:
> Hi,
> I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
> Windows XP.
> When I try to see a HTML pages, everything is ok but when it comes to PHP
> pages nothing works
> I have this message with IE : "The page cannot be displayed"
> with Opera 7, Mozilla : nothing
> 
anything useful in the apache logs? (error.log?) ?

Martin.


-- 
"Real Programmers don't document -
if it was hard to write is should
be hard to understand.."

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



Re: [PHP] captcha WAS Please visit my php program

2003-09-30 Thread David T-G
Hi, all --

...and then Ryan A said...
% 
% Hey,

Hiya!


% 
% /*
% Exactly what is the purpose of this? Let me clarify. I know that it's
...
% */
% Its more of a hassle and requires the entity who is submitting the form to

A hassle is right.  What about your visitors who use a text-only browser
(or surf with images turned off) or who depend on text-to-speech readers?

This sort of thing is, IMNSHO, unnecessary and the wrong approach; it
makes the web harder to use without making it a safer place.  The form
should be designed correctly and safely in the first place.  We don't use
this sort of approach to prevent buffer overflow attacks and it shouldn't
be used anywhere else, either.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Page cannot be displayed

2003-09-30 Thread Olivier Simah
The problem is that I do not have the log right now, I send you an answer
tonight
Thanks

"Martin Clarke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, Sep 30, 2003 at 11:56:23AM +0200, Olivier Simah wrote:
> > Hi,
> > I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
> > Windows XP.
> > When I try to see a HTML pages, everything is ok but when it comes to
PHP
> > pages nothing works
> > I have this message with IE : "The page cannot be displayed"
> > with Opera 7, Mozilla : nothing
> >
> anything useful in the apache logs? (error.log?) ?
>
> Martin.
>
>
> -- 
> "Real Programmers don't document -
> if it was hard to write is should
> be hard to understand.."

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



[PHP] PHP Imagemagick

2003-09-30 Thread Cameron Metzke
i have a script where people upload an image it is then renamed and is
supposed to be cripped according to the values they submit but i cant seem
to get it to crop it uploads and is renamed fine though. also i wish to use
a static name so when another picture is uploaded the old one is overwritten
that is why the input path and output path is the same.
-Code--
exec($path_imagemagick."convert -crop 0x100+0+0 $imagepath.$filename
$imagepath.$filename");
-End Code--
any ideas why this wont work?

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



Re: [PHP] PHP Imagemagick

2003-09-30 Thread David T-G
Cameron --

...and then Cameron Metzke said...
% 
...
% a static name so when another picture is uploaded the old one is overwritten
% that is why the input path and output path is the same.
% -Code--
% exec($path_imagemagick."convert -crop 0x100+0+0 $imagepath.$filename
% $imagepath.$filename");
% -End Code--

To change an image rather than make a new version of it, just use
mogrify.


% any ideas why this wont work?

Start there and let us know how you do.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] Sending parameters

2003-09-30 Thread Shaun
Hi,

I need to send the following link

view_day.php?mysql_date=2003-09-23&user_id=35&set_form_actions=true&new_user
=yes&user_name=Kate%20Dickie&link_text=diary&link_action=availability.php?ne
w_user=yes&user_name=Kate%20Dickie.

This may seem strange that I have 2 ?'s in the link but the point here is
that I need everything after the 2nd ? to be used as a link on the following
page - which is actually held in a session.

However when I try to do this, the link_action held is
'availability.php?new_user=yes', how can I get everything after the 2nd ? to
be held in the session var?

Thanks for your help

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



[PHP] Re: regexp: 'a correctly parenthesized substring advanced'

2003-09-30 Thread Jaaboo
I give an wrong example. Here is a better one

.*?)|

.*?(?R)*

)

\)

)+

/x

', $txt, $m)){

print_r($m);

} else {

echo "no match";

}

echo "\n";



?>

This must result in :

First call: func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))
Second call with the inner part $par1," 100 (euro)", func2($par2,"(c) by
nobody")
must result in : func2($par2,"(c) by nobody")



Please visit www.regexp.org there is an open thread of this question.

thanx

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



Re: [PHP] download queue

2003-09-30 Thread Marek Kilimajer
I would do it this way. Output your files and update bandwith usage:

while($out=fread($file, 4096)) {
	echo $out;
	UPDATE bandwith_usage SET bandwith_usage = bandwith_usage+1 WHERE 
second = UNIX_TIMESTAMP() LIMIT 1
	if(mysql_affected_rows()==0) { // if this is the first output in this 
second
		INSERT bandwith_usage SET bandwith_usage = 1, second = UNIX_TIMESTAMP()
	}
}

When you are about to start a download, check the bandwith usage first, 
in this case for the last minute:

SELECT AVG(bandwith_usage) usage FROM bandwith_usage WHERE second > 
UNIX_TIMESTAMP() - 60

usage * 4096 gives you usage in bytes per second. If it exceeds your 
limit, output a html page (sorry...), else open the file and start the 
above loop.

You might want to change 4096 to a higher value. You should also 
implement a garbage collector that will remove old bandwith usage data, 
the collector can make usage statistics too.

Alex wrote:
I'm considering start up a small download site with the large amount of 
excess bandwith I have on my site, however I thought it would be cool to 
put some sort of download queue up (you know, so all my bandwith doesn't 
get eaten up when 500 random people suddenly decide to download a 500meg 
 file i've put up.

In any case, I'm once again to the point where I know what I want, but 
the logic of it escapes me. If anyone has ever done this before, seen 
the code behind this before, or knows basically how this would be done, 
I'd be more than happy if you would share your wisdom with me.

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


Re: [PHP] WebDAV help

2003-09-30 Thread Marek Kilimajer
http://sk.php.net/manual/en/features.file-upload.put-method.php

Oscar F wrote:

Hello all,

I'm having a problem with PHP/WebDAV. Here's my problem:

I am working on a system that keeps track of documents. The documents 
are stores based on document ids, and the filename is saved on the 
database along with the document id and file type/size, and the file is 
renamed to just the id number.

Now I need to use webdav to let user edit files as it is normally done 
with webbad, with the problem that the files have no name/extension so I 
have to recreate them with php. I created a couple of php files, that 
capture the GET, PROPFINDS, PUTs, etc. The idea is that the user opens 
the php file specifying the file id, and the php file looks up the name, 
retrieves the content of the file and sends it to the client (this is 
currently being done without problem, when the php script sees a GET, it 
looks for the file and send it). I need the php script to be able to 
capture PUT as well and when it gets one, it takes the data and saves it 
to the file that has the id. The problem is, I open the .php file and I 
get the data of the file, but when I save, my php code is replaced with 
the actual text of the file as if the file they're editing is the php file.

Any help or advise you could provide me about this would be really 
appreciated. Thanks.

O.-

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


[PHP] fsockopen()

2003-09-30 Thread Phil Ewington - 43 Plc
Hi All,

I am having problems with fsockopen() and wondered if anyone else has
encountered this behaviour. My problem is that when connecting to an invalid
domain I cannot trap the errors.

I have tried setting a variable then testing the value, which prints a
warning to the screen...

$sck_handle = fsockopen($hostname, $port, $errno, $errstr, $timeout);
if (!$sck_handle)
{
// socket could not be opened.
$http_statuscode = "Error:" . $errno . "-" . $errstr;
}
else
{
...
}

How can I get $errno & $errstr, are these for read/write errors rather than
socket initialisation? I need to know why the socket could not be opened so
I can give an appropriate error message.

TIA


Phil Ewington - Technical Director
--
43 Plc
35 Broad Street, Wokingham
Berkshire RG40 1AU
T: +44 (0)118 978 9500
F: +44 (0)118 978 4994
E: mailto:[EMAIL PROTECTED]
W: http://www.43plc.com

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



Re: [PHP] newbie about passing value

2003-09-30 Thread Marek Kilimajer
register_globals off?
What if you hardcode
$id=$_GET['id'];

??



Ben Johnson wrote:

Hi,

  Why is the product_details.php is not getting the id value properly.
In the URL it is showing id=1 with along with the correction location 
and file name. But the page is not getting displayed.



On-Special




name?> 

description?>
$price?>
[+ Add to 
cart]







  But when I hard coded the id as $id=1 in product_details.php the page 
with item displayed correctly. Please help

  I am on W2k with PHP 4.3.2, MySql and Apache 1.X

Thank you

Ben
___
Art meets Anesthesia; Shefali Weds Dr. Raman.
Rediff Matchmaker strikes another interesting match !!
Visit http://matchmaker.rediff.com?1
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Sending parameters

2003-09-30 Thread Jason Wong
On Tuesday 30 September 2003 18:20, Shaun wrote:

> I need to send the following link
>
> view_day.php?mysql_date=2003-09-23&user_id=35&set_form_actions=true&new_use
>r
> =yes&user_name=Kate%20Dickie&link_text=diary&link_action=availability.php?n
>e w_user=yes&user_name=Kate%20Dickie.
>
> This may seem strange that I have 2 ?'s in the link but the point here is
> that I need everything after the 2nd ? to be used as a link on the
> following page - which is actually held in a session.
>
> However when I try to do this, the link_action held is
> 'availability.php?new_user=yes', how can I get everything after the 2nd ?
> to be held in the session var?

urlencode() or rawurlencode() the value of 'link_action'.

-- 
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
--
/*
He thinks the Gettysburg Address is where Lincoln lived.
-- Wanda, "A Fish Called Wanda"
*/

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



Re: [PHP] download queue

2003-09-30 Thread Marek Kilimajer
25 queries a second? No problem.

But you calculations are still wrong:

500 kb/s = 62.5 kB/s
62.5 kB/s * 100 users = 6 250 MB/s
6 250 MB/s / 4 kB (4096 B) = 1562.5 queries per second
Well that's too much. At this load 4096 can be increased to 409600, the 
database load would be only 15.625 queries per second.

Nathan Taylor wrote:

Actually, correct that, 200 queries every 8 seconds! It won't just explode, it will create a mushroom cloud while it's at it!
  - Original Message - 
  From: Marek Kilimajer 
  To: Alex 
  Cc: [EMAIL PROTECTED] 
  Sent: Tuesday, September 30, 2003 6:32 AM
  Subject: Re: [PHP] download queue

  I would do it this way. Output your files and update bandwith usage:

  while($out=fread($file, 4096)) {
  echo $out;
  UPDATE bandwith_usage SET bandwith_usage = bandwith_usage+1 WHERE 
  second = UNIX_TIMESTAMP() LIMIT 1
  if(mysql_affected_rows()==0) { // if this is the first output in this 
  second
  INSERT bandwith_usage SET bandwith_usage = 1, second = UNIX_TIMESTAMP()
  }
  }

  When you are about to start a download, check the bandwith usage first, 
  in this case for the last minute:

  SELECT AVG(bandwith_usage) usage FROM bandwith_usage WHERE second > 
  UNIX_TIMESTAMP() - 60

  usage * 4096 gives you usage in bytes per second. If it exceeds your 
  limit, output a html page (sorry...), else open the file and start the 
  above loop.

  You might want to change 4096 to a higher value. You should also 
  implement a garbage collector that will remove old bandwith usage data, 
  the collector can make usage statistics too.

  Alex wrote:
  > I'm considering start up a small download site with the large amount of 
  > excess bandwith I have on my site, however I thought it would be cool to 
  > put some sort of download queue up (you know, so all my bandwith doesn't 
  > get eaten up when 500 random people suddenly decide to download a 500meg 
  >  file i've put up.
  > 
  > In any case, I'm once again to the point where I know what I want, but 
  > the logic of it escapes me. If anyone has ever done this before, seen 
  > the code behind this before, or knows basically how this would be done, 
  > I'd be more than happy if you would share your wisdom with me.
  > 

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


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


[PHP] Re: fsockopen()

2003-09-30 Thread Cameron Metzke
Ima having problems myself with this, i dont seem to get errors when
entering an invalid .com or .net name i put it down to verisign hijacking
invalid somains?? could this be your problem?
"Phil Ewington - 43 Plc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All,
>
> I am having problems with fsockopen() and wondered if anyone else has
> encountered this behaviour. My problem is that when connecting to an
invalid
> domain I cannot trap the errors.
>
> I have tried setting a variable then testing the value, which prints a
> warning to the screen...
>
> $sck_handle = fsockopen($hostname, $port, $errno, $errstr, $timeout);
> if (!$sck_handle)
> {
> // socket could not be opened.
> $http_statuscode = "Error:" . $errno . "-" . $errstr;
> }
> else
> {
> ...
> }
>
> How can I get $errno & $errstr, are these for read/write errors rather
than
> socket initialisation? I need to know why the socket could not be opened
so
> I can give an appropriate error message.
>
> TIA
>
>
> Phil Ewington - Technical Director
> --
> 43 Plc
> 35 Broad Street, Wokingham
> Berkshire RG40 1AU
> T: +44 (0)118 978 9500
> F: +44 (0)118 978 4994
> E: mailto:[EMAIL PROTECTED]
> W: http://www.43plc.com

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



Re: [PHP] Output data repeatedly more than once

2003-09-30 Thread Marek Kilimajer
Yes, you can. But would not it be smarter to increase the number of 
copies in the print dialog?

[EMAIL PROTECTED] wrote:

Hi all, 
   I am creating a simple receipt system whereby user will enter relevant
info   
via a text form and using echo method to output and print the receipt data. I've
used CSS as the front-end . My question is, is it possible to output the receipt
information more than once on a single page (Browser) as I would need to
print out the receipt thrice for the different department as required.

Regards, 
Irin

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


Re: [PHP] fsockopen()

2003-09-30 Thread Jason Wong
On Tuesday 30 September 2003 18:46, Phil Ewington - 43 Plc wrote:

> I am having problems with fsockopen() and wondered if anyone else has
> encountered this behaviour. My problem is that when connecting to an
> invalid domain I cannot trap the errors.

Have you checked that it is really an invalid domain and not simply been 
hijacked by Versign:

  http://www.techweb.com/tech/network/20030926_network

-- 
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
--
/*
H. L. Mencken's Law:
Those who can -- do.
Those who can't -- teach.

Martin's Extension:
Those who cannot teach -- administrate.
*/

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



[PHP] file_exists on different server...

2003-09-30 Thread Tristan . Pretty
I'm referencing an image on a different server, and it keeps changing 
URL's
Very odd, but t get round that, I tried...

if (file_exists("http://www.othersite.com/image_1.gif";)) {
$image_show="http://www.othersite.com/image_1.gif";;
} else {
$image_show="http://www.mysite.com/image_1.gif";;
}

but it always seems to do the else command, even though I know the file 
DOES exist...

Just for the record, this problem exists from our parent website to one of 
the subsideries, we're not referencing anything we shouldn't... ;-)

Any work arounds?

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] Change cell colour with selection from a drop down menu

2003-09-30 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote:

Hi all, 
   I would like to create a dynamic kinda "Timetable" whereby I can add,
del, and modify the data contained in each cell. Besides that, each cell in the
table should have its unique colour in which this unique colour can be modified
anytime to a different colour through an interface, most probably to be able to
change the cell colour with selection from a drop down menu. ( This is the part
where I really need some help. )How can this be done?
Technology used are: PHP & MySQL
If you don't want your users to wait for server responce each time they 
touch something, use javascript.


Blue
Red

changeColor(c) {
	var e;
	e = (document.all ? document.all.elementId : 
document.getElementById('elementId'));
	e.style.backgroundColor = c;
}

Regards, 
Irin.

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


RE: [PHP] Output data repeatedly more than once

2003-09-30 Thread Jay Blanchard
[snip]
My question is, is it possible to output the receipt information more
than once on a single page (Browser) as I would need to print out
the receipt thrice for the different department as required.
[/snip]

wrap the output in a for loop
for($i = 0; $i < 3; $i++){
output receipt
}

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



RE: [PHP] Page cannot be displayed

2003-09-30 Thread Jay Blanchard
[snip]
I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
Windows XP.
When I try to see a HTML pages, everything is ok but when it comes to
PHP
pages nothing works
I have this message with IE : "The page cannot be displayed"
with Opera 7, Mozilla : nothing
[/snip]

Did you add the php info in the httpd.conf?

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



Re: [PHP] Output data repeatedly more than once

2003-09-30 Thread Jason Wong
On Tuesday 30 September 2003 18:59, Marek Kilimajer wrote:
> Yes, you can. But would not it be smarter to increase the number of
> copies in the print dialog?

But that would be environmentally unfriendly because it uses more paper ;-)

-- 
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
--
/*
"Do you believe in intuition?"
"No, but I have a strange feeling that someday I will."
*/

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



Re: [PHP] file_exists on different server...

2003-09-30 Thread Jason Wong
On Tuesday 30 September 2003 19:00, [EMAIL PROTECTED] wrote:
> I'm referencing an image on a different server, and it keeps changing
> URL's
> Very odd, but t get round that, I tried...
>
> if (file_exists("http://www.othersite.com/image_1.gif";)) {
> $image_show="http://www.othersite.com/image_1.gif";;
> } else {
> $image_show="http://www.mysite.com/image_1.gif";;
> }
>
> but it always seems to do the else command, even though I know the file
> DOES exist...

RTFM

Try fopen() or similar instead.

-- 
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
--
/*
If you are over 80 years old and accompanied by your parents, we will
cash your check.
*/

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



Re: [PHP] file_exists on different server...

2003-09-30 Thread Tristan . Pretty
RTFM?
(Sorry, very newbie question)




Jason Wong <[EMAIL PROTECTED]> 
30/09/2003 12:26
Please respond to
[EMAIL PROTECTED]


To
[EMAIL PROTECTED]
cc

Subject
Re: [PHP] file_exists on different server...






On Tuesday 30 September 2003 19:00, [EMAIL PROTECTED] wrote:
> I'm referencing an image on a different server, and it keeps changing
> URL's
> Very odd, but t get round that, I tried...
>
> if (file_exists("http://www.othersite.com/image_1.gif";)) {
> $image_show="http://www.othersite.com/image_1.gif";;
> } else {
> $image_show="http://www.mysite.com/image_1.gif";;
> }
>
> but it always seems to do the else command, even though I know the file
> DOES exist...

RTFM

Try fopen() or similar instead.

-- 
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
--
/*
If you are over 80 years old and accompanied by your parents, we will
cash your check.
*/

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




*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] Page cannot be displayed

2003-09-30 Thread Burhan Khalid
Olivier Simah wrote:

Hi,
I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
Windows XP.
When I try to see a HTML pages, everything is ok but when it comes to PHP
pages nothing works
I have this message with IE : "The page cannot be displayed"
with Opera 7, Mozilla : nothing
Try this http://www.meidomus.com/node/view/3

--
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] Re: regexp: 'a correctly parenthesized substring advanced'

2003-09-30 Thread Marek Kilimajer
Forget regexp and try this function:
http://sk.php.net/manual/en/function.token-get-all.php
Jaaboo wrote:

I give an wrong example. Here is a better one



$txt = "func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))";

if (preg_match_all('

/

([a-zA-Z]\w*?)

\s*

(

\(

(

(?>.*?)|

.*?(?R)*

)

\)

)+

/x

', $txt, $m)){

print_r($m);

} else {

echo "no match";

}

echo "\n";



?>

This must result in :

First call: func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))
Second call with the inner part $par1," 100 (euro)", func2($par2,"(c) by
nobody")
must result in : func2($par2,"(c) by nobody")


Please visit www.regexp.org there is an open thread of this question.

thanx

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


Re: [PHP] function mail()

2003-09-30 Thread Marek Kilimajer
Set SMTP setting in php.ini to the smtp server of your provider (and 
don't forget to restart web server).

[EMAIL PROTECTED] wrote:

I use mail() function in php, but there's no living mail from my system.
MUST be mail() function turn on in some special place (ini file, &...)
??
THANKS.

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


[PHP] PHP 4.3.3 and IIS

2003-09-30 Thread Michael Kochendoerfer
Hi,

does anyone know how to handle file and directory paths on a IIS 5.0 
server? Problem is that the server has multi-domain and each domain has an 
associated 'root' dir below e:\webspaces.

So if one uses relative path strings, an opendir() for example will fail. 
One has to use "e:\\webspaces\\root_of_domain_1\\images\\" to access the 
/images folder of the configured domain 1.

I'm sure there are functions and env vars to accomplish this, but I'm quite 
new to PHP and didn't find them yet.

Please... can someone enlight a newbie? *g*

Thanks in advance!

- Michael

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



Re: [PHP] PHP Imagemagick

2003-09-30 Thread Blue Prawn
> % a static name so when another picture is uploaded the old one is
> overwritten % that is why the input path and output path is the same.
> % -Code--
> % exec($path_imagemagick."convert -crop 0x100+0+0 $imagepath.$filename
> % $imagepath.$filename");
> % -End Code--
>
> To change an image rather than make a new version of it, just use
> mogrify.
>
> % any ideas why this wont work?
>
> Start there and let us know how you do.


It is a good idea too to use the pear-imagick module which is a wraper for 
imageMagick. With this you can more easily deal with errors

here is an example with the crop function:
http://grincheux.codelutin.org/~monnier/doc/imagick/crop.php

And the other exemples given in the package:
http://grincheux.codelutin.org/~monnier/doc/imagick/

===
If you use it in cli mode, think you can write errors like this:
fwrite(STDERR, "handle failed!\nReason: $reason\nDescription: 
$description\n");
in stead of this:
print "handle failed!\nReason: $reason\nDescription: 
$description\n";

===
I am interseted in writing a simple application using php-gtk and 
php-imagick. If other peoples are interested in this project, just mail me 
to talk about this.

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



Re: [PHP] Re: regexp: 'a correctly parenthesized substring advanced'

2003-09-30 Thread Jaaboo
hi marek,

thanx for your suggestion.
i have tried out the tokenizer but
1.  i think its not realy final and can change in the future
2. the tokenizer can only find real php code but i need to find my
simplified php code without an ; on the end of an statement for example.

so the tokenizer doesn't do my job. i'm not far from the right solution it's
a litle step to bring the regex working with embeded parenthesis beetween "
"

i only had 2pregs in the complete source that can catch any type of
registered function call with the simplified syntax ... this is fast enough
for me ...

"Marek Kilimajer" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Forget regexp and try this function:
> http://sk.php.net/manual/en/function.token-get-all.php
>
> Jaaboo wrote:
>
> > I give an wrong example. Here is a better one
> >
> >  >
> > $txt = "func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))";
> >
> > if (preg_match_all('
> >
> > /
> >
> > ([a-zA-Z]\w*?)
> >
> > \s*
> >
> > (
> >
> > \(
> >
> > (
> >
> > (?>.*?)|
> >
> > .*?(?R)*
> >
> > )
> >
> > \)
> >
> > )+
> >
> > /x
> >
> > ', $txt, $m)){
> >
> > print_r($m);
> >
> > } else {
> >
> > echo "no match";
> >
> > }
> >
> > echo "\n";
> >
> >
> >
> > ?>
> >
> > This must result in :
> >
> > First call: func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))
> > Second call with the inner part $par1," 100 (euro)", func2($par2,"(c) by
> > nobody")
> > must result in : func2($par2,"(c) by nobody")
> >
> >
> >
> > Please visit www.regexp.org there is an open thread of this question.
> >
> > thanx
> >

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



RE: [PHP] PHP coders spare time [OT}

2003-09-30 Thread Jay Blanchard
[snip]
> http://zirzow.dyndns.org/html/mlists/php_general/
[/snip]

Hey Chris! nice job. Quick question (I tried viewing your source and
locating the CSS, but for some reason can't get to it this
morning...brain dead). How do you get that nifty sunken box effect in
the CSS, and can I borrow that? I gotta do something to spice up those
flat looking apps!

Thanks!

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



Re: [PHP] Page cannot be displayed

2003-09-30 Thread Olivier Simah
Yes this is done, PHP is installed as a module of Apache
Olivier

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
Windows XP.
When I try to see a HTML pages, everything is ok but when it comes to
PHP
pages nothing works
I have this message with IE : "The page cannot be displayed"
with Opera 7, Mozilla : nothing
[/snip]

Did you add the php info in the httpd.conf?

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



RE: [PHP] fsockopen()

2003-09-30 Thread Phil Ewington - 43 Plc
Positive, I am deliberately using invalid domains to test how to catch
errors when users misspell their domain.



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: 30 September 2003 12:01
To: [EMAIL PROTECTED]
Subject: Re: [PHP] fsockopen()


On Tuesday 30 September 2003 18:46, Phil Ewington - 43 Plc wrote:

> I am having problems with fsockopen() and wondered if anyone else has
> encountered this behaviour. My problem is that when connecting to an
> invalid domain I cannot trap the errors.

Have you checked that it is really an invalid domain and not simply been
hijacked by Versign:

  http://www.techweb.com/tech/network/20030926_network

--
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
--
/*
H. L. Mencken's Law:
Those who can -- do.
Those who can't -- teach.

Martin's Extension:
Those who cannot teach -- administrate.
*/

--
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] arrays and php

2003-09-30 Thread Angelo Zanetti
hi I have a table with rows and each row contains a checkbox ( array) and a
record. TD of the checkbox:
echo("");

as you can see the array of checkboxes is called chkR.

When the user clicks a submit button it calls the same
page and the value of the array is received using: $chkR=$_POST['chkR'];
however this variable is doing something weird because if I immediately do:
echo("chk: is array: " . is_array ($chk)); it doesnt display anything, so I
presume it isnt an array, supporting this is also the fact that I try to use
the $chkR in:

$indReqF = array_diff ($indReq, $chkR)

and everytime i run this statement php tells me that the 2nd argument isnt
an array. What is the reason for $chkR not being an array? I have used the
same code on a different page but instead of it posting to the same page
(like in this example) it posts to another page and works fine !?!?!?!?

can anyone help. this is very strange.
thanx in advance.

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



[PHP] An Error Tracking System

2003-09-30 Thread Daryl Meese
Hi all,

I have a series of library files written in PHP that other developers use by
including them into their code.

I have also written an error handling system that emails me if certain kinds
of problems arise.

The problem,  I only want to receive an email if the problem occurred in one
of my library files and want the other developer to see the error if it is
in their file.

TIA,


Daryl Meese

Magia Software

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



[PHP] Re: arrays and php

2003-09-30 Thread pete M
echo "
");

might solve the problem
pete
hi I have a table with rows and each row contains a checkbox ( array) and a
record. TD of the checkbox:
echo("");
as you can see the array of checkboxes is called chkR.

When the user clicks a submit button it calls the same
page and the value of the array is received using: $chkR=$_POST['chkR'];
however this variable is doing something weird because if I immediately do:
echo("chk: is array: " . is_array ($chk)); it doesnt display anything, so I
presume it isnt an array, supporting this is also the fact that I try to use
the $chkR in:
	$indReqF = array_diff ($indReq, $chkR)

and everytime i run this statement php tells me that the 2nd argument isnt
an array. What is the reason for $chkR not being an array? I have used the
same code on a different page but instead of it posting to the same page
(like in this example) it posts to another page and works fine !?!?!?!?
can anyone help. this is very strange.
thanx in advance.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] An Error Tracking System

2003-09-30 Thread Burhan Khalid
Daryl Meese wrote:

[ snip ]

The problem,  I only want to receive an email if the problem occurred in one
of my library files and want the other developer to see the error if it is
in their file.
You can use some php constants, such as __FILE__ and __FUNCTION__ to 
narrow down when an email is triggered.

More information on predefined constants > 
http://www.php.net/constants.predefined

--
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] An Error Tracking System

2003-09-30 Thread Marek Kilimajer
debug_backtrace() generates a PHP backtrace and returns this information 
as an associative array. You can use it to find out where the error ocured.

Daryl Meese wrote:

Hi all,

I have a series of library files written in PHP that other developers use by
including them into their code.
I have also written an error handling system that emails me if certain kinds
of problems arise.
The problem,  I only want to receive an email if the problem occurred in one
of my library files and want the other developer to see the error if it is
in their file.
TIA,

Daryl Meese

Magia Software

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


Re: [PHP] file_exists on different server...

2003-09-30 Thread David T-G
Tristan --

...and then [EMAIL PROTECTED] said...
% 
% RTFM?
% (Sorry, very newbie question)

Sort of, yes :-)

See The Jargon File at

  http://catb.org/esr/jargon/

or jump straight to How To Ask Questions The Smart Way

  http://www.catb.org/~esr/faqs/smart-questions.html

for not only a definition but an explantion of RTFM and STFW.  These are
a couple of the numerous TLAs and FLAs out there with which you will soon,
no doubt, become familiar.


HTH & HAND (Hope This Helps & Have A Nice Day :-)

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] Re: Cleaning up my messy code

2003-09-30 Thread rush
"Chris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm not looking for an IDE or code generator so much as some practical
> advice for organization and framework when developing a larger app. I know
> of PHP Fusebox, having programmed with Cold Fusion fusebox for a while,
but
> it seems like that might be too much. Maybe I just need a sensical,
> practical approach to application layout. What do you all do? How can I
> learn to be a better PHP programmer in this regard?

Try giving a TemplateTamer a shot. It is not too big, but it can help you
organize yourself better. On it's wiki you will find some examples and
tutorials.

rush
--
http://www.templatetamer.com/

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



[PHP] Avoiding "Warning - Page Expired"

2003-09-30 Thread Ed Curtis

 Is there any way to avoid having this happen using php if someone sits
on a page too long and clicks the back button to go back to a form they
have filled out and not having the values in a session?

Thanks,

Ed

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



Re: [PHP] Change cell colour with selection from a drop down menu

2003-09-30 Thread David T-G
Marek, et al --

Please excuse this off-topic post.  I've tried to ask with a fresh
message but it never seems to appear...

...and then Marek Kilimajer said...
% 
...
% If you don't want your users to wait for server responce each time they 
% touch something, use javascript.
% 
% 
...

I am putting together a web site with graphics from the artist and I need
to learn how to change the image when I hover over it.  Can you recommend
a good javascript list or resource, particularly for someone who doesn't
want to learn a lot of javascript?

Replies telling how to do this, either here or off-list, are also very
much appreciated :-)


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Avoiding "Warning - Page Expired"

2003-09-30 Thread Tom Rogers
Hi,

Wednesday, October 1, 2003, 12:10:10 AM, you wrote:

EC>  Is there any way to avoid having this happen using php if someone sits
EC> on a page too long and clicks the back button to go back to a form they
EC> have filled out and not having the values in a session?

EC> Thanks,

EC> Ed

To avoid that I always do a header redirect after processing a post from a form,
that way the browser forgets about the page in the middle and avoids that error
showing up. The down side is you have to save any errors in a session variable
and show them on the next page, but it is worth it I think.

-- 
regards,
Tom

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



Re: [PHP] Change cell colour with selection from a drop down menu

2003-09-30 Thread Ray Hunter

> I am putting together a web site with graphics from the artist and I need
> to learn how to change the image when I hover over it.  Can you recommend
> a good javascript list or resource, particularly for someone who doesn't
> want to learn a lot of javascript?

I have not found a great website however, i have tons of success with
group comp.lang.javascript. They have anwser all of my questions that i
have posted there. I use google for access the group and using google is
great for searching the group archives for information.

--
BigDog

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



Re: [PHP] Change cell colour with selection from a drop down menu

2003-09-30 Thread Marek Kilimajer
If both images have the same size you don't even need javascript:

#mydiv {
background-image : url(http://domain.org/image1.jpg);
background-repeat : no-repeat;
width : 200px;
height : 120px;
}
#mydiv:hover {
background-image : url(http://domain.org/image2.jpg);
background-repeat : no-repeat;
width : 200px;
height : 120px;
}

 


David T-G wrote:

Marek, et al --

Please excuse this off-topic post.  I've tried to ask with a fresh
message but it never seems to appear...
...and then Marek Kilimajer said...
% 
...
% If you don't want your users to wait for server responce each time they 
% touch something, use javascript.
% 
% 
...

I am putting together a web site with graphics from the artist and I need
to learn how to change the image when I hover over it.  Can you recommend
a good javascript list or resource, particularly for someone who doesn't
want to learn a lot of javascript?
Replies telling how to do this, either here or off-list, are also very
much appreciated :-)
TIA & HAND

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


[PHP] pdf question

2003-09-30 Thread Floyd Baker
Hello...

I have created a routine which outputs a pdf file of 'data only'.
It is to be printed onto a pdf form which I obtain elsewhere.

At present we are printing the blank form.  Then placing it into the
paper tray in order to print the data file to it.  

I would like to cause the data and form to both be printed on a single
sheet, in one operation.  That is; is it possible to cause the two
files to be accessed in sequence, so that there is not a paper feed
between them?  For one to overlay the other?  

Many thanks

Floyd 


--

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



Re: [PHP] fsockopen()

2003-09-30 Thread Jason Wong
On Tuesday 30 September 2003 20:39, Phil Ewington - 43 Plc wrote:
> Positive, I am deliberately using invalid domains to test how to catch
> errors when users misspell their domain.

Did you read that article (or are you aware of what it is about)?

And what "invalid domains" have you tried?

-- 
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
--
/*
Life is the childhood of our immortality.
-- Goethe
*/

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



Re: [PHP] Change cell colour with selection from a drop down menu

2003-09-30 Thread David T-G
Marek, et al --

...and then Marek Kilimajer said...
% 
% If both images have the same size you don't even need javascript:

Ooooh!  Yay!  That's what I *really* wanted, but I was told it couldn't
be done!


% 

Re: [PHP] Change cell colour with selection from a drop down menu

2003-09-30 Thread David T-G
Ray, et al --

...and then Ray Hunter said...
% 
% > a good javascript list or resource, particularly for someone who doesn't
% > want to learn a lot of javascript?
% 
% I have not found a great website however, i have tons of success with
% group comp.lang.javascript. They have anwser all of my questions that i

That's a start, and on the way to being as good as a mailing list.


% have posted there. I use google for access the group and using google is
% great for searching the group archives for information.

Very cool.  Thanks!


% 
% --
% BigDog


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Change cell colour with selection from a drop down menu

2003-09-30 Thread Marek Kilimajer
David T-G wrote:

Hmmm...  Sounds like I'll have to have a div definition for each of my
tabs (about nine), right?  Still, it might be worth it if I managed to
avoid javascript :-)
It does not have to be a div, it can be almost any element.

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


Re: [PHP] Q on setlocale...

2003-09-30 Thread jsWalter
"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Sunday, September 28, 2003, 5:39:53 PM, you wrote:
> j> I found this function, setlocale...
>
> j> now, is there a way to GET the LOCALE setting of a machine?
>
> j> Walter
>
>
> call setlocale with 0 (zero or NULL) as the second parameter and it
returns the current setting

Thanks Tom...

Now, if I understand this properly,

This should return French_France...

   setlocale (LC_ALL, 'fr_FR');
   echo setlocale (LC_ALL, '');

and this English_ Great Britain

   setlocale (LC_ALL, 'en_GB');
   echo setlocale (LC_ALL, '');

and this German_Germany

   setlocale (LC_ALL, 'de_DE');
   echo setlocale (LC_ALL, '');

and this Russian_Russia

   setlocale (LC_ALL, 'ru_RU');
   echo setlocale (LC_ALL, '');

Well, all of them return the same thing for me...

   English_United States.1252

The 2 lines I have given in my examples are the only 2 lines in the script.

I must be doing something wrong.

Any ideas?

Thanks

Walter

PS: And yes, I read the manual, much slower this time.

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



Re: [PHP] captcha WAS Please visit my php program

2003-09-30 Thread Chris Shiflett
--- David T-G <[EMAIL PROTECTED]> wrote:
> A hassle is right. What about your visitors who use a text-only
> browser (or surf with images turned off) or who depend on
> text-to-speech readers?
> 
> This sort of thing is, IMNSHO, unnecessary and the wrong approach;
> it makes the web harder to use without making it a safer place.
> The form should be designed correctly and safely in the first
> place.

That's a valid complaint, but I fail to see how a correctly-designed form can
offer any protection against automation. Can you show us some code?

Chris

=
HTTP Developer's Handbook
 http://shiflett.org/books/http-developers-handbook
My Blog
 http://shiflett.org/

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



RE: [PHP] Cleaning up my messy code

2003-09-30 Thread Didier McGillis
I can understand that.  When I was a young coder, just fresh out of high 
school going to school for Sport Management, btw I believe and have stress 
to the education board that I sit on for high school and trade school tech 
programs that they not teach specifics about a certain language but that 
they teach the kids the proper way to code, database design, all the 
fundamentals and allow the kids to get a good base (think that is more 
imporatant then anything) and then let them discover their own tools, and 
style and language of choice (notice mine isnt english).

Anyway I'm sorry about the rant.  I imagne that you are writting the 
database and coming up with that piece as well.  While you are writting the 
database you are starting to form the foundation of your site, and coming up 
with revisions.  I find its best to make notes in the db design doc, and 
even in the sql about why you did things the way you did.  You can go back 
and reference these notes and build on them.  Secondly I sit down on my 
laptop and while thinking or coding I make other notes either in my code or 
in a coding document about how the structure of how things are laid out, and 
why I did xml over sql calls and such.  This may sound like a lot of extra 
work, but not only is the foundation to your site documentation, which 
should be written but it will help you get a frame of reference should you 
have to step away from teh project or just need a reminder, also if you 
bring someone else in to help you wont have to spend much time babysitting 
them.


From: Chris <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Cleaning up my messy code
Date: 29 Sep 2003 21:49:45 -
[EMAIL PROTECTED] (Warren Vail) wrote in
news:[EMAIL PROTECTED]:
> My own experience has shown that separation of a presentation layer
> from an application layer, doesn't occur where we think it should.
> HTML as a language has no capability to be dynamic, and if we are
> going to ask that the page be dynamic, we are going to need to make
> sure we don't attempt to split layers along language boundaries.
> JavaScript, as we typically use it, adds some dynamic nature to our
> pages, but often is not based on database content.  This is where PHP
> comes in and the split becomes more vague.  If what the user sees, is
> controlled by database content, then splitting presentation and
> application layers becomes a frustrating exercise in theoretical
> purity, that often adds to response times of applications.
Certainly. This is not a theoretical exercise but frustration with
dealing with my own code, trying to implement revisions, and basically
feeling like I need a map of some kind to know where I am.
That's why I'm interested in what other people really do rather than
theoretical models they think might be the "purest." And it isn't just
code and content separation, which isn't always practical as an
absolute, but code separation. If I have a simple set of actions to
perform, say a series of functions to enter data into a db, review the
entry, edit the entry, etc. how can I organize my code so it is easy to
maintain and so some things can be reused? Objects? Functions? Fuses?
Switches? All of these have their adherents... I'm trying to find one
that adheres to me-- i.e. that is usable without being so extensive and
abstract that I spend more time trying to learn how to fit the framework
than actually getting something done...
c

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


Re[2]: [PHP] Q on setlocale...

2003-09-30 Thread Tom Rogers
Hi,

Wednesday, October 1, 2003, 1:25:09 AM, you wrote:

j> returns the current setting

j> Thanks Tom...

j> Now, if I understand this properly,

j> This should return French_France...

j>setlocale (LC_ALL, 'fr_FR');
j>echo setlocale (LC_ALL, '');

j> and this English_ Great Britain

j>setlocale (LC_ALL, 'en_GB');
j>echo setlocale (LC_ALL, '');

j> and this German_Germany

j>setlocale (LC_ALL, 'de_DE');
j>echo setlocale (LC_ALL, '');

j> and this Russian_Russia

j>setlocale (LC_ALL, 'ru_RU');
j>echo setlocale (LC_ALL, '');

j> Well, all of them return the same thing for me...

j>English_United States.1252

j> The 2 lines I have given in my examples are the only 2 lines in the script.

j> I must be doing something wrong.

j> Any ideas?

j> Thanks

j> Walter

j> PS: And yes, I read the manual, much slower this time.

Those locales actually have to be available or they will be ignored and that
will depend on what type of system your running on.
For example on my system (linux) I had to do

localedef -ci es_ES -f ISO_8859-1:1987 es_ES

and then a restart on apache to get the Spanish locale working.

(Did I mention manuals :)

-- 
regards,
Tom

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



Re: [PHP] captcha WAS Please visit my php program

2003-09-30 Thread David T-G
Chris, et al --

...and then Chris Shiflett said...
% 
% --- David T-G <[EMAIL PROTECTED]> wrote:
% > A hassle is right. What about your visitors who use a text-only
...
% > The form should be designed correctly and safely in the first
% > place.
% 
% That's a valid complaint, but I fail to see how a correctly-designed form can
% offer any protection against automation. Can you show us some code?

1) No, not right now.

2) Let's clarify the example we're considering, since I don't think that
the approach will necessarily be the same for all forms.

3) Once that's done, let me think about it :-)


% 
% Chris


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] fsockopen()

2003-09-30 Thread Phil Ewington - 43 Plc
Sorry Jason, I did read the article but must have been away with the fairies
for a moment. I was testing domains that are complete rubbish but they were
all .com and .net so yes you were right and I am a complete fool ;o). Now
getting an error message 'No such file or directory' when testing on another
TLD, strange message for 'domain cannot be found', but hey life would be
boring if everyone thought along the same lines :o)


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: 30 September 2003 15:51
To: [EMAIL PROTECTED]
Subject: Re: [PHP] fsockopen()


On Tuesday 30 September 2003 20:39, Phil Ewington - 43 Plc wrote:
> Positive, I am deliberately using invalid domains to test how to catch
> errors when users misspell their domain.

Did you read that article (or are you aware of what it is about)?

And what "invalid domains" have you tried?

--
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
--
/*
Life is the childhood of our immortality.
-- Goethe
*/

--
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 coders spare time [OT}

2003-09-30 Thread Chris Shiflett
--- Curt Zirzow <[EMAIL PROTECTED]> wrote:
> I'm on message 163194 and counting down to zero at this point :)
> 
> Added a little person-> month summary too.

Awesome. I think this is the best aggregation of this mailing list anyone has
bothered to make. Nice job.

I've posted more than the two least-active John Holmeses! :-)

It might be a good idea to distinguish based on email alone rather than unique
combinations of name + email.

Chris

=
HTTP Developer's Handbook
 http://shiflett.org/books/http-developers-handbook
My Blog
 http://shiflett.org/

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



[PHP] Session data is lost

2003-09-30 Thread Harald Kürsten
Hi.

In my script I start a session, register certain variables and redirect to
the next page.
The session file is written to /tmp, but contains no data !

Any idea ?

Thanx for help,
Harald

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

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



[PHP] Re: Session data is lost

2003-09-30 Thread Gal
please paste an example of the 2 pages

Harald Kürsten wrote:
Hi.

In my script I start a session, register certain variables and redirect to
the next page.
The session file is written to /tmp, but contains no data !
Any idea ?

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


RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Angelo Zanetti 
on Tuesday, September 30, 2003 5:43 AM said:

> hi I have a table with rows and each row contains a checkbox ( array)
> and a record. TD of the checkbox:
> echo(" value=". $chkSessionF[$i] .">");

Firstly you should be putting double quotes around every value in your
HTML tags.

Revised: (watch wrap)

echo "";

I also changed

". $chkSessionF[$i] ."

into

{$chkSessionF[$i]}

.

You can do it either way. I prefer the latter.

If you're not sure what a value is use print_r() to determine it.

echo "";
print_r($chk);
echo "";

Quick side note on the above code:

You cannot write it like:

echo "".print_r($chk)."";

It will not work.

> can anyone help. this is very strange.

I think your problem may just be the quotes around the values in the
HTML. Give it a shot.



hth,
chris.

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



Re: Re[2]: [PHP] Q on setlocale...

2003-09-30 Thread jsWalter
"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> Those locales actually have to be available or they will be ignored and
that
> will depend on what type of system your running on.

OK, I'm on Windows 2k, and after reading Microsofts docs, I thought it was
all there.

Maybe not.


> For example on my system (linux) I had to do
>
> localedef -ci es_ES -f ISO_8859-1:1987 es_ES
>
> and then a restart on apache to get the Spanish locale working.

Restart the server?

No way to set this on the fly?


> (Did I mention manuals :)

No, but I got 2 private messages stating "RTFM" and no other comments. They
were a big help. :/

I'm beginning to think this is tougher than I thought.

:/

What I'm trying to do is have my new Class be aware of the LOCALE setting
and take advantage of that info to return translated strings based upon that
setting.

I was hoping not to have a method in my Class to define LOCALE, I wanted to
pick it up from the system, and even let the user set it on the fly.

Thanks for your help Tom.

Walter

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



[PHP] if statement

2003-09-30 Thread Steve Buehler
I have an "if" statement that I would like to make a little bit more 
generic.  This is how the statement looks now.

if($k2b=="/etc/bind/options.conf.wp" || $k2b=="/etc/bind/rndc.conf.wp" || 
$k2b=="/etc/bind/keys.conf.wp"){
	do this1
}else{
	do this2
}

What I would like to do is to have an array earlier in the script of just 
the items that it is checking for so that it can be more easily changed if 
I put this out as free or shareware software.  Here is what it might look 
like, but I know that if this is possible, it probably won't look at all 
like this:

$array=("/etc/bind/options.conf.wp","/etc/bind/rndc.conf.wp","/etc/bind/keys.conf.wp");
if($k2b==$array){
do this1
}else{
do this2
}
I think that might make enough since to see if someone can help me on 
this.  This would be real nice for me in use in a lot of scripts.

Thanks
Steve
PHP / MySQL

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


[PHP] storing japanese in mysql (or pgsql)

2003-09-30 Thread Chris W. Parker
(I posted this to another list yesterday without response, so if it
looks familiar, that's why.)

Hi.

I'm working on a small study aid for myself (and anyone else that wants
to use it) and I could really use the ability to store Japanese
characters in a MySQL or pgsql db. Right now I've created a very large
array.

What I'd like to do is have a form that will allow me to add new
characters whenever needed. So far my attempts at this have failed. It
always seems that the extended characters get turned into their html
entity equivalents before they are inserted into the db.

I'm using euc-jp as the character set.


I'm pretty much lost with this. Anyone have experience with this that
they'd like to share? (on or off list is fine.)


Thanks,
Chris.

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



[PHP] Php snmp Version

2003-09-30 Thread Lucas Lain
Hi everybody, 
i was googled a long time looking how to pass the snmp version to the snmpget 
or snmpwalk functions. The only response was from a guy who proposed to 
change the source code. I don't fully understand, the code is ready to do 
snmp v2c querys but it doesn't exists the parameters... i am not scared about 
modifying the code... but i just dont get it !!!

TIA,

Lucas Lain

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



Re: [PHP] captcha WAS Please visit my php program

2003-09-30 Thread Chris Shiflett
--- David T-G <[EMAIL PROTECTED]> wrote:
> 1) No, not right now.
> 
> 2) Let's clarify the example we're considering, since I don't think
> that the approach will necessarily be the same for all forms.
> 
> 3) Once that's done, let me think about it :-)

The challenge is to create a form that cannot be automated, for whatever reason
developers may need it.

Chris

=
HTTP Developer's Handbook
 http://shiflett.org/books/http-developers-handbook
My Blog
 http://shiflett.org/

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



Re: [PHP] if statement

2003-09-30 Thread Brad Pauly
Steve Buehler wrote:

[snip]

$array=("/etc/bind/options.conf.wp","/etc/bind/rndc.conf.wp","/etc/bind/keys.conf.wp"); 

if($k2b==$array){
do this1
}else{
do this2
}
You are close. Check out in_array(). http://us4.php.net/in_array

if (in_array($kb2, $array))

- Brad

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


Re: [PHP] if statement

2003-09-30 Thread Marek Kilimajer
if(in_array($k2b, $array)) { ...

Steve Buehler wrote:

I have an "if" statement that I would like to make a little bit more 
generic.  This is how the statement looks now.

if($k2b=="/etc/bind/options.conf.wp" || $k2b=="/etc/bind/rndc.conf.wp" 
|| $k2b=="/etc/bind/keys.conf.wp"){
do this1
}else{
do this2
}

What I would like to do is to have an array earlier in the script of 
just the items that it is checking for so that it can be more easily 
changed if I put this out as free or shareware software.  Here is what 
it might look like, but I know that if this is possible, it probably 
won't look at all like this:

$array=("/etc/bind/options.conf.wp","/etc/bind/rndc.conf.wp","/etc/bind/keys.conf.wp"); 

if($k2b==$array){
do this1
}else{
do this2
}
I think that might make enough since to see if someone can help me on 
this.  This would be real nice for me in use in a lot of scripts.

Thanks
Steve
PHP / MySQL

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


Re: [PHP] if statement

2003-09-30 Thread Curt Zirzow
* Thus wrote Steve Buehler ([EMAIL PROTECTED]):
> 
> What I would like to do is to have an array earlier in the script of just 
> the items that it is checking for so that it can be more easily changed if 
> I put this out as free or shareware software.  Here is what it might look 
> like, but I know that if this is possible, it probably won't look at all 
> like this:
> 
> $array=("/etc/bind/options.conf.wp","/etc/bind/rndc.conf.wp","/etc/bind/keys.conf.wp");
> if($k2b==$array){
>   do this1
> }else{
>   do this2
> }

Close, but not close enough :)

if (in_array($k2b, $array) ) {
  // do this1
}

http://php.net/in_array

Although depending on the situation I usually set up array's of
this type like this:

$arr = array(
  '/etc/bind/options.conf.wp' => true,
  '/etc/bind/rndc.conf.wp' => true 
  );

Then my condition is:

if (@$arr[$k2b]) {
  // do this1
}


Curt
-- 
"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[4]: [PHP] Q on setlocale...

2003-09-30 Thread Tom Rogers
Hi,

Wednesday, October 1, 2003, 2:15:10 AM, you wrote:
j> "Tom Rogers" <[EMAIL PROTECTED]> wrote in message
j> news:[EMAIL PROTECTED]

>> Those locales actually have to be available or they will be ignored and
j> that
>> will depend on what type of system your running on.

j> OK, I'm on Windows 2k, and after reading Microsofts docs, I thought it was
j> all there.

j> Maybe not.


>> For example on my system (linux) I had to do
>>
>> localedef -ci es_ES -f ISO_8859-1:1987 es_ES
>>
>> and then a restart on apache to get the Spanish locale working.

j> Restart the server?

j> No way to set this on the fly?


>> (Did I mention manuals :)

j> No, but I got 2 private messages stating "RTFM" and no other comments. They
j> were a big help. :/

j> I'm beginning to think this is tougher than I thought.

j> :/

j> What I'm trying to do is have my new Class be aware of the LOCALE setting
j> and take advantage of that info to return translated strings based upon that
j> setting.

j> I was hoping not to have a method in my Class to define LOCALE, I wanted to
j> pick it up from the system, and even let the user set it on the fly.

j> Thanks for your help Tom.

j> Walter


Under windows you could go to control panel ->regional settings ->input locales
and try adding a few and see if that helps.
I only know about apache and that did need a restart to get it to recognize the
new locales available as I think it caches that information.

-- 
regards,
Tom

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



Re: [PHP] if statement

2003-09-30 Thread Steve Buehler
To Brad, Marek and Curt (and anybody who responds after this)
Thank you so much for your help.  This is going to help me out so 
much in a lot of my scripts.  It will sure make them a little.Noa 
LOT more portable now.

Thanks
Steve
At 11:26 AM 9/30/2003, you wrote:
Steve Buehler wrote:

[snip]

$array=("/etc/bind/options.conf.wp","/etc/bind/rndc.conf.wp","/etc/bind/keys.conf.wp"); 

if($k2b==$array){
do this1
}else{
do this2
}
You are close. Check out in_array(). http://us4.php.net/in_array

if (in_array($kb2, $array))

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


[PHP] Setting cookies

2003-09-30 Thread Chris Boget
We have 2 servers, one for development and one for production.  The
development server is "dev.change.wild.net" while the production server
is "change.wild.net".  We are using the following code to set the cookie

$expire_time = time()+60*60*24*30;  // 30 days
setcookie( 'this', $this, $expire_time, '/', $_SERVER['HTTP_HOST'] );
setcookie( 'that', $that, $expire_time, '/', $_SERVER['HTTP_HOST'] );

We are accessing the cookie values using $_COOKIE.  What appears to
be happening is that when we echo the values of the above cookies on
"dev.change.wild.net", it is displaying the values set for on "change.wild.net".
Why is that?  Because "change.wild.net" is the primary domain with 'dev'
being a subdomain?  Is there any way we can force it so that the cookie
values are pulled for the correct domain?

thnx,
Chris

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



Re: [PHP] Session data is lost

2003-09-30 Thread CPT John W. Holmes
From: "Harald Kürsten" <[EMAIL PROTECTED]>
> In my script I start a session, register certain variables and redirect to
> the next page.
> The session file is written to /tmp, but contains no data !

Does a simple session example from the Manual work?

Some actual code would help here, but try using session_write_close() before
you redirect.

---John Holmes...

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



Re: [PHP] Setting cookies

2003-09-30 Thread Brad Pauly
Chris Boget wrote:
We are accessing the cookie values using $_COOKIE.  What appears to
be happening is that when we echo the values of the above cookies on
"dev.change.wild.net", it is displaying the values set for on "change.wild.net".
Why is that?  Because "change.wild.net" is the primary domain with 'dev'
being a subdomain?  Is there any way we can force it so that the cookie
values are pulled for the correct domain?
I think you are probably right and I think it is due to tail matching. A 
link from the manual pointed to:

http://wp.netscape.com/newsref/std/cookie_spec.html

What about clearing your cookies when you switch between your dev server 
and your live server. Takes a little more manual effort, but should work.

- Brad

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


Re: [PHP] storing japanese in mysql (or pgsql)

2003-09-30 Thread Gerard Samuel
Not sure about mysql, but with pgsql, if you create your database with 
utf-8 or equivalent japanese
encoding, you should be able to store japanese characters in the db...

Chris W. Parker wrote:

(I posted this to another list yesterday without response, so if it
looks familiar, that's why.)
Hi.

I'm working on a small study aid for myself (and anyone else that wants
to use it) and I could really use the ability to store Japanese
characters in a MySQL or pgsql db. Right now I've created a very large
array.
What I'd like to do is have a form that will allow me to add new
characters whenever needed. So far my attempts at this have failed. It
always seems that the extended characters get turned into their html
entity equivalents before they are inserted into the db.
I'm using euc-jp as the character set.

I'm pretty much lost with this. Anyone have experience with this that
they'd like to share? (on or off list is fine.)
Thanks,
Chris.
 

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


Re: [PHP] Setting cookies

2003-09-30 Thread Chris Shiflett
--- Chris Boget <[EMAIL PROTECTED]> wrote:
> We have 2 servers, one for development and one for production.  The
> development server is "dev.change.wild.net" while the production server
> is "change.wild.net".  We are using the following code to set the cookie
> 
> $expire_time = time()+60*60*24*30;  // 30 days
> setcookie( 'this', $this, $expire_time, '/', $_SERVER['HTTP_HOST'] );
> setcookie( 'that', $that, $expire_time, '/', $_SERVER['HTTP_HOST'] );
> 
> We are accessing the cookie values using $_COOKIE.  What appears to
> be happening is that when we echo the values of the above cookies on
> "dev.change.wild.net", it is displaying the values set for on
> "change.wild.net".
> Why is that?

Because dev.change.wild.net is within the change.wild.net domain. This is by
design. They are not different domains. You can always use:

1. dev.change.wild.net
2. www.change.wild.net

or

1. change-dev.wild.net
2. change.wild.net

Hope that helps.

Chris

=
HTTP Developer's Handbook
 http://shiflett.org/books/http-developers-handbook
My Blog
 http://shiflett.org/

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



Re: [PHP] arrays and php

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 00:10, Chris W. Parker wrote:

[snip]

> If you're not sure what a value is use print_r() to determine it.
>
> echo "";
> print_r($chk);
> echo "";
>
> Quick side note on the above code:
>
> You cannot write it like:
>
> echo "".print_r($chk)."";
>
> It will not work.

You can do this though:

  echo "", print_r($chk), "";

Or if using a recent version of php:

  echo nl2br(print_r($var, 1)); //or something like that

-- 
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
--
/*
No bird soars too high if he soars with his own wings.
-- William Blake
*/

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



Re: [PHP] Session data is lost

2003-09-30 Thread Chris Shiflett
--- "CPT John W. Holmes" <[EMAIL PROTECTED]> wrote:
> From: "Harald Kürsten" <[EMAIL PROTECTED]>
> > In my script I start a session, register certain variables and
> > redirect to the next page. The session file is written to /tmp,
> > but contains no data !
> 
> Does a simple session example from the Manual work?
> 
> Some actual code would help here, but try using session_write_close()
> before you redirect.

Yes, some code or information of some sort would be helpful, but here is a wild
guess:

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

Hope that helps.

Chris

=
HTTP Developer's Handbook
 http://shiflett.org/books/http-developers-handbook
My Blog
 http://shiflett.org/

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Jason Wong 
on Tuesday, September 30, 2003 11:06 AM said:

>> echo "".print_r($chk)."";
>> 
>> It will not work.
> 
> You can do this though:
> 
>   echo "", print_r($chk), "";

Well heck, that makes things easier!

What's the difference between using , or . for concatenation? (I thought
they were the same.)



Chris.

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



Re: Re: [PHP] __clone() questions ???

2003-09-30 Thread --
Forwarded Message  
Date: Wed, 24 Sep 2003 07:17:05 -0700 (PDT) 
From: "--" <[EMAIL PROTECTED]> 
To: [EMAIL PROTECTED] 
Subject: __clone() questions ??? 



Plain Text Attachment [ Save to my Yahoo! Briefcase  |
 Download File ]  

Hello srs,

Q 1.

  Will the methode __clone() have the posibility of
take arguments  It would be usefull to
reinitialize the clone:

  age = $age;
  $this->owner  = $owner;
}

function __clone($owner) {
$this->age = 0;
$this->owner  = $owner;
}


}

$molly = new Ovelha(2, "Eduardo");

$dolly = $molly->__clone("Igor");

print $dolly->owner;
print $dolly->age;
?>

Warning: Clone method does not require arguments

that´s sure one can create a wrapper function that
initializes it, but


Q 2.

In some old docs, I´ve read the following:

  For convenience, the engine will suply a function
that imports all of the properties from the source
object, so they can start a by-value replica of the
object, and only override properties that need to be
changed. [The function hasn´t been implemented yet].

 How is it actualy?

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design
software
http://sitebuilder.yahoo.com



Forwarded Message  
Date: Wed, 24 Sep 2003 14:43:35 + 
From: "Curt Zirzow" <[EMAIL PROTECTED]> 
To: [EMAIL PROTECTED] 
Subject: Re: [PHP] __clone() questions ??? 



Plain Text Attachment [ Save to my Yahoo! Briefcase  |
 Download File ]  

* Thus wrote -- ([EMAIL PROTECTED]):
> Hello srs,
> 
> Q 1.
> 
>   Will the methode __clone() have the posibility of
> take arguments  It would be usefull to
> reinitialize the clone:

>Wont the clone() not be a clone anymore?

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

 
So
About Question 1,
How do you re-set properties in the clone at the time
it is cloned... as it is done in the constructor

And has someone any answer to Question 2??

regards,

Eduardo R. Maciel

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] arrays and php

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 02:14, Chris W. Parker wrote:
> Jason Wong 
>
> on Tuesday, September 30, 2003 11:06 AM said:
> >> echo "".print_r($chk)."";
> >>
> >> It will not work.

Actually, the above *does* work!

-- 
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
--
/*
Test-tube babies shouldn't throw stones.
*/

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



Re: [PHP] arrays and php

2003-09-30 Thread CPT John W. Holmes
From: "Chris W. Parker" <[EMAIL PROTECTED]>

>>> echo "".print_r($chk)."";
>>>
>>> It will not work.
>>
>> You can do this though:
>>
>>   echo "", print_r($chk), "";
>
>Well heck, that makes things easier!
>
>What's the difference between using , or . for concatenation? (I thought
>they were the same.)

Using a comma is just like using another echo command. So for the above,
you're effectively saying:

echo ""; echo print_r($chk); echo "";

Note that print_r() will (by default) return a 1 (TRUE) upon success, so you
end up with a "1" being printed at the end of your data.

You could also use this method:

echo "".print_r($chk,TRUE)."";

The TRUE causes the output of print_r() to be returned instead of printed
automatically. The benefit to this method is that you don't end up with the
"1" being printed.

---John Holmes...

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



Re: [PHP] arrays and php

2003-09-30 Thread CPT John W. Holmes
From: "Jason Wong" <[EMAIL PROTECTED]>
> On Wednesday 01 October 2003 02:14, Chris W. Parker wrote:
> > Jason Wong 
> >
> > on Tuesday, September 30, 2003 11:06 AM said:
> > >> echo "".print_r($chk)."";
> > >>
> > >> It will not work.
> 
> Actually, the above *does* work!

It depends on how you define "works" :)

You'll end up with output like this:

Array
(
[0] => one
[1] => two
[2] => three
)
1

which "works" but is not what was desired. 

---John Holmes...

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Jason Wong 
on Tuesday, September 30, 2003 11:27 AM said:

 echo "".print_r($chk)."";
 
 It will not work.
> 
> Actually, the above *does* work!

Not for me. (Although we may be testing different things.)

".print_r($pageTitle)."";
?>

Gives me:

Checkout Step One1


If I use the , it's a little closer but still not correct (at least not
what I want). With , I get:

Checkout Step One1

Close but I don't know where the one is coming from. Maybe it's saying
it's 'true'?



Chris.

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
CPT John W. Holmes 
on Tuesday, September 30, 2003 11:32 AM said:

> Note that print_r() will (by default) return a 1 (TRUE) upon success,
> so you end up with a "1" being printed at the end of your data.

[snip]

That answers it!




c.

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris Shiflett
--- "Chris W. Parker" <[EMAIL PROTECTED]> wrote:
> What's the difference between using , or . for concatenation? (I
> thought they were the same.)

The comma isn't concatenation; echo can take multiple arguments.

I've heard statements about passing multiple arguments to echo being faster
than using concatenation, but every benchmark I've tried myself shows them to
be nearly identical. Feel free to try it yourself and post your results. :-)
I'd be curious to see if others reach the same conclusion.

Chris

=
HTTP Developer's Handbook
 http://shiflett.org/books/http-developers-handbook
My Blog
 http://shiflett.org/

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



Re: [PHP] arrays and php

2003-09-30 Thread CPT John W. Holmes
From: "Chris W. Parker" <[EMAIL PROTECTED]>
> CPT John W. Holmes 
> on Tuesday, September 30, 2003 11:32 AM said:
>
> > Note that print_r() will (by default) return a 1 (TRUE) upon success,
> > so you end up with a "1" being printed at the end of your data.
>
> [snip]
>
> That answers it!

See... if you'd only have waited that extra second to press the Send button!
;)

---John Holmes...

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



[PHP] Re: PHP Imagemagick

2003-09-30 Thread Cameron Metzke
Ok i finally got the script going :) If anyones curious heres the code.
exec($path_imagemagick."convert $path_picture -crop $height"."x$width+$x+$y
$path_picture2");

"Cameron Metzke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> i have a script where people upload an image it is then renamed and is
> supposed to be cripped according to the values they submit but i cant seem
> to get it to crop it uploads and is renamed fine though. also i wish to
use
> a static name so when another picture is uploaded the old one is
overwritten
> that is why the input path and output path is the same.
> -Code--
> exec($path_imagemagick."convert -crop 0x100+0+0 $imagepath.$filename
> $imagepath.$filename");
> -End Code--
> any ideas why this wont work?

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



[PHP] HTTP HEAD request using curl??

2003-09-30 Thread Marc Richards
Is it possible to do a http HEAD (instead of GET, POST or PUT) request using
the php curl extension?  I know that curl itself can do it, but I wasn't
able to find the appropriate CURLOPT constant in the documentation for the
php extension.

I need to do a whole bunch of url calls but all I need is the headers, I
don't have curl support compiled in and I probably won't bother compiling in
if it can't do HEAD (I'll just use fopen).

Has anybody been able to do this?


Marc

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



RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Chris Shiflett 
on Tuesday, September 30, 2003 11:39 AM said:

> The comma isn't concatenation; echo can take multiple arguments.

Oh ok, I get it.

> I've heard statements about passing multiple arguments to echo being
> faster than using concatenation, but every benchmark I've tried
> myself shows them to be nearly identical. Feel free to try it
> yourself and post your results. :-) I'd be curious to see if others
> reach the same conclusion. 

I tried this, and I think the comma was just slightly faster than the
period. But then again I didn't always get consistent results because I
was trying this out on a machine that is not very fast so the speed at
which is processes something varies quite a bit.

My conclusion was that it's not fast enough to bother changing all my
code, or start writing in a new way.


Although during some testing I did find that writing loops in the
following way is faster than normal.

$counter = -1;
while(++$counter < $amount)
{
// do stuff
}

It made a big enough difference on my slow machine to merit me writing
as many loops in this way as I can. (I think.)



Chris.

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



[PHP] Making a Session Longer

2003-09-30 Thread Free Grafton
We offer an application for our customers which allows them to log into
their organization and participate in discussions, register for events and
build their websites. We are using Apache 2.0.47, PHP 4.3.3 and MySQL 4.0.15
for the application. We use session cookies with PHP to establish their
permissions and store other information about them while they are logged in.

The problem we are experiencing is that we are starting to have so many
users on at one time that they are getting bumped off faster and faster. We
have increased the MaxUsers in apache up to 1000, but that doesn¹t seem to
make any difference. Our session_cookie is set to 0 in the php.ini file so
there is no inherent timeout for users. We have 1.5GB of memory on our
production server and aren¹t experiencing any memory swaps, so I don¹t think
that is it as well.

The only other possible thing I can think is that it might be related to
session.gc_maxlifetime =1440 in the php.ini file. I have looked and can¹t
really find much valuable information on what this really does and if it
would have any affect on our sites.

So, if anyone has some advise on what we can try, it sure would be greatly
appreciated. Have an excellent day!


Free Grafton

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



  1   2   >