[PHP] Textarea and Php

2005-01-18 Thread Ross Hulford
Is there a way to add and remove lines of text to a textarea inside a form?


Thanks


Ross 

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



Re: [PHP] Textarea and Php

2005-01-18 Thread Hugh Danaher
Ross,
Try something like this in your form:
$description
You can then edit the contents of the cell
Hope this helps.
Hugh
- Original Message - 
From: "Ross Hulford" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, January 18, 2005 12:15 AM
Subject: [PHP] Textarea and Php


Is there a way to add and remove lines of text to a textarea inside a 
form?

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

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 1/16/2005


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 1/16/2005
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Execute shell script from PHP

2005-01-18 Thread Tom
shell_exec()
Tom
Khan wrote:
Hello,
I have a shell script for ading users to LDAP. It looks like this:
#!/bin/bash
MUID=userlogin
FULLNAME="First Last"
LASTNAME="Last"
DOMAIN=example.org
SERVER=qmail.example.org
PASS=userpass
cat > .ldif.tmp.$MUID << EOF
dn: uid=$MUID,ou=accounts,dc=example,dc=org
cn: $FULLNAME
sn: $LASTNAME
objectclass: top
objectclass: person
objectclass: inetOrgPerson
objectclass: qmailUser
mail: [EMAIL PROTECTED]
mailhost: $DOMAIN
mailMessageStore: /var/qmail/maildirs/$MUID/Maildir
userPassword: $PASS
uid: $MUID
accountStatus: enabled
EOF
ldapadd -x -v -w secret -D "cn=Manager,dc=example,dc=org" \
-f .ldif.tmp.$MUID
rm .ldif.tmp.$MUID
How Can I run (trigger) this script from PHP so I could create web 
form for adding users.

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


[PHP] strtotime time zone trouble

2005-01-18 Thread Marcus Bointon
How is this not a bug?

outputs:
2005-01-18 09:58:09 (correct)
2005-01-18 17:58:09 (incorrect)
The time zone correction is applied in the wrong direction. Does it in 
both current PHP 4 and 5.

Named time zones like these are supposedly deprecated, but the 
suggested alternative in the docs doesn't work at all:

print date('Y-m-d H:i:s', strtotime('now UTC-0800'))."\n";
1970-01-01 00:59:59
using 08:00 doesn't work either
Ideas?
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Persistent PHP web application?

2005-01-18 Thread Zouari Fourat
can u explain a bit more : The answer would be Application-Scope
vars wish we had it in PHP


On Tue, 18 Jan 2005 02:42:46 +0400, M Saleh EG <[EMAIL PROTECTED]> wrote:
> The answer would be Application-Scope vars wish we had it in PHP
> 
> M.Saleh.E.G
> 97150-4779817
> 
> --
> 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] Execute shell script from PHP

2005-01-18 Thread Khan
Tom wrote:
shell_exec()
yes, I have try that but nothing happenes. here is my code. Is this correct?

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


Re: [PHP] Re: which is best php editor?

2005-01-18 Thread pf
> What's the purpose of your coding?
> Applications? Just some sort of dynamic code here n there? or Huge OOP
> application with a team of programmers?
>
> I started with PHPEdit, Moved to Magna and then tried Dreaweaver to
> communicate with designers. And then came Zend 2.5 n then Got shocked
> with Zend 3.5 and now i'm on the Zend 4.0 Beta.  In all the cases I'd
> recommand Zend if you wish to buy rather than using a free one.
>
> But it all depends on u & the amount of work you want to get done with
> ur editor or IDE.
>
> HTH
>
> M.Saleh.E.G
> 97150-4779817
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Coding since about 4 years, never got a better editor than EditPlus 2. And
sometime ago I was decided to get a very good Dev Env, no one did it, i
was back to EditPlus in a week.

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



Re: [PHP] strtotime time zone trouble

2005-01-18 Thread Tom
Marcus Bointon wrote:
How is this not a bug?

outputs:
2005-01-18 09:58:09 (correct)
2005-01-18 17:58:09 (incorrect)
PST = UTC - 8, therefore if you ask for strtotime in PST it will give 
you  now + 8. This is standard in most languages, you are just reading 
the functionality back to front.
ie when you say strtotome('now PST'), what you are asking for is the 
current local time (UTC in your instance) given an input date in PST

The time zone correction is applied in the wrong direction. Does it in 
both current PHP 4 and 5.

Named time zones like these are supposedly deprecated, but the 
suggested alternative in the docs doesn't work at all:

print date('Y-m-d H:i:s', strtotime('now UTC-0800'))."\n";
try
print date('Y-m-d H:i:s', strtotime('now') -0800)."\n";
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Execute shell script from PHP

2005-01-18 Thread Tom
Khan wrote:
Tom wrote:
shell_exec()

yes, I have try that but nothing happenes. here is my code. Is this 
correct?


looks fine to me, except that I tend to run a check to make sure that it 
has run ok, like
$myReturn = shell_exec('/test/acct.sh');
or
if (shell_exec('/test/acct.sh');

On some systems you have to execute the script
eg
$myReturn = shell_exec('. /test/acct.sh');
Also make sure that the acct.sh script is executable by the php user
(chmod / chown are your evil friends :) )
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: [PHP-WIN] Weird windows error

2005-01-18 Thread Leif Gregory
Hello Louis,

Tuesday, January 18, 2005, 4:51:49 AM, you wrote:
LY> LoadLibrary("php_mssql.dll") failed - The specified module could
LY> not be found.

Because this DLL has a dependency on ntwdblib.dll.


Cheers,
Leif Gregory 

-- 
TB Lists Moderator (and fellow registered end-user)
PCWize Editor  /  ICQ 216395  /  PGP Key ID 0x7CD4926F
Web Site 

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



[PHP] phpeclipse ide question

2005-01-18 Thread Benjamin Edwards
After the discussion about editors I have installed phpeclipse. It seems to 
work well and looks great.  However I am having slight problem.  

Whenever I save a file it seems to try to launch a browser, anyway it comes up 
with a message saying something like 'unable to launch external browser.  
Please set up your external browser in browser preferences.  It also launches 
an internal browser which is blank and if I type a URL in I get nothing.  

I have found a place to set up browsers and have both firefox and mozilla setup 
(I think) but am not sure wether I have set this up correctly (seems I have 
not).  So my questions are.

1) where exactly and how do I set up an external browser to launch when I save 
a .PHP file.

2) How can I get the internal browser working, do I need to set up some stuff.

3) How do I turn off the auto launch when I save a .PHP file and if I do this 
how do I manually launch it in the internal/external browser.

In fact launching the .PHP file from eclipse is of limited use as most of my 
pages require URL parameters.  So another question is

4)   Is there a way to set up testing URL (with ?/& parameters) for a .PHP file 
and is it possible to set up such a thing that calls a post  to the file.  

I know having a browser open and switching between eclipse is a totally good 
work around but this would be great.

Ben


__
This email and any files transmitted with it are confidential. It is for the 
intended recipient only. If you have received the email in error please notify 
the author by replying to this email. If you are not the intended recipient, 
you must not disclose, distribute, copy, print, or rely on this email. Any 
views expressed by an individual within this email which do not constitute or 
record professional advice relating to the RNLI, do not necessarily reflect the 
views of the organisation.

Registered Charity Number 209603

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



Re: [PHP] strtotime time zone trouble

2005-01-18 Thread Marcus Bointon
On 18 Jan 2005, at 10:53, Tom wrote:
PST = UTC - 8, therefore if you ask for strtotime in PST it will give 
you  now + 8. This is standard in most languages, you are just reading 
the functionality back to front.
ie when you say strtotome('now PST'), what you are asking for is the 
current local time (UTC in your instance) given an input date in PST
OK, I see some logic in that - now how to work around it?
try
print date('Y-m-d H:i:s', strtotime('now') -0800)."\n";
That definitely won't work; -0800 will be interpreted as an octal 
value, but it's not a legal value. If it was interpreted as a decimal 
value, it would subtract 800 minutes, which is no use to anyone. 
Numeric offsets are supposed to work inside the strtotime string param, 
according to the docs.

Much of the point of using zone names rather than fixed numeric offsets 
is that it allows for correct daylight savings calculations (assuming 
that locale data is correct on the server).

Let me rephrase the question - how can I get the current time in a 
named time zone using strtotime and without using a numeric offset?

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: phpeclipse ide question

2005-01-18 Thread David Robley
On Wed, 19 Jan 2005 00:08, Benjamin Edwards wrote:

> After the discussion about editors I have installed phpeclipse. It seems
> to work well and looks great.  However I am having slight problem.
> 
> Whenever I save a file it seems to try to launch a browser, anyway it
> comes up with a message saying something like 'unable to launch external
> browser.  Please set up your external browser in browser preferences.  It
> also launches an internal browser which is blank and if I type a URL in I
> get nothing.
> 
> I have found a place to set up browsers and have both firefox and mozilla
> setup (I think) but am not sure wether I have set this up correctly (seems
> I have not).  So my questions are.
> 
> 1) where exactly and how do I set up an external browser to launch when I
> save a .PHP file.
> 
> 2) How can I get the internal browser working, do I need to set up some
> stuff.
> 
> 3) How do I turn off the auto launch when I save a .PHP file and if I do
> this how do I manually launch it in the internal/external browser.
> 
> In fact launching the .PHP file from eclipse is of limited use as most of
> my pages require URL parameters.  So another question is
> 
> 4)   Is there a way to set up testing URL (with ?/& parameters) for a .PHP
> file and is it possible to set up such a thing that calls a post  to the
> file.
> 
> I know having a browser open and switching between eclipse is a totally
> good work around but this would be great.

I suspect you may find the answers here:

http://www.phpeclipse.de/tiki-forums.php


-- 
David Robley

2400 Baud makes you want to get out and push!!

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



Re: [PHP] Re: Writing static file from dynamic PHP page

2005-01-18 Thread Graham Cossey
On 18 Jan 2005 04:05:27 -, Matthew Weier O'Phinney
<[EMAIL PROTECTED]> wrote:
> * Chris Bruce <[EMAIL PROTECTED]>:
> > I am looking for a way to write to a file what the browser would see
> > (raw html) when viewing a dynamic PHP page. I have numerous include
> > files, MySQL db queries, loops etc. and I want to generate the static
> > result of that file and save it as an html page. I have toyed a little
> > with output buffering to no avail.
> 
> The key to doing this sort of thing is to *NOT* echo everything as you
> receive it. Store content in variables and echo once you've finished.
> 
> If this is not an option, I've seen any number of good threads on using
> output buffering in recent weeks on this list; peruse them, see what has
> worked for others, and try those methods; if they don't work, ask the
> list for help -- and include that information (what you tried, what you
> expected, what you received).
> 
> If it *is* an option, Cache_Lite from PEAR is an excellent class for
> doing exactly what you're trying to do.
> 
I did some 'playing' in this area a little while ago, with some
success, but did not complete it due to some other technical
difficulties that I did not have time to resolve. Anyhow, I was saving
the buffered output as an MD5'd name including session variables and
the requested URL string to ensure that the effect of session
variables was taken into consideration. The code may help.

The code was:  

(please excuse any poor coding, I've only been doing PHP a year)

status == 'new') // Did not exist
  {
ob_start();  // Start output buffering

  }else{
echo $static->html;
exit();
  }

// Page processing here

$str = ob_get_contents();
//Save static html
$static->save_html($str);
ob_flush();

?>

 includes/staticHtml.inc.php 
$static_path = "/static";
$ssn = implode('_',$session);
$this->hash = md5($fullUrl.$ssn);;
$this->find_html();
}

function find_html() 
{
$path = $this->$static_path.$this->hash.'.htm';
if (file_exists($path))
{
$this->html = file_get_contents($path);
$this->status = 'old';
}else{
$this->status = 'new';
}
}

function save_html($str) 
{
if ($this->find_html() != 'old')
{
// save html
$path = $this->$static_path.$this->hash.'.htm';
$fp = fopen($path,'w');
$sts = fwrite($fp,$str);
fclose($fp);
}
}
}
?>

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



[PHP] Re: phpeclipse ide question

2005-01-18 Thread Benjamin Edwards
>>> David Robley <[EMAIL PROTECTED]> 01/18/05 01:38pm >>>
On Wed, 19 Jan 2005 00:08, Benjamin Edwards wrote:
>>
>> After the discussion about editors I have installed phpeclipse. It seems
>> to work well and looks great.  However I am having slight problem.
...
>> I know having a browser open and switching between eclipse is a totally
>> good work around but this would be great.
>
> I suspect you may find the answers here:
>
> http://www.phpeclipse.de/tiki-forums.php 


I wish;)  Looked there last night and posted a question - no joy, thats why I 
am trying here.

Ben
-- 
David Robley

2400 Baud makes you want to get out and push!!

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


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


__
This email and any files transmitted with it are confidential. It is for the 
intended recipient only. If you have received the email in error please notify 
the author by replying to this email. If you are not the intended recipient, 
you must not disclose, distribute, copy, print, or rely on this email. Any 
views expressed by an individual within this email which do not constitute or 
record professional advice relating to the RNLI, do not necessarily reflect the 
views of the organisation.

Registered Charity Number 209603

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



Re: [PHP] strtotime time zone trouble

2005-01-18 Thread Tom
Marcus Bointon wrote:
On 18 Jan 2005, at 10:53, Tom wrote:
PST = UTC - 8, therefore if you ask for strtotime in PST it will give 
you  now + 8. This is standard in most languages, you are just 
reading the functionality back to front.
ie when you say strtotome('now PST'), what you are asking for is the 
current local time (UTC in your instance) given an input date in PST

OK, I see some logic in that - now how to work around it?
try
print date('Y-m-d H:i:s', strtotime('now') -0800)."\n";

sorry, wrong language, you need
echo "full date PST is ", date('Y-m-d H:i:s', strtotime('now -8 
hours')), "";
If you define the constants in another file, then you can use them wherever
eg $PST = -8;
...
$dateString = 'now '.$PST.' hours';
echo "full date PST is ", date('Y-m-d H:i:s', strtotime($dateString)), 
"";

Tom
That definitely won't work; -0800 will be interpreted as an octal 
value, but it's not a legal value. If it was interpreted as a decimal 
value, it would subtract 800 minutes, which is no use to anyone. 
Numeric offsets are supposed to work inside the strtotime string 
param, according to the docs.

Much of the point of using zone names rather than fixed numeric 
offsets is that it allows for correct daylight savings calculations 
(assuming that locale data is correct on the server).

Let me rephrase the question - how can I get the current time in a 
named time zone using strtotime and without using a numeric offset?

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


RE: [PHP] phpeclipse ide question

2005-01-18 Thread Jay Blanchard
[snip]
1) where exactly and how do I set up an external browser to launch when
I save a .PHP file.
[/snip]

Under PHPEclipse Web Development -> Browser Configuration this lists the
browsers available
Under PHPEclipse Web Development -> Browser Preview Defaults check
"Refresh PHP browser..." this should autmatically open the selected
browser

[snip]
2) How can I get the internal browser working, do I need to set up some
stuff.
[/snip]

Not sure, but I believe that you need a local web server running.

[snip]
3) How do I turn off the auto launch when I save a .PHP file and if I do
this how do I manually launch it in the internal/external browser.
[/snip]

See above for turning off. To manually launch it you would open the web
browser and enter the address of the file.

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



Re: [PHP] Writing static file from dynamic PHP page

2005-01-18 Thread Chris Bruce
sorry for the repost, but my mail server was down from about 11pmEST 
last night to 9:15am this morning and unable to receive responses. Can 
someone forward me responses to this post if any? Thanks. Chris

Hi,
I am looking for a way to write to a file what the browser would see
(raw html) when viewing a dynamic PHP page. I have numerous include
files, MySQL db queries, loops etc. and I want to generate the static
result of that file and save it as an html page. I have toyed a little
with output buffering to no avail.
Is there an easy way to do this?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] NT Auto Authentication?

2005-01-18 Thread tg-php
Ok, I think the other response you got is mostly right, but I don't think it's 
clear what you're trying to do.

If you enable NTLM authentication on the web server, then you can have the 
user's browser send the authenticated username to the web server.  You'd do 
that like this:

1. On your web server (I think IIS is the only one that supports it right now 
but not 100% sure), turn OFF Anonymous authentication and Basic Authentication. 
 The third option is Windows Integrated Authentication aka NTLM (I forget the 
exact names of the settings, but you'll see what I'm talking about when you go 
into IIS).

2. The remove user has to be logged into the domain that the web server belongs 
to.  This will only work via a domain login, not just any local user login or 
something like that and I believe that they both need to be on the same domain.

3. Use either the $_ENV["AUTH_USER"] or ..err.. there was another variable, I 
forget.  Anyway, that'll get the user's username, but not any password 
information or anything.  The only way for this variable to populate is for 
them to log into the domain though, so you should be able to trust it as "This 
is actually who logged in and they definitely logged in with the proper 
credentials".


If you're trying to get the user to log into the domain THROUGH the web server, 
then that's another story altogether.

If this isn't what you're trying to do, you might look into LDAP or something 
possibly.

More details might be useful if you'd like to post them.

-TG

= = = Original message = = =

Anybody figured out how to auto authenticate into a windows server? I 
need to have some users log through NT Authentication on their browser 
without typing their username and password. I was wondering if I could 
use PHP + COM or something like that but I can't find anything. I have 
found some scripts that validate against NTLM but I have not been able 
to find a script that would actually validate the browser/session 
against a NT server. Help!

-- 
Adrian Madrid
HyperX Inc. 
Mobile: 801.815.1870
Office: 801.566.0670 
[EMAIL PROTECTED] 
www.hyperxmedia.com 

9000 S. 45 W.
Sandy, UT 84070


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



[PHP] Delay at first use of OpenSSL functions

2005-01-18 Thread Vladas Shukevichus
Hello, Gents,
When I use any OpenSSL encryption/decryption function (like
openssl_seal, openssl_open, openssl_public_encrypt,
openssl_private_decrypt, etc.) it takes very long time to execute, 
when
it has been called in a first time. After that other function calls
performs very fast in the same script.
[18 Jan 1:23am CET] [EMAIL PROTECTED]:
Not a php bug; the openssl libraries are gathering entropy on that 
first
hit.
How can I prevent this? All scripts executes a second longer, if 
there are any OpenSSL function.
Reproduce code:
---
$btime = microtime(true);
openssl_seal('Some information', $sealed, $ekeys, 
array(openssl_get_publickey('file://C:\512.pub')));
echo 'Time:  '.(microtime(true) - $btime);
$btime = microtime(true);
openssl_seal('Some information', $sealed, $ekeys, 
array(openssl_get_publickey('file://C:\1024.pub')));
echo 'Time:  '.(microtime(true) - $btime);
Expected result:

Time: 0.00
Time: 0.00075888633728
Actual result:
--
Time: 0.969028949738
Time: 0.00075888633728

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



Re: [PHP] PHP application for knowledge management?

2005-01-18 Thread Justin French
On 18/01/2005, at 10:08 AM, Murray @ PlanetThoughtful wrote:
Just wondering if anyone can recommend an open php source application
suitable for knowledge management for a small development team? We 
have 3
coders with different responsibilities, but often have to cover each 
other
if unexpected things happen. We're hoping to implement a knowledge
management tool of some sort in which we can store business logic, code
snippets, back-end table / stored procedure descriptions and so forth. 
We're
hoping to find something that allows us to extensively categorize / 
keyword
entries, in which content is easy to maintain, expand etc, and which 
has
extensive search capabilities. Our ultimate (if perhaps unlikely) goal 
is to
be able to place a new coder into our environment with a tool that 
enables
him or her to get up to speed with our environment in the shortest time
possible.
This just sounds like a Wiki to me, and there are tons of PHP Wikis 
available.  As far as Wikis go, I really like Instiki 
 (although it's in Ruby, not PHP).  While we're 
talking about Ruby there's also a commercial/hosted service called 
Basecamp  built using Ruby and the Rails 
framework.

You could also bend Textpattern  (a PHP based 
Open-source CMS/blog tool which has been in Gamma and RC forever, but 
is slated for 1.0 in the next few days) into such a beast as well.  
Actually, Textpattern makes a great candidate because of it's keywords, 
excerpts and decent searching.

I'm managing all my collaborative projects in one of two ways:
- basecamp
- instiki or some other wiki
---
Justin French, Indent.com.au
[EMAIL PROTECTED]
Web Application Development & Graphic Design
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHPED PHP IDE (wasRe: [PHP] php editor)

2005-01-18 Thread Lester Caine
Benjamin Edwards wrote:
Whats the story with this.  It seems too good to be true. A fully featured IDE/Debugger released under some sort of free software licence. The site you link to seems indicate that is is free software, it has a sourceforge.net logo at the botton.  However nuspere are selling it for £299.  what is the story?
PhpED is not free
http://dd.cron.ru/dbg/downloads.php 
That is the debugger only, and is used by PhpED amongst others - there 
is no IDE with the debugger.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread M. Sokolewicz
didn't you read what wez said? they're gathering entropy... you *can't* 
(and shouldn't want to) prevent that.

Vladas Shukevichus wrote:
Hello, Gents,
When I use any OpenSSL encryption/decryption function (like
openssl_seal, openssl_open, openssl_public_encrypt,
openssl_private_decrypt, etc.) it takes very long time to execute, 
when
it has been called in a first time. After that other function calls
performs very fast in the same script.
[18 Jan 1:23am CET] [EMAIL PROTECTED]:
Not a php bug; the openssl libraries are gathering entropy on that 
first
hit.
How can I prevent this? All scripts executes a second longer, if 
there are any OpenSSL function.
Reproduce code:
---
$btime = microtime(true);
openssl_seal('Some information', $sealed, $ekeys, 
array(openssl_get_publickey('file://C:\512.pub')));
echo 'Time:  '.(microtime(true) - $btime);
$btime = microtime(true);
openssl_seal('Some information', $sealed, $ekeys, 
array(openssl_get_publickey('file://C:\1024.pub')));
echo 'Time:  '.(microtime(true) - $btime);
Expected result:

Time: 0.00
Time: 0.00075888633728
Actual result:
--
Time: 0.969028949738
Time: 0.00075888633728
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] strtotime time zone trouble

2005-01-18 Thread M. Sokolewicz
Marcus Bointon wrote:
On 18 Jan 2005, at 10:53, Tom wrote:
PST = UTC - 8, therefore if you ask for strtotime in PST it will give 
you  now + 8. This is standard in most languages, you are just reading 
the functionality back to front.
ie when you say strtotome('now PST'), what you are asking for is the 
current local time (UTC in your instance) given an input date in PST

OK, I see some logic in that - now how to work around it?
try
print date('Y-m-d H:i:s', strtotime('now') -0800)."\n";

That definitely won't work; -0800 will be interpreted as an octal value, 
but it's not a legal value. If it was interpreted as a decimal value, it 
would subtract 800 minutes, which is no use to anyone.
actually, it would be 800 seconds (in octal, which is a non-existent 
number (like saying A in decimal, or 2 in binary)).

 Numeric offsets
are supposed to work inside the strtotime string param, according to the 
docs.

Much of the point of using zone names rather than fixed numeric offsets 
is that it allows for correct daylight savings calculations (assuming 
that locale data is correct on the server).

Let me rephrase the question - how can I get the current time in a named 
time zone using strtotime and without using a numeric offset?

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


Re: [PHP] strtotime time zone trouble

2005-01-18 Thread M. Sokolewicz
Tom wrote:
Marcus Bointon wrote:
On 18 Jan 2005, at 10:53, Tom wrote:
PST = UTC - 8, therefore if you ask for strtotime in PST it will give 
you  now + 8. This is standard in most languages, you are just 
reading the functionality back to front.
ie when you say strtotome('now PST'), what you are asking for is the 
current local time (UTC in your instance) given an input date in PST

OK, I see some logic in that - now how to work around it?
try
print date('Y-m-d H:i:s', strtotime('now') -0800)."\n";

sorry, wrong language, you need
echo "full date PST is ", date('Y-m-d H:i:s', strtotime('now -8 
hours')), "";
If you define the constants in another file, then you can use them wherever
eg $PST = -8;
I do hope you mean variable and not constant here...
...
$dateString = 'now '.$PST.' hours';
echo "full date PST is ", date('Y-m-d H:i:s', strtotime($dateString)), 
"";

Tom
That definitely won't work; -0800 will be interpreted as an octal 
value, but it's not a legal value. If it was interpreted as a decimal 
value, it would subtract 800 minutes, which is no use to anyone. 
Numeric offsets are supposed to work inside the strtotime string 
param, according to the docs.

Much of the point of using zone names rather than fixed numeric 
offsets is that it allows for correct daylight savings calculations 
(assuming that locale data is correct on the server).

Let me rephrase the question - how can I get the current time in a 
named time zone using strtotime and without using a numeric offset?

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


Re: [PHP] Re: PHPED PHP IDE (wasRe: [PHP] php editor)

2005-01-18 Thread Ben Edwards
On Tue, 18 Jan 2005 15:20:56 +, Lester Caine <[EMAIL PROTECTED]> wrote:
> Benjamin Edwards wrote:
> 
> > Whats the story with this.  It seems too good to be true. A fully featured 
> > IDE/Debugger released under some sort of free software licence. The site 
> > you link to seems indicate that is is free software, it has a 
> > sourceforge.net logo at the botton.  However nuspere are selling it for 
> > £299.  what is the story?
> 
> PhpED is not free
> 
> > http://dd.cron.ru/dbg/downloads.php
> 
> That is the debugger only, and is used by PhpED amongst others - there
> is no IDE with the debugger.

I thought Zend Studio was a IDE with a debugger?

Ben
> 
> --
> Lester Caine
> -
> L.S.Caine Electronic Services
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

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



Re: [PHP] Re: Persistent PHP web application?

2005-01-18 Thread M Saleh EG
What I mean by Application-Scope variables is  variables that can be
available for the Application or Web-Application all the time after
starting the application by a trigger. After having the triger fired
those Application-Scope Variables, Datastructures, Object, and
refrences would be available for all the requests. That's how I'd
equate persistant PHP-Applications to having Application-Scope PHP
variables.

A lame Example to illustrate the purpose of Application-Scope
variables would be the persistant DB connections. Not 100% the same
but it's for the same purpose

So if you could have a huge object persistant( Application-Scope
object ) that does alot of work for you then that object is a PHP
persistant application which I call Application-Scope var or object !

Hope that clears it out.


On Tue, 18 Jan 2005 11:10:29 +0100, Zouari Fourat <[EMAIL PROTECTED]> wrote:
> can u explain a bit more : The answer would be Application-Scope
> vars wish we had it in PHP
> 
> On Tue, 18 Jan 2005 02:42:46 +0400, M Saleh EG <[EMAIL PROTECTED]> wrote:
> > The answer would be Application-Scope vars wish we had it in PHP
> >
> > M.Saleh.E.G
> > 97150-4779817
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 


-- 
M.Saleh.E.G
97150-4779817

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



Re: [PHP] Re: PHPED PHP IDE (wasRe: [PHP] php editor)

2005-01-18 Thread Lester Caine
Ben Edwards wrote:
Whats the story with this.  It seems too good to be true. A fully featured IDE/Debugger released under some sort of free software licence. The site you link to seems indicate that is is free software, it has a sourceforge..net logo at the botton.  However nuspere are selling it for £299.  what is the story?
PhpED is not free
http://dd.cron.ru/dbg/downloads.php
That is the debugger only, and is used by PhpED amongst others - there
is no IDE with the debugger.
I thought Zend Studio was a IDE with a debugger?
???
http://www.zend.com/store/products/zend-studio.php
That's not PhpED either and it's not free.
The debugger is an element a number of people use. We use it in 
PHPEclipse as well. Versions of the DEBUGGER are free, but there are 
also 'improved' versions that are not, integrated into other IDE's

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHPED PHP IDE

2005-01-18 Thread tg-php
One minor correction.  Zend Studio is not available as a complete product for 
free, but the last time I used it they let you use most of the functionality 
for free, just disabled some of the advanced functions unless you paid.  You 
just needed to get a new freeware license every 30 days or so.

Most of the functions I used were included in the free version.  It's 
definitely worth checking out.

-TG

= = = Original message = = =

Ben Edwards wrote:

>>>Whats the story with this.  It seems too good to be true. A fully featured 
>>>IDE/Debugger released under some sort of free software licence. The site you 
>>>link to seems indicate that is is free software, it has a sourceforge..net 
>>>logo at the botton.  However nuspere are selling it for ~299.  what is the 
>>>story?
>>
>>PhpED is not free
>>
>>>http://dd.cron.ru/dbg/downloads.php
>>
>>That is the debugger only, and is used by PhpED amongst others - there
>>is no IDE with the debugger.
> 
> I thought Zend Studio was a IDE with a debugger?

???
http://www.zend.com/store/products/zend-studio.php

That's not PhpED either and it's not free.

The debugger is an element a number of people use. We use it in 
PHPEclipse as well. Versions of the DEBUGGER are free, but there are 
also 'improved' versions that are not, integrated into other IDE's

-- 
Lester Caine
-
L.S.Caine Electronic Services

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


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] Re: PHPED PHP IDE (wasRe: [PHP] php editor)

2005-01-18 Thread Marco Schuler
Am Dienstag, 18. Januar 2005 16:49 schrieb Lester Caine:
> http://www.zend.com/store/products/zend-studio.php
>
> That's not PhpED either and it's not free.
>
> The debugger is an element a number of people use. We use it in
> PHPEclipse as well. Versions of the DEBUGGER are free, but there
> are also 'improved' versions that are not, integrated into other
> IDE's

Which free debugger? afaik there is only an integrated debugger in 
php3 (http://www.zend.com/manual/debugger.php).

Are you using one of DBG APD or Xdebug? Are you using Eclipse with the 
debugger on linux?

--
Cheers!
 Marco

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



[PHP] Re: Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Vladas Shukevichus
I understand it. That's why I am asking how to make my scripts run 
not 1 second (totally unacceptable), but 0.001 second. May be it's 
possible to make it work faster? May be it can gather entropy only 
once (not every time script executes).
In the same script OpenSSL gather entropy only at first function call,
 then it can execute other functions very fast, so why can't it 
perform this process once not per script execution, but per hours, or 
let's say once per PHP libraries load in memory? If it can use the 
same entrophy for many functions, why it need to gather it every time 
when script run?
18.01.2005 17:24:28
"M. Sokolewicz" <[EMAIL PROTECTED]> wrote in message
<[EMAIL PROTECTED]>

> didn't you read what wez said? they're gathering entropy... you 
*can't* 
> (and shouldn't want to) prevent that.
> 
> 
> Vladas Shukevichus wrote:
> > Hello, Gents,
> > When I use any OpenSSL encryption/decryption function (like
> > openssl_seal, openssl_open, openssl_public_encrypt,
> > openssl_private_decrypt, etc.) it takes very long time to execute,
 
> > when
> > it has been called in a first time. After that other function 
calls
> > performs very fast in the same script.
> > [18 Jan 1:23am CET] [EMAIL PROTECTED]:
> > Not a php bug; the openssl libraries are gathering entropy on 
that 
> > first
> > hit.
> > How can I prevent this? All scripts executes a second longer, if 
> > there are any OpenSSL function.
> > Reproduce code:
> > ---
> > $btime = microtime(true);
> > openssl_seal('Some information', $sealed, $ekeys, 
> > array(openssl_get_publickey('file://C:\512.pub')));
> > echo 'Time:  '.(microtime(true) - $btime);
> > $btime = microtime(true);
> > openssl_seal('Some information', $sealed, $ekeys, 
> > array(openssl_get_publickey('file://C:\1024.pub')));
> > echo 'Time:  '.(microtime(true) - $btime);
> > Expected result:
> > 
> > Time: 0.00
> > Time: 0.00075888633728
> > Actual result:
> > --
> > Time: 0.969028949738
> > Time: 0.00075888633728

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



Re: [PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Marek Kilimajer
M. Sokolewicz wrote:
didn't you read what wez said? they're gathering entropy... you *can't* 
(and shouldn't want to) prevent that.

Or get some good entropy source
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Persistent PHP web application?

2005-01-18 Thread Jochem Maas
M Saleh EG wrote:
What I mean by Application-Scope variables is  variables that can be
available for the Application or Web-Application all the time after
starting the application by a trigger. After having the triger fired
those Application-Scope Variables, Datastructures, Object, and
refrences would be available for all the requests. That's how I'd
equate persistant PHP-Applications to having Application-Scope PHP
variables.
A lame Example to illustrate the purpose of Application-Scope
variables would be the persistant DB connections. Not 100% the same
but it's for the same purpose
So if you could have a huge object persistant( Application-Scope
object ) that does alot of work for you then that object is a PHP
persistant application which I call Application-Scope var or object !
Hope that clears it out.
firstly this goes against the basic principle of 'SHARE NOTHING' that 
php is based on - so I doubt that the basic php environment will be 
changed to accomodate such a feature any time soon.

... secondly there is something like this out called SRM (Script Running 
Machine) which gives the same sort of functionality but in a different 
way (i.e. 'application scope' vars are not part of the script itself but 
run in a 'script server') - written by Direck Rethans (among others): 
try the following keywords:

PHP + SRM + Bananas (+ Rethans)
Maybe it helps you.
On Tue, 18 Jan 2005 11:10:29 +0100, Zouari Fourat <[EMAIL PROTECTED]> wrote:
can u explain a bit more : The answer would be Application-Scope
vars wish we had it in PHP
On Tue, 18 Jan 2005 02:42:46 +0400, M Saleh EG <[EMAIL PROTECTED]> wrote:
The answer would be Application-Scope vars wish we had it in PHP
M.Saleh.E.G
97150-4779817
--
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] Writing static file from dynamic PHP page

2005-01-18 Thread Richard Lynch




Chris Bruce wrote:
> sorry for the repost, but my mail server was down from about 11pmEST
> last night to 9:15am this morning and unable to receive responses. Can
> someone forward me responses to this post if any? Thanks. Chris
>
>>> Hi,
>>>
>>> I am looking for a way to write to a file what the browser would see
>>> (raw html) when viewing a dynamic PHP page. I have numerous include
>>> files, MySQL db queries, loops etc. and I want to generate the static
>>> result of that file and save it as an html page. I have toyed a little
>>> with output buffering to no avail.
>>>
>>> Is there an easy way to do this?

Just build the site you want with PHP, and then use wget to suck down the
pages into your static directory.

Output buffering should have worked, but it's too easy for somebody else
to mess up the buffering if they want to use it for something else in
their business logic.

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

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



Re: [PHP] Textarea and Php

2005-01-18 Thread Richard Lynch
Ross Hulford wrote:
> Is there a way to add and remove lines of text to a textarea inside a
> form?

Presumably you mean based on user input like clicking on buttons and things.

By that point in time, PHP on the *server* is LONG GONE and not even in
the picture.

You'll have to use JavaScript.

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

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



Re: [PHP] Execute shell script from PHP

2005-01-18 Thread Jason Wong
On Tuesday 18 January 2005 18:59, Tom wrote:

> Khan wrote:
> > Tom wrote:
> >> shell_exec()
> >
> > yes, I have try that but nothing happenes. here is my code. Is this
> > correct?
> >
> >  > shell_exec('/test/acct.sh');
> > ?>

Note that shell_exec() expects a filesystem path and not your webserver's 
document root.

> looks fine to me, except that I tend to run a check to make sure that it
> has run ok, like
> $myReturn = shell_exec('/test/acct.sh');
> or
> if (shell_exec('/test/acct.sh');

Note also that if command executes correctly without error then 0 is returned 
and non-zero in case of errors.

-- 
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
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] Writing static file from dynamic PHP page

2005-01-18 Thread Christopher Fulton
Just an fyi...this would be VERY easy to get online.  PHP keeps an
archive of all the posts.  Here's the link

http://marc.theaimsgroup.com/?l=php-general

In fact, you may even find other posts similar to yours by searching
(that could answer your question?)

-Chris


On Tue, 18 Jan 2005 09:30:00 -0500, Chris Bruce <[EMAIL PROTECTED]> wrote:
> sorry for the repost, but my mail server was down from about 11pmEST
> last night to 9:15am this morning and unable to receive responses. Can
> someone forward me responses to this post if any? Thanks. Chris
> 
> >> Hi,
> >>
> >> I am looking for a way to write to a file what the browser would see
> >> (raw html) when viewing a dynamic PHP page. I have numerous include
> >> files, MySQL db queries, loops etc. and I want to generate the static
> >> result of that file and save it as an html page. I have toyed a little
> >> with output buffering to no avail.
> >>
> >> Is there an easy way to do this?
> 
> --
> 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] Echoing Variables Names

2005-01-18 Thread Richard Lynch
Phillip S. Baker wrote:
> Greetings All,
>
> I am generating some variable variables.
> I am interested for testing purposes in finding out the names of the
> variables that are actually being generated. Since I want to make sure
> that
> that my following conditional statements are working properly and the
> values
> are set.
>
> So is there a way to print out the name of the variables?

echo "";
var_dump($GLOBALS);
echo "";

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

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



Re: [PHP] Writing static file from dynamic PHP page

2005-01-18 Thread Jason Wong
On Tuesday 18 January 2005 22:30, Chris Bruce wrote:
> sorry for the repost, but my mail server was down from about 11pmEST
> last night to 9:15am this morning and unable to receive responses.

Unless your mailserver is seriously buggered then you _will_ receive whatever 
replies there were eventually -- internet mail is pretty robust.

> Can 
> someone forward me responses to this post if any? Thanks. Chris

archives ...

-- 
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
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] mail() function on linux

2005-01-18 Thread Richard Lynch




Nicolae Serban wrote:
> I have this code to send an e-mail !!!
>
> $ok=mail($dest, $subject, $mesaj,
>  "From: $expe\r\n"
>   ."Reply-To: $expe\r\n"
>   ."X-Mailer: PHP/" . phpversion());
>
> It works on windows, i must change something to work on linux 

No, but the Linux server's php.ini file has to set up a valid sendmail
setting which the PHP user can actually run and successfully send email...

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

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



RE: [PHP] strtotime time zone trouble

2005-01-18 Thread Michael Sims
Marcus Bointon wrote:
> Much of the point of using zone names rather than fixed numeric
> offsets is that it allows for correct daylight savings calculations
> (assuming that locale data is correct on the server).
>
> Let me rephrase the question - how can I get the current time in a
> named time zone using strtotime and without using a numeric offset?

This may not be the cleanest way to approach it, but this is what I use and it 
Works
For Me(TM):

$timeZoneMap = array(
  'EST5EDT' => 'Eastern Time',
  'CST6CDT' => 'Central Time',
  'MST7MDT' => 'Mountain Time',
  'PST8PDT' => 'Pacific Time'
);

$currentTime = time();
foreach ($timeZoneMap as $envVar => $timeZone) {
  putenv("TZ=$envVar");
  print "The current time in $timeZone is ";
  print strftime('%m/%d/%Y %I:%M:%S %p %Z', $currentTime)."\n";
}

HTH

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



Re: [PHP] Re: Persistent PHP web application?

2005-01-18 Thread Richard Lynch
M Saleh EG wrote:
> The answer would be Application-Scope vars wish we had it in PHP

Just throw them in a database.

It's a 10-line two-function PHP script you can write in 10 minutes.

Why would you want somebody else to do that for you?

[shrug]

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

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



Re: [PHP] Re: PHPED PHP IDE (wasRe: [PHP] php editor)

2005-01-18 Thread Ben Edwards
Leicter, the point I was making was that there was at least one IDE
with a debugger - you said there was not, you did not stipulate free. 
Anyway not having a go, just clearing up miscommunication.  Thanks for
the work you put into phpeclipse.  from what I have seen so far it
rocks.  BTW is there anyway of getting line numbers down the left hand
she of the source file.  Having to run the cursor up/down and look at
the current line namer is a bit fiddly.

Marco, I'me not actually using a debugger yet but was going to give
DBG a go.  what are the relative merits of DBG/Xdebug (licence/ease of
installation/functionality...).  Ime using Linux (Ubuntu/Debian).

Anyway it douse not matter if the debugger is a separate module to the
IDE as long as it is well integrated.  Actually I would prefer they
were separate - I prefer best of breed than monolithic;).

Ben

Regards,
Ben

On Tue, 18 Jan 2005 16:58:03 +0100, Marco Schuler <[EMAIL PROTECTED]> wrote:
> Am Dienstag, 18. Januar 2005 16:49 schrieb Lester Caine:
> > http://www.zend.com/store/products/zend-studio.php
> >
> > That's not PhpED either and it's not free.
> >
> > The debugger is an element a number of people use. We use it in
> > PHPEclipse as well. Versions of the DEBUGGER are free, but there
> > are also 'improved' versions that are not, integrated into other
> > IDE's
> 
> Which free debugger? afaik there is only an integrated debugger in
> php3 (http://www.zend.com/manual/debugger.php).
> 
> Are you using one of DBG APD or Xdebug? Are you using Eclipse with the
> debugger on linux?
> 
> --
> Cheers!
> Marco
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

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



Re: [PHP] $_POST array not being populated

2005-01-18 Thread Richard Lynch
Bennie Foreman wrote:
> Hi,
> I am new to the PHP world so don't give me too much grief if this has a
> simple solution.  My problem is that the $_POST array is not being
> populated.  I have created a form and the method of that form is "POST".
> I
> have started the session using session_start() but still nothing.  When I
> try to display what is in the array using print_r($_POST) all I get is
> Array().  Did I screw up the PHP configuration?
>
> PLEASE HELP!  This is driving me mad...

Are you sure you didn't just print() it instead of print_r()?...

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

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



Re: [PHP] Apache thread exploding in memory size

2005-01-18 Thread Richard Lynch
N.Z. Bear wrote:
> I am experiencing a problem with httpd child processes suddenly
> exploding in memory size and consuming all available memory. The
> behavior is sudden, not gradual: within a few seconds or a minute the
> process swells to several orders of magnitude larger than its usual
> size.

My best guess would be a run-away SQL query that has an unconstrained JOIN
in it...

If this is a new phenomenon, check any new/changed scripts for SQL joins.

> added the '%P' variable to my Apache log file and am now able to
> identify the specific requests that the Apache child process which
> explodes was handling prior to the error, but thus far no pattern has
> emerged (different scripts appear last each time). I suspect that the
> last entry I see in the log is the last successful request, not the one
> that causes the problem. (I am aware of log_forensic, which I learned
> would provide log output of a request *before* processing, but my skills
> are not sufficient to make me feel comfortable rebuilding my Apache
> server to include it at this time).

Perhaps a PHP auto_prepend script would let you catch the info you need
and log it...  Note sure the Apache child is available to PHP, but worth
looking into.

> I am working around the issue with a cron script that checks if a child
> process has exploded and then restarts Apache if needed; this helps to
> mask the issue but is obviously not a fix.

You could probably just kill -9 the one child instead of restarting them
all, as an even less intrusive temporary work-around...

Maybe even a graceful, though I suspect the run-away child wouldn't
co-operate.  Might be worth testing, might not, depending on how easily
you can get it to happen.

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

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



Re: [PHP] Obtaining the base dir of a file in a web server

2005-01-18 Thread Richard Lynch
Juan Antonio Garrido wrote:
> I use this sentence ($htmlFile = $_SERVER['DOCUMENT_ROOT'] ) for obtaining
> the
> complete route of a file in my web server, but  inserts a white space to
> final char and i need remove it. I use the trim function but it continue
> there. How can i remove it? Can it be anohter char?

There shouldn't be an extra character there, space or otherwise...

Check your httpd.conf to see what you've got.  Perhaps a typo there with
an extra space or control character that doesn't bother anything else, but
shows up in your script.

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

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



[PHP] Hidden Images.

2005-01-18 Thread Rob Adams
I've been figuring out how to create hidden images.  The concept is: when 
you highlight an image in Internet Explorer (and Mozilla too, though the 
grid is reversed) it puts a grid over the image.  If you put another image 
in between what the grid covers, you can kind of hide the image that then is 
exposed when highlighted in Internet Explorer.  You can check out a kinda of 
crappy first experiment at:

http://www.imagineinc.net/images/

Right now, I'm not sure what the best way is to hide the image better.  The 
examples I've seen of other images, you can hardly seen the 'hidden' image 
until you highlight it.  Anyone good with graphics that knows how to do 
this?  Thanks.

  -- Rob 

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



Re: [PHP] Re: Persistent PHP web application?

2005-01-18 Thread Jason Wong
On Wednesday 19 January 2005 01:01, Richard Lynch wrote:
> M Saleh EG wrote:
> > The answer would be Application-Scope vars wish we had it in PHP
>
> Just throw them in a database.
>
> It's a 10-line two-function PHP script you can write in 10 minutes.
>
> Why would you want somebody else to do that for you?
>
> [shrug]

This thread is going around in circles like a headless chicken. If anyone 
wants to respond please read previous responses to see whether you have 
anything new to contribute.

-- 
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
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] $_REQUEST or $_POST?

2005-01-18 Thread Richard Lynch
[EMAIL PROTECTED] wrote:
> I've learned to use $_REQUEST but it seems to me that it uses any $_GEt,
> or $_POST. Is it better to $_POST when I'm just using $_POST? It seems
> like that if I want "good code", but I mean is it faster with $_POST?

Not faster.

Maybe cleaner, if you only want to allow $_POST, or $_GET as appropriate.

$_REQUEST also contains all of $_COOKIES as well.

I use $_REQUEST when I *want* the script to respond to $_GET / $_POST
because I expect other folks will find it useful as either a link or FORM
from their own sites.

Guess I'm breaking some rules about the GET only retrieves though, in some
places, maybe...

Though, really, GET logs all kinds of stuff, and maybe you are
user-tracking and whatnot, plus session time-stamping all "changes" stuff,
so where does one draw the line?

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

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



Re: [PHP] $_POST

2005-01-18 Thread Richard Lynch
>  if(isset($fp['name'],$fp['pass'],$fp['blah']))

Wow!

Has isset() always allowed multiple inputs?...

When I think of all the times I've typed isset() && isset() && isset() !!!

Jeez, learn something every day.

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

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



Re: Re: [PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Vladas Shukevichus
18.01.2005 18:06:31
Marek Kilimajer <[EMAIL PROTECTED]> wrote in message
<[EMAIL PROTECTED]>

> M. Sokolewicz wrote:
> > didn't you read what wez said? they're gathering entropy... you 
*can't* 
> > (and shouldn't want to) prevent that.
> > 
> 
> Or get some good entropy source

Can you explain this a bit? How can I do this?

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



[PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread M. Sokolewicz
well, since it's the openSSL library that's gathering it, that means ou 
can't control it with PHP itself. If you want to somehow change that 
process, either modify the library, or (if it's changable via the PHP 
extension,) modify the PHP extension for openSSL. Point is, there isn't 
(AFAIK/AFAICS) no way to do it VIA php.

Vladas Shukevichus wrote:
I understand it. That's why I am asking how to make my scripts run 
not 1 second (totally unacceptable), but 0.001 second. May be it's 
possible to make it work faster? May be it can gather entropy only 
once (not every time script executes).
In the same script OpenSSL gather entropy only at first function call,
 then it can execute other functions very fast, so why can't it 
perform this process once not per script execution, but per hours, or 
let's say once per PHP libraries load in memory? If it can use the 
same entrophy for many functions, why it need to gather it every time 
when script run?
18.01.2005 17:24:28
"M. Sokolewicz" <[EMAIL PROTECTED]> wrote in message
<[EMAIL PROTECTED]>

didn't you read what wez said? they're gathering entropy... you 
*can't* 

(and shouldn't want to) prevent that.
Vladas Shukevichus wrote:
Hello, Gents,
When I use any OpenSSL encryption/decryption function (like
openssl_seal, openssl_open, openssl_public_encrypt,
openssl_private_decrypt, etc.) it takes very long time to execute,
 

when
it has been called in a first time. After that other function 
calls
performs very fast in the same script.
[18 Jan 1:23am CET] [EMAIL PROTECTED]:
Not a php bug; the openssl libraries are gathering entropy on 
that 

first
hit.
How can I prevent this? All scripts executes a second longer, if 
there are any OpenSSL function.
Reproduce code:
---
$btime = microtime(true);
openssl_seal('Some information', $sealed, $ekeys, 
array(openssl_get_publickey('file://C:\512.pub')));
echo 'Time:  '.(microtime(true) - $btime);
$btime = microtime(true);
openssl_seal('Some information', $sealed, $ekeys, 
array(openssl_get_publickey('file://C:\1024.pub')));
echo 'Time:  '.(microtime(true) - $btime);
Expected result:

Time: 0.00
Time: 0.00075888633728
Actual result:
--
Time: 0.969028949738
Time: 0.00075888633728
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Hidden Images.

2005-01-18 Thread M. Sokolewicz
Rob Adams wrote:
I've been figuring out how to create hidden images.  The concept is: when 
you highlight an image in Internet Explorer (and Mozilla too, though the 
grid is reversed) it puts a grid over the image.  If you put another image 
in between what the grid covers, you can kind of hide the image that then is 
exposed when highlighted in Internet Explorer.  You can check out a kinda of 
crappy first experiment at:

http://www.imagineinc.net/images/
Right now, I'm not sure what the best way is to hide the image better.  The 
examples I've seen of other images, you can hardly seen the 'hidden' image 
until you highlight it.  Anyone good with graphics that knows how to do 
this?  Thanks.

  -- Rob 
and this has what to do with PHP...?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Hidden Images.

2005-01-18 Thread Rob Adams
Ever heard of the gd library?  I couldn't find a newsgroup that was 
php-graphic specific, so I thought I'd try just this general one.

Anyone here familiar with gd that would know how to accomplish what I'm 
trying to do?  Thanks.

  -- Rob


"M. Sokolewicz" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Rob Adams wrote:
>
>> I've been figuring out how to create hidden images.  The concept is: when 
>> you highlight an image in Internet Explorer (and Mozilla too, though the 
>> grid is reversed) it puts a grid over the image.  If you put another 
>> image in between what the grid covers, you can kind of hide the image 
>> that then is exposed when highlighted in Internet Explorer.  You can 
>> check out a kinda of crappy first experiment at:
>>
>> http://www.imagineinc.net/images/
>>
>> Right now, I'm not sure what the best way is to hide the image better. 
>> The examples I've seen of other images, you can hardly seen the 'hidden' 
>> image until you highlight it.  Anyone good with graphics that knows how 
>> to do this?  Thanks.
>>
>>   -- Rob
> and this has what to do with PHP...? 

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



[PHP] Inconsistent behavior, same code, different server

2005-01-18 Thread Rob Tanner
Hi,

I have a php application that I developed on my RH Linux workstation running
Apache v1.3.20 and PHP v4.3.6.  The actual production system is also RH Linux
but running Apache v2.0.47 and PHP v4.3.6.  The php.ini file on both system
is the same.  The application talks to our sieve server and enables users to
setup email forwarding and vacation responses.  After the user presses the
submit, the application connects to the sieve server and correctly sets up
the filter.  This works properly on both my workstation/development system
and the production server.  The application then displays a status page
indicating whether or not forwarding was setup and the forward address, and
whether or not a vacation response was setup and the response text.  The
status display values are each based on the value of a single variable
($fmode and $vmode respectively).  On my development system, this page
displays perfectly correctly, but on the production server the status page
always displays forwarding as unset.

Granting the possibility that I may have unintentionally defined the
variables differently, what might cause them to be treated one way on my
development system and another on the production server given that the
php.ini file is the same on both systems?  Any clues?

Thanks.

-- 
Rob Tanner
UNIX Services Manager
Linfield College, McMinnville OR

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



Re: [PHP] Writing static file from dynamic PHP page

2005-01-18 Thread Chris Bruce
This is a great solution, except I cannot get PHP to exec the file that 
has the 'wget' command in it.

What I have done is to create a file (wget.php) into the directory that 
I want to wget the page into. I then chmod -R the directory to make 
everything in it executable.
here is what is written to the file:
/usr/bin/wget -d http://path/to/file/index.html

Then in the PHP function I make a an exec call on that file
exec(/path/to/file/wget.php,$out,$err);
Everything is cool, except the exec does not happen. The $out array 
looks like this:
Array
{
}
and the $err returns '126'

But the exec doesn't happen. If I run the contents of wget.php on the 
command line, presto, it works.

So, what is the deal? Is it a problem with the apache user not having 
access to wget through PHP??

On Jan 18, 2005, at 11:41 AM, Richard Lynch wrote:


Chris Bruce wrote:
sorry for the repost, but my mail server was down from about 11pmEST
last night to 9:15am this morning and unable to receive responses. Can
someone forward me responses to this post if any? Thanks. Chris
Hi,
I am looking for a way to write to a file what the browser would see
(raw html) when viewing a dynamic PHP page. I have numerous include
files, MySQL db queries, loops etc. and I want to generate the 
static
result of that file and save it as an html page. I have toyed a 
little
with output buffering to no avail.

Is there an easy way to do this?
Just build the site you want with PHP, and then use wget to suck down 
the
pages into your static directory.

Output buffering should have worked, but it's too easy for somebody 
else
to mess up the buffering if they want to use it for something else in
their business logic.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Free library for PDF functoins ???

2005-01-18 Thread Mário Gamito
Hi,
Does anyone knows of a free library to compile PHP against and have PDF 
functions support ?

Any help would be apreciated.
Warm regards,
Mário Gamito
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] anyone has successful to use a PHP SoapClient talking with .Net Web services?

2005-01-18 Thread Luis Lebron
 I recently had to get one to work. The key in my case was building the
soap message for the paramaters instead of the standard paramaters array
something like
$parameters = " 
   Username
   Password
   ";

Also, I am using the nusoap library.


Luis

-Original Message-
From: Michael Leung [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 17, 2005 9:08 PM
To: [EMAIL PROTECTED]; PHP-GEMERAL
Subject: [PHP] anyone has successful to use a PHP SoapClient talking
with .Net Web services?

Hi all,
anyone has successful to use a PHP SoapClient talking with .Net Web
services?
at this moment, that seem to no success for my testes. If anyone has
successful to do this, please tell me.

yours,
Michael

--
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: Hidden Images.

2005-01-18 Thread Rob Adams

"Jason Barnett" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Rob Adams wrote:
>> Ok - Let me restate some of this:
>>
>> I am creating these images in PHP.  I have a script right now that 
>> accepts two images.  A main one, and the one that will be hidden.  These 
>> can be either jpg, gif, or png.  It then outputs a png image like this:
>>
>> http://imagineinc.net/images/
>
> By main / hidden images, do you mean blending images together?  Because 
> what I saw from visiting this link was a background scenery with a flower 
> etc. with red, green and blue ovals on top of it.  (Firefox 1.0)

I'm curious about Firefox.  Did you try highlighting the image in it?  If I 
remember correctly, Firefox's highlight grid is the reverse of Internet 
Explorers, which is what these images were made for, though I have a flag in 
my code to reverse my grid too.  I just tried loading this in Firefox, and 
it definately doesn't have the same effect as in IE.  Try it in IE, then 
highlight the image.

Perhaps my example is so poor, noone here is understanding what I'm trying 
to do.  Checkout this link:
http://www.toccionline.com/creations/ctrla/

That is what I'm trying to do, only with whatever two images you happen to 
want to do it with, on the fly, in PHP.

>
>>
>> I really don't know much about graphics, and struggled quite a bit just 
>> getting it to this point.  I've tried several techniques to 'dim' the 
>> hidden image, or take the color out of it, but nothing has really 
>> produced what I'm after.  I'm not even sure of the terminology, but does 
>> anyone know a way to 'dim' the image or to make it blend with another 
>> image?  I'm just doing this
>
> I believe the effect you are looking for is to change the alpha value of 
> each image.  Now mind you I have never done this, but I've read posts 
> about this type of thing and I believe this function will help you:

Maybe changing the alpha value is what I want to do.  I'll have to look into 
that.  Thanks for the suggestion.

>
> http://www.php.net/manual/en/function.imagecolorallocatealpha.php
>
> As another option: if you don't need to dynamically create these blended 
> colors with PHP then why not create the images manually?  I.e. you can use 
> something like imagemagick to modify a png/gif/jpeg and then just store 
> the modified image on the server.
>
> http://www.imagemagick.org/

Because it's way cooler to just be able to pick any two images, and make it 
happen instantaneously.  I don't think anyone else has done what I'm trying 
to do yet.  They all use PhotoShop.

>
>> for fun, because I thought the concept was really cool.  I don't have 
>> access to my code right now, but can post it later today, if any else is 
>> interested.
>>
>
>
> -- 
> Teach a person to fish...
>
> Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
> PHP Manual: http://www.php.net/manual/en/index.php
> php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2 

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



Re: [PHP] Writing static file from dynamic PHP page

2005-01-18 Thread R'twick Niceorgaw
On Tue, January 18, 2005 2:42 pm, Chris Bruce said:
> This is a great solution, except I cannot get PHP to exec the file that
> has the 'wget' command in it.
>
> What I have done is to create a file (wget.php) into the directory that
> I want to wget the page into. I then chmod -R the directory to make
> everything in it executable. here is what is written to the file:
> /usr/bin/wget -d http://path/to/file/index.html
>
put this at the begining of wget.php
#!/bin/sh

HTH
-R'twick

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



[PHP] Re: Hidden Images.

2005-01-18 Thread Rob Adams
Ok - Let me restate some of this:

I am creating these images in PHP.  I have a script right now that accepts 
two images.  A main one, and the one that will be hidden.  These can be 
either jpg, gif, or png.  It then outputs a png image like this:

http://imagineinc.net/images/

I really don't know much about graphics, and struggled quite a bit just 
getting it to this point.  I've tried several techniques to 'dim' the hidden 
image, or take the color out of it, but nothing has really produced what I'm 
after.  I'm not even sure of the terminology, but does anyone know a way to 
'dim' the image or to make it blend with another image?  I'm just doing this 
for fun, because I thought the concept was really cool.  I don't have access 
to my code right now, but can post it later today, if any else is 
interested.

  -- Rob



"M. Sokolewicz" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Rob Adams wrote:
>
>> I've been figuring out how to create hidden images.  The concept is: when 
>> you highlight an image in Internet Explorer (and Mozilla too, though the 
>> grid is reversed) it puts a grid over the image.  If you put another 
>> image in between what the grid covers, you can kind of hide the image 
>> that then is exposed when highlighted in Internet Explorer.  You can 
>> check out a kinda of crappy first experiment at:
>>
>> http://www.imagineinc.net/images/
>>
>> Right now, I'm not sure what the best way is to hide the image better. 
>> The examples I've seen of other images, you can hardly seen the 'hidden' 
>> image until you highlight it.  Anyone good with graphics that knows how 
>> to do this?  Thanks.
>>
>>   -- Rob
> and this has what to do with PHP...? 

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



Re: [PHP] Re: Persistent PHP web application?

2005-01-18 Thread Rasmus Lerdorf
M Saleh EG wrote:
What I mean by Application-Scope variables is  variables that can be
available for the Application or Web-Application all the time after
starting the application by a trigger. After having the triger fired
those Application-Scope Variables, Datastructures, Object, and
refrences would be available for all the requests. That's how I'd
equate persistant PHP-Applications to having Application-Scope PHP
variables.
A lame Example to illustrate the purpose of Application-Scope
variables would be the persistant DB connections. Not 100% the same
but it's for the same purpose
So if you could have a huge object persistant( Application-Scope
object ) that does alot of work for you then that object is a PHP
persistant application which I call Application-Scope var or object !
Hope that clears it out.
For single-server multi-threaded architectures this is trivial to do, 
but it doesn't scale to the multi-server multi-process architecture PHP 
uses.

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


Re: [PHP] Re: Hidden Images.

2005-01-18 Thread Greg Donald
On Tue, 18 Jan 2005 11:03:20 -0700, Rob Adams <[EMAIL PROTECTED]> wrote:
> Ever heard of the gd library?  I couldn't find a newsgroup that was
> php-graphic specific, so I thought I'd try just this general one.
> 
> Anyone here familiar with gd that would know how to accomplish what I'm
> trying to do?  Thanks.

You might try http://www.boutell.com/gd/manual2.0.33.html#support


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



[PHP] Recursive Array Iterator

2005-01-18 Thread Gerard Samuel
Im trying to figure out how to create this.
But Im stuck in the foreach loop.
For some reason, $value in the foreach loop is not an object (Isn't is 
supposed to be?)
Any hints to get me in the right direction.
Thanks

$array = array(1 => array(2 => array(3 => array(4;
class recursiveArrayIterator extends ArrayIterator implements 
RecursiveIterator
{
   function __construct($array)
   {
   parent::__construct( $array );
   }

   function hasChildren()
   {
   }
   function getChildren()
   {
   }
}
$obj = new recursiveArrayIterator( $array );
//reflectionObject::export($obj);
foreach($obj as $value)
{
   var_dump($value);
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Re: [PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Bret Hughes
On Tue, 2005-01-18 at 11:45, Vladas Shukevichus wrote:
> 18.01.2005 18:06:31
> Marek Kilimajer <[EMAIL PROTECTED]> wrote in message
> <[EMAIL PROTECTED]>
> 
> > M. Sokolewicz wrote:
> > > didn't you read what wez said? they're gathering entropy... you 
> *can't* 
> > > (and shouldn't want to) prevent that.
> > > 
> > 
> > Or get some good entropy source
> 
> Can you explain this a bit? How can I do this?
> 

Now you  getting back to the "there are only six people in the world
that understand encryption deal" :)

entropy in these terms ( as I understand it ) is a source of randomness
used by open ssl.  I believe /dev/random is the source for this on a
linux system.  various system events cause random characters to be added
to the entropy pool that is then  accessed via /dev/random.  I rna into
this a couple of years ago setting up a freeswan link that was taking
forever (hours) to generate the keys. Turns out that since I was on a
headless scsi system there was a severe lack of entropy.  At the time,
ide hard drive activity, mouse events and possibly keyboard activity
were the primary inputs into the pool.  If your system needs a lot of
randomness there are various random number generators available.  

Do some searching, cryptogeeks take thier randomness very seriously.  I
had no idea until I ran into this.  The coolest one I found was a
lavalamp array that had a camera pointed at it and the output was
massaged to generate the random data. Last I heard, even this was being
debated as to whether it was random enough.

this is important enough that Via puts a random number generator built
into the epia boards so appliances will have enough of an entropy pool
to quickly establish vpns.

Have fun learing about it.  I did.

Having said all this, you might try moving the server mouse around
immediatly before and during the transaction to see if its faster.


HTH

Bret

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



[PHP] Re: multiple sessions on same server/domain

2005-01-18 Thread Jason Barnett
Valter Toffolo wrote:
ok i have one server with a single domain, each user have it's home
with a public_html so i get mydomain.com/~user1/ and
mydomain.com/~user2/ and so on. but each user might like to use
sessions so how can i make it work so that sessions would have each
one it's own variables and all...??
thanks, valter.
What is the problem?  If you have session support set in PHP then each 
user should be able to session_start etc.  The default session handler 
that comes with PHP will allow each user to have their own session 
variables (technically they're indices in the $_SESSION superglobal array).

Please check the PHP manual to see how to set up session support if 
that's what you're confused about.

--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Writing static file from dynamic PHP page

2005-01-18 Thread Matthew Weier O'Phinney
* Christopher Fulton <[EMAIL PROTECTED]>:
> Just an fyi...this would be VERY easy to get online.  PHP keeps an
> archive of all the posts.  Here's the link
>
> http://marc.theaimsgroup.com/?l=php-general

Also, try http://news.php.net/php.general

Though it's not currently searchable -- you can still find all posts.

> On Tue, 18 Jan 2005 09:30:00 -0500, Chris Bruce <[EMAIL PROTECTED]> wrote:
> > sorry for the repost, but my mail server was down from about 11pmEST
> > last night to 9:15am this morning and unable to receive responses. Can
> > someone forward me responses to this post if any? Thanks. Chris
> > 
> > > > Hi,
> > > >
> > > > I am looking for a way to write to a file what the browser would see
> > > > (raw html) when viewing a dynamic PHP page. I have numerous include
> > > > files, MySQL db queries, loops etc. and I want to generate the static
> > > > result of that file and save it as an html page. I have toyed a little
> > > > with output buffering to no avail.
> > > >
> > > > Is there an easy way to do this?

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] Free library for PDF functoins ???

2005-01-18 Thread Ville Mattila
Mário Gamito wrote:
Does anyone knows of a free library to compile PHP against and have PDF 
functions support ?
Sure! Take a look at http://www.ros.co.nz/pdf/ . It's a class and 
doesn't even need any library to compile. So, just include the class 
file and you'll have a PDF functions available in your very own script.

Ville

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

Re: [PHP] Re: PHPED PHP IDE (wasRe: [PHP] php editor)

2005-01-18 Thread Lester Caine
Marco Schuler wrote:
Which free debugger? afaik there is only an integrated debugger in 
php3 (http://www.zend.com/manual/debugger.php).
http://dd.cron.ru/dbg/downloads.php  was the one we are discussing - and 
this page gives the free versions available. A number of IDE's use them 
for debugging. ( I've still got PHPEdit somewhere )

Are you using one of DBG APD or Xdebug? Are you using Eclipse with the 
debugger on linux?
I have used DBG in the past, but not for a while, running through 
PHPEclipse I find it easier to drop in debug code and debug that way.
PHPEclipse can use DBG
( http://www.phpeclipse.de/tiki-index.php?page=DbgBasedDebugger )
but I have yet to try on Linux - my new Linux box is an AMD64 which adds 
to the fun running any of this ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Free library for PDF functoins ???

2005-01-18 Thread Matt M.
> Does anyone knows of a free library to compile PHP against and have PDF
> functions support ?

you could try this class

http://www.fpdf.org/

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



[PHP] Re: Hidden Images.

2005-01-18 Thread Jason Barnett
Rob Adams wrote:
Ok - Let me restate some of this:
I am creating these images in PHP.  I have a script right now that accepts 
two images.  A main one, and the one that will be hidden.  These can be 
either jpg, gif, or png.  It then outputs a png image like this:

http://imagineinc.net/images/
By main / hidden images, do you mean blending images together?  Because 
what I saw from visiting this link was a background scenery with a 
flower etc. with red, green and blue ovals on top of it.  (Firefox 1.0)

I really don't know much about graphics, and struggled quite a bit just 
getting it to this point.  I've tried several techniques to 'dim' the hidden 
image, or take the color out of it, but nothing has really produced what I'm 
after.  I'm not even sure of the terminology, but does anyone know a way to 
'dim' the image or to make it blend with another image?  I'm just doing this 
I believe the effect you are looking for is to change the alpha value of 
each image.  Now mind you I have never done this, but I've read posts 
about this type of thing and I believe this function will help you:

http://www.php.net/manual/en/function.imagecolorallocatealpha.php
As another option: if you don't need to dynamically create these blended 
colors with PHP then why not create the images manually?  I.e. you can 
use something like imagemagick to modify a png/gif/jpeg and then just 
store the modified image on the server.

http://www.imagemagick.org/
for fun, because I thought the concept was really cool.  I don't have access 
to my code right now, but can post it later today, if any else is 
interested.


--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: PHPED PHP IDE (wasRe: [PHP] php editor)

2005-01-18 Thread Lester Caine
Ben Edwards wrote:
Leicter, the point I was making was that there was at least one IDE
with a debugger - you said there was not, you did not stipulate free. 
No I said that the link was for the debugger only, and that was free but 
the IDE was not and is where NUSphere make their money. The original 
question was about the advert for PhpED on the debugger page.

Anyway not having a go, just clearing up miscommunication.  Thanks for
the work you put into phpeclipse.  from what I have seen so far it
rocks.  BTW is there anyway of getting line numbers down the left hand
she of the source file.  Having to run the cursor up/down and look at
the current line namer is a bit fiddly.
That is more of an Eclipse 'feature' - I'd like the same sort of thing ;)
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Inconsistent behavior, same code, different server

2005-01-18 Thread Michael Sims
Rob Tanner wrote:
> Granting the possibility that I may have unintentionally defined the
> variables differently, what might cause them to be treated one way on
> my development system and another on the production server given that
> the php.ini file is the same on both systems?  Any clues?

Compare the output of phpinfo() on both systems.  The php.ini's may be the 
same, but
perhaps settings are being changed somewhere else...for example in the 
httpd.conf,
.htaccess file, or ini_set().  The phpinfo() output will show all current 
settings
regardless of where they came from.

Are both servers connecting to the same Sieve server?  If not, perhaps the issue
lies there...  Of course without seeing any of your code I'm just guessing 
about how
those variables you mentioned are getting their values

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



Re: [PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Marek Kilimajer
Vladas Shukevichus wrote:
18.01.2005 18:06:31
Marek Kilimajer <[EMAIL PROTECTED]> wrote in message
<[EMAIL PROTECTED]>
M. Sokolewicz wrote:
didn't you read what wez said? they're gathering entropy... you 
*can't* 

(and shouldn't want to) prevent that.
Or get some good entropy source

Can you explain this a bit? How can I do this?
First, read about /dev/random and /dev/urandom files:
http://www.zevils.com/cgi-bin/man/man2html?random+4
And then google for hardware entropy generator
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] multiple sessions on same server/domain

2005-01-18 Thread Valter Toffolo
ok i have one server with a single domain, each user have it's home
with a public_html so i get mydomain.com/~user1/ and
mydomain.com/~user2/ and so on. but each user might like to use
sessions so how can i make it work so that sessions would have each
one it's own variables and all...??

thanks, valter.

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



Re: [PHP] Executing command in Linux

2005-01-18 Thread Richard Lynch
Rosen wrote:
> Hi,
> I have this problem:
> Linux Red Hat 7.3 server and PHP 4.3.8 & MySQL 4. When I Try to execute
> linux command - nothing happens and in Apache logs I see "Access denied".
> This is about permissions in executing this command.
>
> My question is can I execute a linux command via PHP ( this is command
> allowed only for root user ) ?
>
> P.S. I own this server - i.e. I have user & pass for root.

The PHP user is not root.

The PHP user should *NOT* be root.

Either make that command available to the PHP user, or don't use that
command.

Options for making that command available to the PHP user abound, and
include:
chmod so 'w'orld can eXecute.
Add 'php' group w/ PHP user in it, and chgrp/chmod so 'g'roup can execute.
Use sudo to allow PHP user to run that one command.

Exactly how you choose to do this depends more on your risk assessment,
skill level, and what you are doing than anything else -- None of which
are PHP-related strictly-speaking.

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

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



Re: [PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Marek Kilimajer
Bret Hughes wrote:
Having said all this, you might try moving the server mouse around
immediatly before and during the transaction to see if its faster.
Or hire a monkey :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Experiences with PHP Training in US?

2005-01-18 Thread Richard Lynch
Donald Wong wrote:
> I'm looking for a PHP training course within the US, and I'm wondering
> if have any recommendations.
>
> Specifically, I want to know if there's any courses that will cover
> using Kerberos through PHP, though I don't have too much hope in that.

At that point, for what you'd pay for a course these days, you could
probably find a PHP developer with experience in Kerberos and pay them to
teach you...

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

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



Re: [PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Bret Hughes
On Tue, 2005-01-18 at 14:34, Marek Kilimajer wrote:
> Bret Hughes wrote:
> > 
> > Having said all this, you might try moving the server mouse around
> > immediatly before and during the transaction to see if its faster.
> 
> Or hire a monkey :)

Hmm. depending on the current cost of Purina Monkey Chow, this might
yield a good cost per bit of random data.  But then there is the clean
up.  I wonder if you would have to give the monkey an account on the
box?

Bret

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



[PHP] searching and sorting

2005-01-18 Thread Brian A. Anderson
I am new(relatively) to php programing and searching. I am trying to
understand the best way to access data and deliver results to searches on a
product catalog website.

I have two kinds of data that I am sorting and displaying results for. The
first is info about specific products, and the other is text based general
information, notes, and specials that will be stored in a database as well.

My question is what is the best way to format and sort all of this info
before results delivery.

I am thinking of incrementally adding the resultant hits into two
associative arrays with the link to the data and a calculated relevance
value, and sorting this array by these relevences. One array would be for
text data links and another would be for catalog item links. If I have two
arrays(sorted), than I could display them like Amazon.com does with products
in the main display area(with pictures), and text links to the side.

Am I thinking of an efficient way to go about this, or not? I wonder if
anyone has more experience, or some suggested resources in understanding
building good search building? I would like to find such a book or resource
that maps out good search and results procedures.


-Brian

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



Re: [PHP] Re: Hidden Images.

2005-01-18 Thread Bret Hughes
On Tue, 2005-01-18 at 12:24, Rob Adams wrote:
> Ok - Let me restate some of this:
> 
> I am creating these images in PHP.  I have a script right now that accepts 
> two images.  A main one, and the one that will be hidden.  These can be 
> either jpg, gif, or png.  It then outputs a png image like this:
> 
> http://imagineinc.net/images/
> 
> I really don't know much about graphics, and struggled quite a bit just 
> getting it to this point.  I've tried several techniques to 'dim' the hidden 
> image, or take the color out of it, but nothing has really produced what I'm 
> after.  I'm not even sure of the terminology, but does anyone know a way to 
> 'dim' the image or to make it blend with another image?  I'm just doing this 
> for fun, because I thought the concept was really cool.  I don't have access 
> to my code right now, but can post it later today, if any else is 
> interested.

"dim" might refer to transparency or alpha level.  I don't know if
browsers do that but I suppose a div might have an alpha level you could
manipulate via javascript.

Bret

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



Re: [PHP] Simple question: $_POST

2005-01-18 Thread Richard Lynch
Stuart Felenstein wrote:
> When using $_POST vars is it required that a form is
> used ?
>
> In other words I can create an href link and echo
> variable and pick them up using $_GET in the following
> page.
>
> No so with $_POST ?

Google for "PostToHost and Rasmus Lerdorf" if you want to use PHP to send
POST data (IE, to "forge" filling in a FORM)

You can also use JavaScript to create a FORM, I think, and then fill in
all the stuff, and then 'submit' it, if you trust JavaScript to work right
and want to learn JavaScript enough to get it working...

You can also make your FORMs use METHOD="GET" to send the data as $_GET
instead of $_POST

I'm not sure if any of these address what you really want to know, but
they may help.

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

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



Re: [PHP] Re: Hidden Images.

2005-01-18 Thread Rob Adams
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Rob Adams wrote:
>> "Jason Barnett" <[EMAIL PROTECTED]> wrote in message 
>> news:[EMAIL PROTECTED]
>>
>>>Rob Adams wrote:
>>>
Ok - Let me restate some of this:

I am creating these images in PHP.  I have a script right now that 
accepts two images.  A main one, and the one that will be hidden.  These 
can be either jpg, gif, or png.  It then outputs a png image like this:

http://imagineinc.net/images/
>>>
>>>By main / hidden images, do you mean blending images together?  Because 
>>>what I saw from visiting this link was a background scenery with a flower 
>>>etc. with red, green and blue ovals on top of it.  (Firefox 1.0)
>>
>>
>> I'm curious about Firefox.  Did you try highlighting the image in it?  If 
>> I remember correctly, Firefox's highlight grid is the reverse of Internet 
>> Explorers, which is what these images were made for, though I have a flag 
>> in my code to reverse my grid too.  I just tried loading this in Firefox, 
>> and it definately doesn't have the same effect as in IE.  Try it in IE, 
>> then highlight the image.
>>
>> Perhaps my example is so poor, noone here is understanding what I'm 
>> trying to do.  Checkout this link:
>> http://www.toccionline.com/creations/ctrla/
>
> Click "Learn to Make Your Own" link. You need to change odd columns in odd 
> rows and even column in even rows to blue color.

Yeah, I'm doing all that.  If you checkout my first demonstration in IE, 
you'll see the main image disappear where the hidden image is when 
highlighted.

What I don't know how to do yet is to make the hidden image "disappear" into 
the main image when it's not highlighted.

  -- Rob

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



Re: [PHP] Re: Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Richard Lynch
Vladas Shukevichus wrote:
> I understand it. That's why I am asking how to make my scripts run
> not 1 second (totally unacceptable), but 0.001 second. May be it's
> possible to make it work faster? May be it can gather entropy only
> once (not every time script executes).
> In the same script OpenSSL gather entropy only at first function call,
>  then it can execute other functions very fast, so why can't it
> perform this process once not per script execution, but per hours, or
> let's say once per PHP libraries load in memory? If it can use the
> same entrophy for many functions, why it need to gather it every time
> when script run?

You could, in theory, write some kind of PHP script that runs forever, and
provides the functionality you need through sockets or shared memory or,
if you already have a database connection on every page anyway, the
database, or...

I don't know that any of those are going to actually be fast enough to
stay under the 1 second mark, much less your goal of 0.001 seconds...

It's also possible that some compile-time settings of mcrypt may or may
not provide you with faster entropy, possibly with 'less' entropy and a
concommitant decrease in the actual security of mcrypt -- And, for all I
know, those super-special hardware devices that can be used with mcrypt
will be super duper fast and that's why they exist:  To solve this
problem.

You may, or may not, be able to find an mcrypt module of Apache, which,
possibly, would initialize the entropy once when each httpd starts up, and
PHP can just glom onto that entropy-ness and not spend 1.0 seconds doing
it.

Or, possibly, you could try to write a custom module in PHP that would
load up the entropy just once.

It's also ENTIRELY possible that doing any of these things will make your
mcrypt completely unsuitable for the purpose it was intended.

You'd need about 10 years of study to figure that out for sure... Good Luck.

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

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



Re: [PHP] Re: Hidden Images.

2005-01-18 Thread Marek Kilimajer
Rob Adams wrote:
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Rob Adams wrote:
"Jason Barnett" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]


Rob Adams wrote:

Ok - Let me restate some of this:
I am creating these images in PHP.  I have a script right now that 
accepts two images.  A main one, and the one that will be hidden.  These 
can be either jpg, gif, or png.  It then outputs a png image like this:

http://imagineinc.net/images/
By main / hidden images, do you mean blending images together?  Because 
what I saw from visiting this link was a background scenery with a flower 
etc. with red, green and blue ovals on top of it.  (Firefox 1.0)

I'm curious about Firefox.  Did you try highlighting the image in it?  If 
I remember correctly, Firefox's highlight grid is the reverse of Internet 
Explorers, which is what these images were made for, though I have a flag 
in my code to reverse my grid too.  I just tried loading this in Firefox, 
and it definately doesn't have the same effect as in IE.  Try it in IE, 
then highlight the image.

Perhaps my example is so poor, noone here is understanding what I'm 
trying to do.  Checkout this link:
http://www.toccionline.com/creations/ctrla/
Click "Learn to Make Your Own" link. You need to change odd columns in odd 
rows and even column in even rows to blue color.

Yeah, I'm doing all that.  If you checkout my first demonstration in IE, 
you'll see the main image disappear where the hidden image is when 
highlighted.

What I don't know how to do yet is to make the hidden image "disappear" into 
the main image when it's not highlighted.
I guess you want to interpolate the pixels from both images, take pixel 
color from odd columns in odd rows and even column in even rows from 
image 1 and draw it in the same pixel in image 2

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


Re: Re: Re: [PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Vladas Shukevichus
Thanks a lot for such a superb explanation!
It's clear now why OpenSSL gather entropy for such a long time, it 
just doesn't
have any external source of it.
But I still need my scripts run as fast as possible :)
There are Windows 2003 + IIS6, so there are no any dev/random device,
OpenSSL use by default...
Would you be so king to point what can be done to make OpenSSL work 
on
Windows as fast as it work on Unix with a kernel-level entropy 
source?
18.01.2005 21:20:16
Bret Hughes <[EMAIL PROTECTED]> wrote in message
<[EMAIL PROTECTED]>

> On Tue, 2005-01-18 at 11:45, Vladas Shukevichus wrote:
> > 18.01.2005 18:06:31
> > Marek Kilimajer <[EMAIL PROTECTED]> wrote in message
> > <[EMAIL PROTECTED]>
> > 
> > > M. Sokolewicz wrote:
> > > > didn't you read what wez said? they're gathering entropy... 
you 
> > *can't* 
> > > > (and shouldn't want to) prevent that.
> > > > 
> > > 
> > > Or get some good entropy source
> > 
> > Can you explain this a bit? How can I do this?
> > 
> 
> Now you  getting back to the "there are only six people in the 
world
> that understand encryption deal" :)
> 
> entropy in these terms ( as I understand it ) is a source of 
randomness
> used by open ssl.  I believe /dev/random is the source for this on 
a
> linux system.  various system events cause random characters to be 
added
> to the entropy pool that is then  accessed via /dev/random.  I rna 
into
> this a couple of years ago setting up a freeswan link that was 
taking
> forever (hours) to generate the keys. Turns out that since I was on 
a
> headless scsi system there was a severe lack of entropy.  At the 
time,
> ide hard drive activity, mouse events and possibly keyboard 
activity
> were the primary inputs into the pool.  If your system needs a lot 
of
> randomness there are various random number generators available.  
> 
> Do some searching, cryptogeeks take thier randomness very seriously.
  I
> had no idea until I ran into this.  The coolest one I found was a
> lavalamp array that had a camera pointed at it and the output was
> massaged to generate the random data. Last I heard, even this was 
being
> debated as to whether it was random enough.
> 
> this is important enough that Via puts a random number generator 
built
> into the epia boards so appliances will have enough of an entropy 
pool
> to quickly establish vpns.
> 
> Have fun learing about it.  I did.
> 
> Having said all this, you might try moving the server mouse around
> immediatly before and during the transaction to see if its faster.
> 
> 
> HTH
> 
> Bret

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



Re: [PHP] Hidden Images.

2005-01-18 Thread Richard Lynch
Rob Adams wrote:
> I've been figuring out how to create hidden images.  The concept is: when
> you highlight an image in Internet Explorer (and Mozilla too, though the
> grid is reversed) it puts a grid over the image.  If you put another image
> in between what the grid covers, you can kind of hide the image that then
> is
> exposed when highlighted in Internet Explorer.  You can check out a kinda
> of
> crappy first experiment at:
>
> http://www.imagineinc.net/images/

In Netscape, the image doesn't really leap out nearly as much as IE...

Didn't try Mozilla (et al) though to compare those.

> Right now, I'm not sure what the best way is to hide the image better.
> The
> examples I've seen of other images, you can hardly seen the 'hidden' image
> until you highlight it.  Anyone good with graphics that knows how to do
> this?  Thanks.

I think "better" depends on what your Business Application goal is...

Security?
Examples of on-line visual perception oddities?
.
.
.

If you provide links to other images, perhaps we could tell you how they
were done...

Is there some PHP in here, generating the images dynamically, hopefully...?

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

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



Re: [PHP] Inconsistent behavior, same code, different server

2005-01-18 Thread Richard Lynch
Rob Tanner wrote:
> I have a php application that I developed on my RH Linux workstation
> running
> Apache v1.3.20 and PHP v4.3.6.  The actual production system is also RH
> Linux
> but running Apache v2.0.47 and PHP v4.3.6.  The php.ini file on both
> system
> is the same.  The application talks to our sieve server and enables users
> to
> setup email forwarding and vacation responses.  After the user presses the
> submit, the application connects to the sieve server and correctly sets up
> the filter.  This works properly on both my workstation/development system
> and the production server.  The application then displays a status page
> indicating whether or not forwarding was setup and the forward address,
> and
> whether or not a vacation response was setup and the response text.  The
> status display values are each based on the value of a single variable
> ($fmode and $vmode respectively).  On my development system, this page
> displays perfectly correctly, but on the production server the status page
> always displays forwarding as unset.
>
> Granting the possibility that I may have unintentionally defined the
> variables differently, what might cause them to be treated one way on my
> development system and another on the production server given that the
> php.ini file is the same on both systems?  Any clues?

First, use  to confirm 100% that the php.ini file you
think is loading is actually loading.

Next, be sure your Apache was restarted.

Finally, I'd look (maybe even grep) for some kind of auto_prepend script
or bug or something odd with the name 'fmode' outside of your scripts.

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

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



Re: [PHP] Writing static file from dynamic PHP page

2005-01-18 Thread Richard Lynch
Chris Bruce wrote:
> This is a great solution, except I cannot get PHP to exec the file that
> has the 'wget' command in it.
>
> What I have done is to create a file (wget.php) into the directory that
> I want to wget the page into. I then chmod -R the directory to make
> everything in it executable.
> here is what is written to the file:
> /usr/bin/wget -d http://path/to/file/index.html
>
> Then in the PHP function I make a an exec call on that file
> exec(/path/to/file/wget.php,$out,$err);
>
> Everything is cool, except the exec does not happen. The $out array
> looks like this:
> Array
> {
> }
> and the $err returns '126'
>
> But the exec doesn't happen. If I run the contents of wget.php on the
> command line, presto, it works.
>
> So, what is the deal? Is it a problem with the apache user not having
> access to wget through PHP??

Almost for sure, yes.

Though you've now made it even more complex, because maybe the PHP user
doesn't have eXec priveleges for your 'wget.php' file, in addition to not
having eXec priveleges to 'wget' in /usr/bin

Plus, having PHP able to write the file, and PHP able to eXec the file,
wget.php, would be a pretty gaping security hole on a shared server...

You've got to make it possible for the PHP user to:
A) eXec wget
B) Write into the output directory wget will use

Honestly, though, wget is *SO* easy, you may want to bypass PHP for that
part of it anyway -- A cron job to wget the site or a simple shell script
might be easier to work with than running PHP to run wget...

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

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



Re: [PHP] Re: Hidden Images.

2005-01-18 Thread Marek Kilimajer
Rob Adams wrote:
"Jason Barnett" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Rob Adams wrote:
Ok - Let me restate some of this:
I am creating these images in PHP.  I have a script right now that 
accepts two images.  A main one, and the one that will be hidden.  These 
can be either jpg, gif, or png.  It then outputs a png image like this:

http://imagineinc.net/images/
By main / hidden images, do you mean blending images together?  Because 
what I saw from visiting this link was a background scenery with a flower 
etc. with red, green and blue ovals on top of it.  (Firefox 1.0)

I'm curious about Firefox.  Did you try highlighting the image in it?  If I 
remember correctly, Firefox's highlight grid is the reverse of Internet 
Explorers, which is what these images were made for, though I have a flag in 
my code to reverse my grid too.  I just tried loading this in Firefox, and 
it definately doesn't have the same effect as in IE.  Try it in IE, then 
highlight the image.

Perhaps my example is so poor, noone here is understanding what I'm trying 
to do.  Checkout this link:
http://www.toccionline.com/creations/ctrla/
Click "Learn to Make Your Own" link. You need to change odd columns in 
odd rows and even column in even rows to blue color.

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


Re: [PHP] Re: multiple sessions on same server/domain

2005-01-18 Thread Marek Kilimajer
Jason Barnett wrote:
Valter Toffolo wrote:
ok i have one server with a single domain, each user have it's home
with a public_html so i get mydomain.com/~user1/ and
mydomain.com/~user2/ and so on. but each user might like to use
sessions so how can i make it work so that sessions would have each
one it's own variables and all...??
thanks, valter.

What is the problem?  If you have session support set in PHP then each 
user should be able to session_start etc.  The default session handler 
that comes with PHP will allow each user to have their own session 
variables (technically they're indices in the $_SESSION superglobal array).

Please check the PHP manual to see how to set up session support if 
that's what you're confused about.

The problem is with cookies being common for all user directories.
Each user should use session_set_cookie_params() to set the cookie path 
to its own directory. And use of session_regenerate_id() is a must, else 
user1 can set the cookie path to /~user2/ with lifetime till 2038 and...

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


Re: [PHP] Re: Hidden Images.

2005-01-18 Thread Richard Lynch
Rob Adams wrote:
> "Jason Barnett" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Rob Adams wrote:
>>> Ok - Let me restate some of this:
>>>
>>> I am creating these images in PHP.  I have a script right now that
>>> accepts two images.  A main one, and the one that will be hidden.
>>> These
>>> can be either jpg, gif, or png.  It then outputs a png image like this:
>>>
>>> http://imagineinc.net/images/
>>
>> By main / hidden images, do you mean blending images together?  Because
>> what I saw from visiting this link was a background scenery with a
>> flower
>> etc. with red, green and blue ovals on top of it.  (Firefox 1.0)
>
> I'm curious about Firefox.  Did you try highlighting the image in it?  If
> I
> remember correctly, Firefox's highlight grid is the reverse of Internet
> Explorers, which is what these images were made for, though I have a flag
> in
> my code to reverse my grid too.  I just tried loading this in Firefox, and
> it definately doesn't have the same effect as in IE.  Try it in IE, then
> highlight the image.
>
> Perhaps my example is so poor, noone here is understanding what I'm trying
> to do.  Checkout this link:
> http://www.toccionline.com/creations/ctrla/
>
> That is what I'm trying to do, only with whatever two images you happen to
> want to do it with, on the fly, in PHP.

I'm assuming you've read this:
http://www.toccionline.com/creations/ctrla/how.html

The only part of that which is pretty much non-trivial would be the part
at the end about playing with the "output levels" and maybe
"brightness/contrast" until it "looks right"

You could spend the next 50 years in AI research with specializations in
visualization trying to find the perfect algorithm for that, and still
fail -- Which is about where the state of the art in AI research with
specializations in visualization is today :-)
[Apologies for this "dig" at my colleagues]

You might, however, want to do some light reading in that arena to see if
there are some simple heuristics you can "steal" to know what to do to the
image you are trying to hide.

I believe that for Firefox/Mozilla, you simply need to switch the grid
around and color-code the "other" pixels the same way, so that should be
do-able.

Bottom line, though, is that even though you are doing this in PHP, you're
basically asking a Visualization Expert question...  Might as well ask us
about brain surgery, when you get right down to it.  Somebody here *might*
know the answer...  Sorry.

Some general principles that seem to be implied from my reading of that page:

The primary (un-hidden) image should be "busy" and not have large chunks
of all-the-same color.  That makes me think JPEG might be the better
output format, though perhaps JPEG would actually muck up all the pixels
you're trying to hide in the first place...

The "hidden" image should be less busy, with larger chunks of the same
color, I suspect.

Alpha-blending the hidden image down to 50% may well prove to be a cheat
to get the desired goal for a general image.

I don't think you're EVERY going to get satisfactory results for two
randomly-selected arbitrary images.  If the "hidden" image is too busy,
and the "visible" image is too not-busy, you're going to end up with the
hidden image pushing through too much.

NOTE: The entire second half of this post was all guess-work.  YMMV.

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

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



[PHP] Windows CLI and task scheduler

2005-01-18 Thread Dominic Schanen
I've written several command line scripts to run as scheduled tasks on a 
Windows 2000 Server machine. They run fine, no problems. However, the 
application log is filling up with errors stating that windows was 
unable to unload my registry profile. I know the PHP scripts are at 
fault because the errors are being recorded at the same intervals as my 
scheduled tasks.

I installed UPHClean to cleanup the unloaded profiles but that simply 
doubles the number of log entries created.

I was wondering if anyone else has run into this problem? Is this a task 
scheduler problem or a PHP problem? If it is a task scheduler problem, 
is there something I can do by exiting or closing differently in PHP?

I have PHP 5.0.3 and am using php-win.exe
Thanks,
Dominic
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Delay at first use of OpenSSL functions

2005-01-18 Thread Marek Kilimajer
Vladas Shukevichus wrote:
Thanks a lot for such a superb explanation!
It's clear now why OpenSSL gather entropy for such a long time, it 
just doesn't
have any external source of it.
But I still need my scripts run as fast as possible :)
There are Windows 2003 + IIS6, so there are no any dev/random device,
OpenSSL use by default...
Would you be so king to point what can be done to make OpenSSL work 
on
Windows as fast as it work on Unix with a kernel-level entropy 
source?
You have to change openssl sources to use a faster alternative and 
recompile.

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


Re: [PHP] Inconsistent behavior, same code, different server

2005-01-18 Thread Rob Tanner


--On Tuesday, January 18, 2005 02:05:59 PM -0800 Richard Lynch
<[EMAIL PROTECTED]> wrote:

> 
> First, use  to confirm 100% that the php.ini file you
> think is loading is actually loading.
> 
> Next, be sure your Apache was restarted.
> 
> Finally, I'd look (maybe even grep) for some kind of auto_prepend script
> or bug or something odd with the name 'fmode' outside of your scripts.
> 

How right thou art!  Turns out that there was more than one php.ini on the
production server and the php.ini it was using was in /usr/local/lib, and
register_globals was turned on.  Turn register_globals off, and  my problem
went away.  But as it turns out, we have to leave it on for the time being
because of legacy code that hasn't been rewritten yet.  Found that I had a
form field and a php variable with the same name.  I changed the form field
name and I'm back in business.

Many helpful clues.  Thanks to everyone who responded.


-- 
Rob Tanner
UNIX Services Manager
Linfield College, McMinnville OR

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



Re: [PHP] searching and sorting

2005-01-18 Thread Richard Lynch
Brian A. Anderson wrote:
> I am new(relatively) to php programing and searching. I am trying to
> understand the best way to access data and deliver results to searches on
> a
> product catalog website.
>
> I have two kinds of data that I am sorting and displaying results for. The
> first is info about specific products, and the other is text based general
> information, notes, and specials that will be stored in a database as
> well.
>
> My question is what is the best way to format and sort all of this info
> before results delivery.
>
> I am thinking of incrementally adding the resultant hits into two
> associative arrays with the link to the data and a calculated relevance
> value, and sorting this array by these relevences. One array would be for
> text data links and another would be for catalog item links. If I have two
> arrays(sorted), than I could display them like Amazon.com does with
> products
> in the main display area(with pictures), and text links to the side.
>
> Am I thinking of an efficient way to go about this, or not? I wonder if
> anyone has more experience, or some suggested resources in understanding
> building good search building? I would like to find such a book or
> resource
> that maps out good search and results procedures.

Unless you KNOW your site will get loads of traffic from the get-go, I'd
focus more on the SIMPLE solutions that you can maintain as a beginner.

While you can find all kinds of nifty explanations of very slick and fancy
systems, those are often written and maintained by an army of
programmers...

Also depending on the size and scale and scope of your data, I'm not sure
that two separate lists is a Good Idea.

Amazon may need it for, their zillion items they sell, but do you, really?

I've spent *DAYS* writing special search engines for data-sets that only
had 100 items in them, and would never grow significantly larger than
that.  I told my client that was pretty wasteful of their money, but
that's what they wanted. [shrug]  Pays the bills.  But that doesn't mean
you want to waste your money/time that way.

One Axiom: Keep as much of the scoring/sorting in your SQL as possible --
That's what SQL engines are best at.

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

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




Re: [PHP] Re: Hidden Images.

2005-01-18 Thread Richard Lynch
> What I don't know how to do yet is to make the hidden image "disappear"
> into
> the main image when it's not highlighted.

Sorry to double-post, but...

You MIGHT want to sit down with PhotoShop as described in the HowTo page
and select 100 images at random, and try to do it by hand.

You can keep track of your results and the quality thereof, and what you
did with each image pair to make it work.

Perhaps using phpMyAdmin to store/sort all your data and trial results, to
stay on topic :-)

After you've done a hundred by hand, knowing what to do in PHP may be
trivial.

Or at least something you can manage.

Or you'll realize just how impossible it is to generalize what to do
without having a human eyeball and human brain to do the work, which I
suspect is the case here...

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

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



Re: [PHP] Re: Persistent PHP web application?

2005-01-18 Thread M Saleh EG
There would be 10s of ways of doing this I assume... depends on which
technologies and resources you have access to.

Jochem Mass said:
>firstly this goes against the basic principle of 'SHARE NOTHING' that
>php is based on - so I doubt that the basic php environment will be
>changed to accomodate such a feature any time soon.

I kindda agree with you Jochem! that's one of the reasons where PHP
beats others in performance.

Richard Lynch said:
>Just throw them in a database.
>It's a 10-line two-function PHP script you can write in 10 minutes.
>Why would you want somebody else to do that for you?

?! I don't understand you Richard? :s How's that related? or maybe you
have a server farm fired with Oracle and 100 web servers all running
in a load balance loop.
This is about a huge application that was discussed dealing with huge
data structures... I don't know if you read the previous posts.





On Tue, 18 Jan 2005 10:20:55 -0800, Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> M Saleh EG wrote:
> > What I mean by Application-Scope variables is  variables that can be
> > available for the Application or Web-Application all the time after
> > starting the application by a trigger. After having the triger fired
> > those Application-Scope Variables, Datastructures, Object, and
> > refrences would be available for all the requests. That's how I'd
> > equate persistant PHP-Applications to having Application-Scope PHP
> > variables.
> >
> > A lame Example to illustrate the purpose of Application-Scope
> > variables would be the persistant DB connections. Not 100% the same
> > but it's for the same purpose
> >
> > So if you could have a huge object persistant( Application-Scope
> > object ) that does alot of work for you then that object is a PHP
> > persistant application which I call Application-Scope var or object !
> >
> > Hope that clears it out.
> 
> For single-server multi-threaded architectures this is trivial to do,
> but it doesn't scale to the multi-server multi-process architecture PHP
> uses.
> 
> -Rasmus
> 


-- 
M.Saleh.E.G
97150-4779817

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



Re: [PHP] Re: Hidden Images.

2005-01-18 Thread Rob Adams
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Rob Adams wrote:
>> "Jason Barnett" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>>> Rob Adams wrote:
 Ok - Let me restate some of this:

 I am creating these images in PHP.  I have a script right now that
 accepts two images.  A main one, and the one that will be hidden.
 These
 can be either jpg, gif, or png.  It then outputs a png image like this:

 http://imagineinc.net/images/
>>>
>>> By main / hidden images, do you mean blending images together?  Because
>>> what I saw from visiting this link was a background scenery with a
>>> flower
>>> etc. with red, green and blue ovals on top of it.  (Firefox 1.0)
>>
>> I'm curious about Firefox.  Did you try highlighting the image in it?  If
>> I
>> remember correctly, Firefox's highlight grid is the reverse of Internet
>> Explorers, which is what these images were made for, though I have a flag
>> in
>> my code to reverse my grid too.  I just tried loading this in Firefox,
>> and
>> it definately doesn't have the same effect as in IE.  Try it in IE, then
>> highlight the image.
>>
>> Perhaps my example is so poor, noone here is understanding what I'm
>> trying
>> to do.  Checkout this link:
>> http://www.toccionline.com/creations/ctrla/
>>
>> That is what I'm trying to do, only with whatever two images you happen
>> to
>> want to do it with, on the fly, in PHP.
>
> I'm assuming you've read this:
> http://www.toccionline.com/creations/ctrla/how.html
>
> The only part of that which is pretty much non-trivial would be the part
> at the end about playing with the "output levels" and maybe
> "brightness/contrast" until it "looks right"
>
> You could spend the next 50 years in AI research with specializations in
> visualization trying to find the perfect algorithm for that, and still
> fail -- Which is about where the state of the art in AI research with
> specializations in visualization is today :-)
> [Apologies for this "dig" at my colleagues]
>
> You might, however, want to do some light reading in that arena to see if
> there are some simple heuristics you can "steal" to know what to do to the
> image you are trying to hide.
>
> I believe that for Firefox/Mozilla, you simply need to switch the grid
> around and color-code the "other" pixels the same way, so that should be
> do-able.
>
> Bottom line, though, is that even though you are doing this in PHP, you're
> basically asking a Visualization Expert question...  Might as well ask us
> about brain surgery, when you get right down to it.  Somebody here *might*
> know the answer...  Sorry.
>
> Some general principles that seem to be implied from my reading of that
> page:
>
> The primary (un-hidden) image should be "busy" and not have large chunks
> of all-the-same color.  That makes me think JPEG might be the better
> output format, though perhaps JPEG would actually muck up all the pixels
> you're trying to hide in the first place...
>
> The "hidden" image should be less busy, with larger chunks of the same
> color, I suspect.
>
> Alpha-blending the hidden image down to 50% may well prove to be a cheat
> to get the desired goal for a general image.
>
> I don't think you're EVERY going to get satisfactory results for two
> randomly-selected arbitrary images.  If the "hidden" image is too busy,
> and the "visible" image is too not-busy, you're going to end up with the
> hidden image pushing through too much.
>
> NOTE: The entire second half of this post was all guess-work.  YMMV.

These are actually all very good points.  I wasn't expecting someone to be a
brain surgeon... but perhaps hoping? :)

Also, this has really been just something I've done for fun and learning,
and I've learned a lot.  Tons from what you just wrote too.  I think you
finally understood where I am at in this project.  I know it's unrealistic
to make this work with any two arbitrary images, but it would be interesting
to just make it work well with any two 'good' images.

Asking around, I've found an algorithm to reduce the contrast of the hidden
image, and dither the main image.  This seems like the best option right
now, and I'm excited to see how it turns out.  I'll post some code and
results later tonight.

Thanks alot for the insights and information.  I was hoping that what you
said about Firefox was true (the only other browser I have right now), but
I'm no longer sure that's the case.  I've tried viewing some of these images
in Firefox, and both the main and the hidden image can still be seen when
highlighted.  So I'll have to figure out what it's doing to the picture too.

  -- Rob

(I wouldn't mind doing your suggestion about PhotoShop, but I don't even own 
it.  The only program I ever use for editing images is Paint!) :) 

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



[PHP] $_SERVER['HTTP_USER_AGENT'] in html email

2005-01-18 Thread Graham Anderson
is it possible to use $_SERVER['HTTP_USER_AGENT'] in an html email ?
something like:
//What should we download based on user's platform ?
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Macintosh') !== FALSE) {
$download  = 'Fonovisa.dmg';
echo 'Mac';
}
else
{
echo 'PC';
$download = '!Fonovisa.exe';
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  1   2   >