[PHP] memory leaks with 5.1 and osx

2005-12-05 Thread Dan Rossi
Ive discovered these errors in the apache error logs, is this anything 
serious ? Is there hardlinks to the source ?


/usr/share/sources/php/php-5.1.1/Zend/zend_compile.c(1862) :  Freeing 
0x021B4E78 (140 bytes), script=thescript.php
/usr/share/sources/php/php-5.1.1/Zend/zend_hash.c(248) : Actual 
location (location was relayed)


=== Total 5027 memory leaks detected ===

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



[PHP] Re: GD Graph tutorial?

2005-12-05 Thread Gustavo Narea

Hello, Ashley.

Ashley M. Kirchner wrote:

   Does anyone know of a good GD tutorial for creating graphs?


I like this one: http://www.nyphp.org/content/presentations/GDintro/

Regards.

--
Gustavo Narea.
PHP Documentation - Spanish Translation Team.
Valencia, Venezuela.

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



Re: [PHP] GD Graph tutorial?

2005-12-05 Thread Mark Steudel





You may have alreayd looked at this class, but this one is great for 
creating graphs:

 

http://www.aditus.nu/jpgraph/

 

There are some licensing issues with it so if this is for a company then you 
probably have to buy a license.

 

Mark

-Original Message-

From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>

To: PHP General List 

Date: Mon, 05 Dec 2005 19:01:26 -0700

Subject: [PHP] GD Graph tutorial?



> 

>     Does anyone know of a good GD tutorial for creating graphs?  I'm 

> looking to create something like the attached one by feeding it the 

> values and have it create the graph.  Possibly with multiple lines, 

> different colors, different types of data, etc., etc.

> 

> -- 

> W | It's not a bug - it's an undocumented feature.

>   +

>   Ashley M. Kirchner    .   303.442.6410 x130

>   IT Director / SysAdmin / Websmith             .     800.441.3873 x130

>   Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6

>   http://www.pcraft.com . .  .    .       Boulder, CO 80303, U.S.A.

> 

> 

> 



[PHP] GD Graph tutorial?

2005-12-05 Thread Ashley M. Kirchner


   Does anyone know of a good GD tutorial for creating graphs?  I'm 
looking to create something like the attached one by feeding it the 
values and have it create the graph.  Possibly with multiple lines, 
different colors, different types of data, etc., etc.


--
W | It's not a bug - it's an undocumented feature.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / Websmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.


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

Re: [PHP] Sessions, Expire-headers and Firefox's back button

2005-12-05 Thread Peter Brodersen
On Sun, 4 Dec 2005 11:56:43 -0800, in php.general [EMAIL PROTECTED]
(Curt Zirzow) wrote:

>iirc, Firefox 1.5 has improved its caching system, in paticular to the
>back button drama.

It seems so, but the issue is still present in 1.5 and might be
further on.

session_cache_limiter('private') changed the output from
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
to
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: private, max-age=10800, pre-check=10800

session_cache_limiter('private_no_expire') can get rid of the Expires
header as well, but it doesn't seem to be an issue here. It could
still be relevant for other reasons though.

-- 
- Peter Brodersen

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



[PHP] Pls check my style.

2005-12-05 Thread Michael B Allen
I'm very new to PHP so I have yet to develop a style. I would love to
see how you would write this fragment of code so that I might get a
better understanding of good PHP techniques and best practices.

Consider the following fragment:

class Account {
   function store() {
  switch ($this->state) {
 case 1:
$link = mysql_connect('localhost', DBUSER, DBPASS) 
   OR die(mysql_error());
if (!mysql_select_db(DBNAME, $link)) 
   die(mysql_error());
$query = sprintf("INSERT INTO acct " .
  "(name,real_name,password,email) " .
  "VALUES (%s,%s,%s,%s)",
quote_smart($this->name),
quote_smart($this->real_name),
quote_smart($this->password),
quote_smart($this->email));
$result = mysql_query($query);
$e = mysql_errno();
mysql_close($link);
if (!$result) {
   if ($e == 1062) { 
  global $err;
  $err = ERR_DUPLICATE_USERNAME;
  return FALSE;
   }
   die(mysql_error());
}

return $result;
 default:
$err = ERR_INVALID_ACCT_STATE;

Some specific questions I have are:

1) It seems mysql_connect can "die" internally. At least this is what I
see if the username or password is incorrect. Is there a way to suppress
that behavior so that I can display an appropriate message rather than
too much information or nothing?

2) Must I always call mysql_select_db or can that be folded into the
connect or somehow specify a default db in some settings somewhere?

3) I use a global $err and define() custom ERR_* strings to communicate
errors similar to errno in C. Is this a respecible method or is a
different technique preferred?

4) Can I rely on mysql_errno() values as I do above to determine if a
username already exists (1062 is the value returned by mysql_errno()
when trying to insert a record with a username that already exists).

Note that I call $acct->store() and handle the error. Is this the
preferred technique? It seems redundant and racey to query the database
to determine if the username exists and then insert if available.

Thanks,
Mike

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



Re: [PHP] how to unregister session stored as multidimensional array?

2005-12-05 Thread Curt Zirzow
On Mon, Dec 05, 2005 at 02:45:43PM -0600, [EMAIL PROTECTED] wrote:
> Is this possible at all:
> I have stored info from form in session:
> $_SESSION['client']['name'] = 'Name'
> $_SESSION['client']['address'] = 'Address'
> $_SESSION['client']['city'] = 'City'
> $_SESSION['client']['state'] = 'State'
> $_SESSION['client']['zip'] = 'Zip
> 
> Now, I want to unregister all $_SESSION['client'] info EXCEPT 
> $_SESSION['client']['name'].

All you need to do is redifine what the $_SESSION['client'] array's
definition is:

  $_SESSION['client'] = array('name' => $_SESSION['client']['name']);


> 
> With
> session_unregister('client');

Don't mix session_*register() functions with the use of $_SESSION.
Those functions are only there for old scripts to work, see
http://php.net/session_unregister (the second Caution)

To register a session var:

  $_SESSION['client'] = $client;

To unregister a session var:

  unset($_SESSION['client']);

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] String Validation / SQL Injection Vulnerbilities

2005-12-05 Thread Curt Zirzow
On Mon, Dec 05, 2005 at 02:00:13PM -0500, Michael B Allen wrote:
> I want to validate a string for storage into a database so that it cannot
> contain any content that might be interpreted as SQL, Javascript, PHP,
> etc. Is there a standard function or technique to perform this validation?

Trying to validate input so it is valid in what ever context it may
be used in is probably the wrong mindset. You should think in the
terms of ensure this string wont cause any problems in the medium
you are outputing it to.  For Example.

You have a string that is being passed in from a html input field
such as:
  $_GET['string'] = "O'rielly ... "


So the question is where are you planning on putting this?
  1) A DB?
you will need to escape the string so it wont cause any
problems with the output to mysql:

  $string = mysql_real_escape_string($_GET['string']);

  2) The browser?
you will need to escape the string so it wont cause any
problems with the output to html:
  
  $string = htmlentities($_GET['string']);

  3) For some reason want to eval() it?
you will need to escape the string so it wont cause any
problems with the output to php:
  
  // assuming short tags, asp tags etc are disabled... 
  // remove 
  $string = preg_replace('/(\<\?php|\?\>/', '', $_GET['string']);

So it comes down to the fact that the standard technique is to
ensure that the data you are sending, to what ever medium, is
properly escaped.

The same output escaping should be considered no matter the input
of the data ie: database, rss feed, flat file ...

Curt.
-- 
cat .signature: No such file or directory

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



[PHP] R: [PHP] how to unregister session stored as multidimensional array?

2005-12-05 Thread Sebastian \"En3pY\" Zdrojewski
Try



a bit dirty but works... :-/


Sebastian Konstanty Zdrojewski 



URL: http://www.en3py.net/
E-Mail: [EMAIL PROTECTED]



Le informazioni contenute in questo messaggio sono riservate e
confidenziali. Il loro utilizzo è consentito esclusivamente al destinatario
del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei
non fosse la persona a cui il presente messaggio è destinato, La invito ad
eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandone
gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi
del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE). 

-Messaggio originale-
Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Inviato: lunedì 5 dicembre 2005 21.46
A: PHP eMail List
Oggetto: [PHP] how to unregister session stored as multidimensional array?

Is this possible at all:
I have stored info from form in session:
$_SESSION['client']['name'] = 'Name'
$_SESSION['client']['address'] = 'Address'
$_SESSION['client']['city'] = 'City'
$_SESSION['client']['state'] = 'State'
$_SESSION['client']['zip'] = 'Zip

Now, I want to unregister all $_SESSION['client'] info EXCEPT
$_SESSION['client']['name'].

With
session_unregister('client');
I clear everything.

session_unregister('address');
doesn't clear this session.

session_unregister($_SESSION['client']['address']);
doesn't work.

What am I doing wrong?

Thanks for any help.

-afan

--
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 Free Edition.
Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date: 02/12/2005
 


smime.p7s
Description: S/MIME cryptographic signature


Re: [PHP] Redirects Safari vs Others

2005-12-05 Thread Brent Baisley
Probably not a PHP problem. And probably can't help without seeing  
your redirect code. I've never had a problem with redirects in any  
browser Safari or otherwise, but I always make sure I redirect with a  
full URL rather than a relative URL.


On Dec 5, 2005, at 1:29 PM, Mark Steudel wrote:

I was wondering if folks have experienced infinite redirection  
loops with

Safari where other browsers don't encounter the same problems.

This is what safari spits out

http://www.domain.com/microlibrary.php?action=subcategory&id=7&top=% 
2Fpage.p
hp%3Fpage%3D33&page=33?action=listentries&categoryid=7&top=/ 
page.php?page=33
&page=33?action=listentries&categoryid=7&top=/page.php? 
page=33&page=33?actio
n=listentries&categoryid=7&top=/page.php?page=33&page=33? 
action=listentries&
categoryid=7&top=/page.php?page=33&page=33? 
action=listentries&categoryid=7&t
op=/page.php?page=33&page=33?action=listentries&categoryid=7&top=/ 
page.php?p
age=33&page=33?action=listentries&categoryid=7&top=/page.php? 
page=33&page=33
?action=listentries&categoryid=7&top=/page.php?page=33&page=33? 
action=listen
tries&categoryid=7&top=/page.php?page=33&page=33? 
action=listentries&category
id=7&top=/page.php?page=33&page=33? 
action=listentries&categoryid=7&top=/page
.php?page=33&page=33?action=listentries&categoryid=7&top=/page.php? 
page=33&p
age=33?action=listentries&categoryid=7&top=/page.php? 
page=33&page=33?action=
listentries&categoryid=7&top=/page.php?page=33&page=33? 
action=listentries&ca
tegoryid=7&top=/page.php?page=33&page=33? 
action=listentries&categoryid=7&top

=/page.php?page=33&page=33

I'm sure this is a coding problem on my part but it's interesting  
that it

doesn't happen in firefox or IE.

Thanks, Mark


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

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



[PHP] R: [PHP] Re: Performance question

2005-12-05 Thread Sebastian \"En3pY\" Zdrojewski
Hi,

actually I think that if you have performance problem is when you make the
calculations and process. If you make processes while giving output to the
client, you might have some problems whether being somehow output buffering
dependant... I would rather leave the output management as final step,
concentrating all the process in the first part "hidden" and not involved
into the parsing of HTML code (useless).

I rather prefer the approach of 

data entry/input -> process -> output

instead of

data entry -> output while processing

especially when the performance of process is critical. Do essential first,
have fun laterz =:)

Obviously IMHO :)

Have fun,

En3pY


Sebastian Konstanty Zdrojewski 



URL: http://www.en3py.net/
E-Mail: [EMAIL PROTECTED]



Le informazioni contenute in questo messaggio sono riservate e
confidenziali. Il loro utilizzo è consentito esclusivamente al destinatario
del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei
non fosse la persona a cui il presente messaggio è destinato, La invito ad
eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandone
gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi
del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE). 

-Messaggio originale-
Da: James Benson [mailto:[EMAIL PROTECTED] 
Inviato: lunedì 5 dicembre 2005 13.40
A: php-general@lists.php.net
Oggetto: [PHP] Re: Performance question

I dont think either will give a performance decrease any less than the other
will do.





Anders Norrbring wrote:
> 
> I've been spending some time to find performance pros and cons, but so 
> far haven't had any real luck.
> 
> Can someone on this list say which is better than the other, and also 
> why, when it comes to these kinds of syntax:
> 
> 1.
> php code
> ?>
> 
> 
>  more php code
> 
> 2.
> php code
> echo "$variable";
> echo "$var2";
> more php code
> 
> In both cases, some processing is done, not that 'echo' uses a lot of 
> cpu time, but still...
> On the other hand, there are more jumps in and out for the interpreter 
> in the first example...
> 
> I'd love some thoughts on this.

-- 
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 Free Edition.
Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date: 02/12/2005
 


smime.p7s
Description: S/MIME cryptographic signature


RE: [PHP] String Validation / SQL Injection Vulnerbilities

2005-12-05 Thread Jay Blanchard
[snip]
I want to validate a string for storage into a database so that it cannot
contain any content that might be interpreted as SQL, Javascript, PHP,
etc. Is there a standard function or technique to perform this validation?
[/snip]

The technique is regex (regular expressions), start here
http://us2.php.net/regex

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



[PHP] String Validation / SQL Injection Vulnerbilities

2005-12-05 Thread Michael B Allen
I want to validate a string for storage into a database so that it cannot
contain any content that might be interpreted as SQL, Javascript, PHP,
etc. Is there a standard function or technique to perform this validation?

Thanks,
Mike

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



[PHP] Redirects Safari vs Others

2005-12-05 Thread Mark Steudel
I was wondering if folks have experienced infinite redirection loops with
Safari where other browsers don't encounter the same problems. 
 
This is what safari spits out
 
http://www.domain.com/microlibrary.php?action=subcategory&id=7&top=%2Fpage.p
hp%3Fpage%3D33&page=33?action=listentries&categoryid=7&top=/page.php?page=33
&page=33?action=listentries&categoryid=7&top=/page.php?page=33&page=33?actio
n=listentries&categoryid=7&top=/page.php?page=33&page=33?action=listentries&
categoryid=7&top=/page.php?page=33&page=33?action=listentries&categoryid=7&t
op=/page.php?page=33&page=33?action=listentries&categoryid=7&top=/page.php?p
age=33&page=33?action=listentries&categoryid=7&top=/page.php?page=33&page=33
?action=listentries&categoryid=7&top=/page.php?page=33&page=33?action=listen
tries&categoryid=7&top=/page.php?page=33&page=33?action=listentries&category
id=7&top=/page.php?page=33&page=33?action=listentries&categoryid=7&top=/page
.php?page=33&page=33?action=listentries&categoryid=7&top=/page.php?page=33&p
age=33?action=listentries&categoryid=7&top=/page.php?page=33&page=33?action=
listentries&categoryid=7&top=/page.php?page=33&page=33?action=listentries&ca
tegoryid=7&top=/page.php?page=33&page=33?action=listentries&categoryid=7&top
=/page.php?page=33&page=33
 
I'm sure this is a coding problem on my part but it's interesting that it
doesn't happen in firefox or IE.
 
Thanks, Mark


RE: [PHP] Mail SMTP settings

2005-12-05 Thread Mark Steudel
Also look at PEAR::Mail. If you search back through this list there was a
discussion on peoples preferences. 

-Original Message-
From: Brent Baisley [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 05, 2005 7:04 AM
To: Dan
Cc: php-general@lists.php.net
Subject: Re: [PHP] Mail SMTP settings

There are a lot of limitations in the built-in PHP mail function. If you
want more control over how your email is sent, try using phpmailer. It's all
php code, so you can customize it to your needs, not that you need to.
http://phpmailer.sourceforge.net/


On Dec 3, 2005, at 2:45 AM, Dan wrote:

> I have a PHP 4.x install on an Apache server.  I have a PHP 
> application and a call to the mail function.  I have 2 static IP's on 
> the server and I have one web server and one instance of postfix for 
> each IP to basically separate the two sites.  The only issue I have 
> right now is sending mail via PHP.
>
> I have tried to set the SMTP server and reply address via a php_value 
> in my httpd.conf file and via the ini_set function for my site in 
> question.  Regardless of these setting mail is sent from the www user 
> at my main site domain:
>
> Return-Path: <[EMAIL PROTECTED]>
> Received: from mail.wavefront.ca ([unix socket])
>by mail.wavefront.ca (Cyrus v2.2.12-OS X 10.4.0) with LMTPA;
>Fri, 02 Dec 2005 12:45:07 -0700
>
> I've also tried the IMAP functions but also with no success.  I 
> basically want the mail to look as though it was from the other 
> domain.
>
> Dan T
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php
>
>

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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

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



Re: [PHP] php-sqlite W2K install problem

2005-12-05 Thread Marlin Unruh

Marlin Unruh wrote:

Marlin Unruh wrote:
I am tiring to use sqlite which is [quote] bundled with php5 
[unquote]. I am missing something somewhere. I modified the php.ini 
to include the php_extension=php_sqlite.dll. Following is the error I 
get.


[05-Dec-2005 07:40:33] PHP Fatal error:  Call to undefined function 
sqlite_open() in G:\apache2\htdocs\sqlite.php on line 9


I am running  W2K professional, Apache 2.0.54, and PHP 5.1.0.

The CLI for version Sqlite version 3 is sqlite3, does that have 
anything to do with the function names I should be using in PHP?


Any ideas, or point me to a cheat sheet.


Sorry for the noise! I got it going.

I was getting php_sqlite module not found error when apache loaded. Then 
I fixed the extension_dir setting. Next I got php_sqlite.dll could not 
load because php_pdo module not found. I needed to include all of the 
following dlls to get apache to load without complaint. I included the 
php_pdo_sqlite because I am using sqlite version 3 CLI. Now it is working.


edited to:
extension_dir = "x:\php5\ext"

added:
extension=php_pdo.dll
extension=php_pdo_sqlite.dll
extension=php_sqlite.dll

HTH someone else.

--
Regards,
Marlin Unruh
Sunco Systems Inc.
(308) 326-4400

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



Re: [PHP] SSI problem with php after 4.3.10 -> 4.4.1 upgrade

2005-12-05 Thread kristina clair
On 12/5/05, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> I'm having a problem with certain SSI files which include php scripts
> after upgrding php from 4.3.10 to 4.4.1.
> The includes look like:
> 
>
> In some cases, the page output is different with 4.4.1 than it is with
> 4.3.10.  In the worst cases, Apache gives a segmentation fault, and
> the page is blank.
>
> Has anyone encountered any similar issues?
> [/snip]
>
> We'd have to see some code to begin to analyse what the problem might be.
> Can you send php code snips from eventdb.php?
>

The code is short.  The same php script is being included in the page
which is displaying differently and the page which is causing the
apache segfault.

if (empty($ID)){
$ID='1';
}
$today = date("Ymd");
$conn = mysql_connect ([snip]);
if ($conn == false){
  echo mysql_errno() . ": " . mysql_error() . "";
  exit;
}
else {
$rtn = mysql_select_db ("[tablename]");
$sql = "select * from events where ID = ".$ID;
$result = mysql_query ($sql);
if ( ($row = mysql_fetch_row($result)) &&
($today<=$row[4]
) ){
//if ( $row =
mysql_fetch_
row($result)) {
switch ($fld){
case 2:
echo $row[2];
break;
case 5:
echo $row[5];
break;
case 6:
echo $row[6];
break;
case 7:
echo $row[7];
break;
default:
echo $row[1];
break;
  }
}

   }


By the way, the backtrace from the apache segfault is:
#0  0xb7e095cc in zend_hash_index_update_or_next_insert (ht=0xb7ea29c0, h=0,
pData=0xbfffdc60, nDataSize=12, pDest=0x0, flag=1)
at /home/sys/src/php-4.4.1/Zend/zend_hash.c:390
390 p = ht->arBuckets[nIndex];
(gdb) bt full
#0  0xb7e095cc in zend_hash_index_update_or_next_insert (ht=0xb7ea29c0, h=0,
pData=0xbfffdc60, nDataSize=12, pDest=0x0, flag=1)
at /home/sys/src/php-4.4.1/Zend/zend_hash.c:390
nIndex = 0
p = Variable "p" is not available.
(gdb)

That segfault backtrace is the same even if I compile php with the
--without-zend-memory-manager flag, and also when I disable all Zend
settings in php.ini.

Thanks,
Kristina

--
"In most cases, people, even wicked people, are far more naive and
simple-hearted than one generally assumes.  And so are we."
/* last line, 1st ch., The Brothers Karamazov */

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



RE: [PHP] SSI problem with php after 4.3.10 -> 4.4.1 upgrade

2005-12-05 Thread Jay Blanchard
[snip]
I'm having a problem with certain SSI files which include php scripts
after upgrding php from 4.3.10 to 4.4.1.
The includes look like:


In some cases, the page output is different with 4.4.1 than it is with
4.3.10.  In the worst cases, Apache gives a segmentation fault, and
the page is blank.

Has anyone encountered any similar issues?
[/snip]

We'd have to see some code to begin to analyse what the problem might be.
Can you send php code snips from eventdb.php?

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



[PHP] SSI problem with php after 4.3.10 -> 4.4.1 upgrade

2005-12-05 Thread kristina clair
Hello,

I'm having a problem with certain SSI files which include php scripts
after upgrding php from 4.3.10 to 4.4.1.
The includes look like:


In some cases, the page output is different with 4.4.1 than it is with
4.3.10.  In the worst cases, Apache gives a segmentation fault, and
the page is blank.

Has anyone encountered any similar issues?

Thanks,
Kristina

--
"In most cases, people, even wicked people, are far more naive and
simple-hearted than one generally assumes.  And so are we."
/* last line, 1st ch., The Brothers Karamazov */

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



[PHP] PHP Warning: imagettftext() expects parameter 2 to be double

2005-12-05 Thread James
Hi there,

I have been using the GD functions from PHP5.0 on Mac OS X.

I have a simple script that creates a PNG image with text on the image using
fonts using FreeType 2.

I am trying to use the imagettftext() function within a foreach loop ­ but I
get the following error:

PHP Warning:  imagettftext() expects parameter 2 to be double

The code is as follows:

$font['type']="./fonts/font.ttf²;


$font['color']=imageColorAllocate($card['png'],$font['hexcolor']['r'],$font[
'hexcolor']['g'],$font['hexcolor']['b']);

imageFill($card['png'],0,0,$card['color']);

foreach ($xml->textblock as $text) {
$fontsize=$text->fontsize;$fontangle=$text->fontangle;
$fontxpos=$text->fontxpos;$fontypos=$text->fontypos;
$text=$text->text; 
imagettftext($image['png'],$fontsize,$fontangle,$fontxpos,$fontypos,$font['c
olor'],$font['type'],$text);}

It works fine if I add just one line outside of the loop ­ but as soon as
its within the loop it errors.

Cheers,

James


Re: [PHP] Browser Control Help

2005-12-05 Thread John Nichel

Chirantan Ghosh wrote:

Thanks Jason,

I am always ready to be enlightened by ones who know better than me.

As you suggested, I really would love to get a watermark which is 
invisible with initial viewing but activated once a copying/printing 
command ( Can be Ctrl+C or Alt+Printscreen) is used.


If you can help it would be delighting.


New to mailing lists, aren't you?  You're well on your way to breaking 
every 'rule'...hell, you broke the number one rule just by asking the 
question, as it's quite obvious what you _have not_ done.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Browser Control Help

2005-12-05 Thread Dan Parry
Rather than trying to prevent theft of your images why not create a little
app that steganographs some copyright information... With some thought it's
possible to hide textual content within an image

At least then you can prove it was yours... Just a thought

Dan

-Original Message-
From: Chirantan Ghosh [mailto:[EMAIL PROTECTED] 
Sent: 05 December 2005 16:37
To: Jason Petersen
Cc: php-general@lists.php.net
Subject: Re: [PHP] Browser Control Help

Thanks Jason,

I am always ready to be enlightened by ones who know better than me.

As you suggested, I really would love to get a watermark which is invisible 
with initial viewing but activated once a copying/printing command ( Can be 
Ctrl+C or Alt+Printscreen) is used.

If you can help it would be delighting.

Thanks,
C

- Original Message - 
From: "Jason Petersen" <[EMAIL PROTECTED]>
To: "Chirantan Ghosh" <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, December 05, 2005 11:27 AM
Subject: Re: [PHP] Browser Control Help


I wish I had a dollar every time I've seen a question like yours, it seems
like a lot of new developers think they need to fundamentally alter the way
the browser works to protect their "content."  The fact is, if you're
putting content on the public web, it can--and will--be downloaded by all of
your visitors.  (they have to download it to display it after all)

You're going the wrong way about protecting your images.  No matter what
Javascript tricks you try to use, all I have to do is disable Javascript.
And you're going to seriously annoy your visitors who are not technically
savvy, whether they have the intention to "steal" your content or not.
Personally I would not come back to a site that assumes I'm a thief.

You might want to look into other methods to protect your content, such as
login authentication and watermarking. PHP can help with these.  But if you
come on this list and demand ridiculous things, don't expect to be taken
seriously.

A better way to ask your original question would have been: "How can PHP
help protect web content?"

Best,
Jason



On 12/5/05, Chirantan Ghosh <[EMAIL PROTECTED]> wrote:
>
> Hi Jason,
>
> You sound offended...Happy Christmas to you too!
> If you really wanted to know what I was addressing please read what Dan
> (Parry) wrote.
>
> Keep smiling after all its Dec,
> C
>
> - Original Message -
> *From:* Jason Petersen <[EMAIL PROTECTED]>
> *To:* Chirantan Ghosh <[EMAIL PROTECTED]>
> *Sent:* Monday, December 05, 2005 10:57 AM
> *Subject:* Re: [PHP] Browser Control Help
>
> 1. PHP is server side, not client side.
> 2. You don't have "a working version," my browser is fully functional on
> your site.
> 2. No one is interested in ripping off your Dreamweaver-generated site
> anyway.
>
> Best,
> Jason
>
>
> On 12/5/05, Chirantan Ghosh <[EMAIL PROTECTED]> wrote:
> >
> > Hi All,
> >
> > I was wondering how do in trick in PHP page  part?
> >
> > I want to disable Ctrl, Atl, Print Screen and also remove the File,
> > Edit, View menus from the browser.
> >
> > I already have a working version with disabled Ctrl, Atl, Print Screen (
> > http://www.art-nyc.us/ )but I need some help with coding with the later.
> >
> > If someone can please help me remove the File, Edit, View menus from the
> > browser in PHP it would help a LOT.
> >
> > Thanks,
> > C
> >
> >
>

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

__ NOD32 1.1311 (20051202) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

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



Re: [PHP] Browser Control Help

2005-12-05 Thread Duncan Hill
On Monday 05 December 2005 16:36, Chirantan Ghosh wrote:
> As you suggested, I really would love to get a watermark which is invisible
> with initial viewing but activated once a copying/printing command ( Can be
> Ctrl+C or Alt+Printscreen) is used.

Once the browser has the content, it's out of PHP's hands.  It's on the disk 
of the remote client, and they can do what they like with it.  To print an 
image or web page that's in my disk cache, I don't need to use my web browser 
- I can just go to the cache in my file manager and print it.

Unless you write a dedicated viewing application that must be used to view the 
content, you're not going to have much luck.

If you want a watermark on print, just watermark the image anyway.

Steganography might help, but only in the digital world.

Are you sure you're tackling the right problem from the right angle?

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



Re: [PHP] php-sqlite W2K install problem

2005-12-05 Thread Marlin Unruh

Marlin Unruh wrote:
I am tiring to use sqlite which is [quote] bundled with php5 
[unquote]. I am missing something somewhere. I modified the php.ini to 
include the php_extension=php_sqlite.dll. Following is the error I get.


[05-Dec-2005 07:40:33] PHP Fatal error:  Call to undefined function 
sqlite_open() in G:\apache2\htdocs\sqlite.php on line 9


I am running  W2K professional, Apache 2.0.54, and PHP 5.1.0.

The CLI for version Sqlite version 3 is sqlite3, does that have 
anything to do with the function names I should be using in PHP?


Any ideas, or point me to a cheat sheet.


Sorry for the noise! I got it going.

--
Regards,
 Marlin Unruh
 Sunco Systems Inc.
 (308) 326-4400

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



Re: [PHP] Browser Control Help

2005-12-05 Thread Chirantan Ghosh

Thanks Jason,

I am always ready to be enlightened by ones who know better than me.

As you suggested, I really would love to get a watermark which is invisible 
with initial viewing but activated once a copying/printing command ( Can be 
Ctrl+C or Alt+Printscreen) is used.


If you can help it would be delighting.

Thanks,
C

- Original Message - 
From: "Jason Petersen" <[EMAIL PROTECTED]>

To: "Chirantan Ghosh" <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, December 05, 2005 11:27 AM
Subject: Re: [PHP] Browser Control Help


I wish I had a dollar every time I've seen a question like yours, it seems
like a lot of new developers think they need to fundamentally alter the way
the browser works to protect their "content."  The fact is, if you're
putting content on the public web, it can--and will--be downloaded by all of
your visitors.  (they have to download it to display it after all)

You're going the wrong way about protecting your images.  No matter what
Javascript tricks you try to use, all I have to do is disable Javascript.
And you're going to seriously annoy your visitors who are not technically
savvy, whether they have the intention to "steal" your content or not.
Personally I would not come back to a site that assumes I'm a thief.

You might want to look into other methods to protect your content, such as
login authentication and watermarking. PHP can help with these.  But if you
come on this list and demand ridiculous things, don't expect to be taken
seriously.

A better way to ask your original question would have been: "How can PHP
help protect web content?"

Best,
Jason



On 12/5/05, Chirantan Ghosh <[EMAIL PROTECTED]> wrote:


Hi Jason,

You sound offended...Happy Christmas to you too!
If you really wanted to know what I was addressing please read what Dan
(Parry) wrote.

Keep smiling after all its Dec,
C

- Original Message -
*From:* Jason Petersen <[EMAIL PROTECTED]>
*To:* Chirantan Ghosh <[EMAIL PROTECTED]>
*Sent:* Monday, December 05, 2005 10:57 AM
*Subject:* Re: [PHP] Browser Control Help

1. PHP is server side, not client side.
2. You don't have "a working version," my browser is fully functional on
your site.
2. No one is interested in ripping off your Dreamweaver-generated site
anyway.

Best,
Jason


On 12/5/05, Chirantan Ghosh <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I was wondering how do in trick in PHP page  part?
>
> I want to disable Ctrl, Atl, Print Screen and also remove the File,
> Edit, View menus from the browser.
>
> I already have a working version with disabled Ctrl, Atl, Print Screen (
> http://www.art-nyc.us/ )but I need some help with coding with the later.
>
> If someone can please help me remove the File, Edit, View menus from the
> browser in PHP it would help a LOT.
>
> Thanks,
> C
>
>



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



[PHP] php-sqlite W2K install problem

2005-12-05 Thread Marlin Unruh
I am tiring to use sqlite which is [quote] bundled with php5 [unquote]. 
I am missing something somewhere. I modified the php.ini to include the 
php_extension=php_sqlite.dll. Following is the error I get.


[05-Dec-2005 07:40:33] PHP Fatal error:  Call to undefined function 
sqlite_open() in G:\apache2\htdocs\sqlite.php on line 9


I am running  W2K professional, Apache 2.0.54, and PHP 5.1.0.

The CLI for version Sqlite version 3 is sqlite3, does that have anything 
to do with the function names I should be using in PHP?


Any ideas, or point me to a cheat sheet.

--

Regards,
 Marlin Unruh
 Sunco Systems Inc.
 (308) 326-4400

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



Re: [PHP] Browser Control Help

2005-12-05 Thread Jason Petersen
I wish I had a dollar every time I've seen a question like yours, it seems
like a lot of new developers think they need to fundamentally alter the way
the browser works to protect their "content."  The fact is, if you're
putting content on the public web, it can--and will--be downloaded by all of
your visitors.  (they have to download it to display it after all)

You're going the wrong way about protecting your images.  No matter what
Javascript tricks you try to use, all I have to do is disable Javascript.
And you're going to seriously annoy your visitors who are not technically
savvy, whether they have the intention to "steal" your content or not.
Personally I would not come back to a site that assumes I'm a thief.

You might want to look into other methods to protect your content, such as
login authentication and watermarking. PHP can help with these.  But if you
come on this list and demand ridiculous things, don't expect to be taken
seriously.

A better way to ask your original question would have been: "How can PHP
help protect web content?"

Best,
Jason



On 12/5/05, Chirantan Ghosh <[EMAIL PROTECTED]> wrote:
>
> Hi Jason,
>
> You sound offended...Happy Christmas to you too!
> If you really wanted to know what I was addressing please read what Dan
> (Parry) wrote.
>
> Keep smiling after all its Dec,
> C
>
> - Original Message -
> *From:* Jason Petersen <[EMAIL PROTECTED]>
> *To:* Chirantan Ghosh <[EMAIL PROTECTED]>
> *Sent:* Monday, December 05, 2005 10:57 AM
> *Subject:* Re: [PHP] Browser Control Help
>
> 1. PHP is server side, not client side.
> 2. You don't have "a working version," my browser is fully functional on
> your site.
> 2. No one is interested in ripping off your Dreamweaver-generated site
> anyway.
>
> Best,
> Jason
>
>
> On 12/5/05, Chirantan Ghosh <[EMAIL PROTECTED]> wrote:
> >
> > Hi All,
> >
> > I was wondering how do in trick in PHP page  part?
> >
> > I want to disable Ctrl, Atl, Print Screen and also remove the File,
> > Edit, View menus from the browser.
> >
> > I already have a working version with disabled Ctrl, Atl, Print Screen (
> > http://www.art-nyc.us/ )but I need some help with coding with the later.
> >
> > If someone can please help me remove the File, Edit, View menus from the
> > browser in PHP it would help a LOT.
> >
> > Thanks,
> > C
> >
> >
>


RE: [PHP] Browser Control Help

2005-12-05 Thread Jim Moseby
As Dan has correctly pointed out, you can only hope to make stealing your
content "less convenient", though only marginally so.  If you display a
picture on my browser, all I have to do to steal it is hit my "Print Screen"
button, then paste it into PhotoShop.  There are any number of other ways to
get it too.

My guess is that Visual Arts students will be pretty good at manipulating
images on a computer, and that, unfortunately, you will not be able to
thwart a determined content thief.

JM

PS  Top posting here since it seems to be the "in" thing to do on this
thread.

> 
> Hi Dan,
> 
> You are sooo right. We know certain kindda people would love 
> to break the 
> code just cuz its  there :D
> 
> I am least worried about programmers. Its stupid rich  Art 
> collage kids I am 
> trying to prevent using my stuff. You would be amazed to know 
> I walked in 
> SVA( School of Visual Arts), NYC & saw my painting exactly as 
> is  printed in 
> their merit list with a kid's name under.
> 
> What I want to achieve is, only my homepage will have File, 
> View, Edit 
> menus. I have mapped navigation over images, once they go 
> anywhere it should 
> open a window that has no menus like 
> http://creative.gettyimages.com/ uses 
> for display of images.
> 
> I am not even sweating hot-linking.
> 
> Thanks  a lot for the input,
> C
> 
> - Original Message - 
> From: "Dan Parry" <[EMAIL PROTECTED]>
> To: "'Chirantan Ghosh'" <[EMAIL PROTECTED]>
> Sent: Monday, December 05, 2005 10:32 AM
> Subject: RE: [PHP] Browser Control Help
> 
> 
> > Hi
> >
> > No probs... I hate cross-browser problems myself and any 
> help I get with
> > them I appreciate :)
> >
> > Securing your public facing graphics and/or code is essentially too
> > difficult to achieve... You can't (I'm pretty sure of this) 
> remove (or
> > disable) the menus in the browser (security implications there)
> >
> > There are usually ways around these client-side types of 
> protection too...
> > consider that if a person really does want to see your 
> code/steal your 
> > pics
> > they will look for ways around the system... Usually these 
> exist with
> > injection of JS into the URL (this is evident in at least 1 
> commercial
> > system... can't remember what it is though :) )
> >
> > Also, if a user can get your image path (on hover in Opera, 
> for instance)
> > the image URL can be directly input and stolen from there
> >
> > I decided a while ago to bite the bullet and accept that 
> there are things 
> > I
> > can't protect... I can't remember much of the research I did on the 
> > subject
> > but it was pretty damning
> >
> > Last point... There are people out there that will break 
> security on your
> > site purely because it's there
> >
> > That's my 2 penn'orth :)
> >
> > Dan
> > -Original Message-
> > From: Chirantan Ghosh [mailto:[EMAIL PROTECTED]
> > Sent: 05 December 2005 15:20
> > To: Dan Parry
> > Subject: Re: [PHP] Browser Control Help
> >
> > Hi Dan,
> >
> > Thanks a lot man...as you can guess I am more a designer 
> than a coder
> > (unfortunately).
> > Do you know how to fix the problem for Firefox?
> >
> > I really would appreciate the help.
> > Thanks,
> > C
> >
> > - Original Message - 
> > From: "Dan Parry" <[EMAIL PROTECTED]>
> > To: "'Chirantan Ghosh'" <[EMAIL PROTECTED]>
> > Sent: Monday, December 05, 2005 10:14 AM
> > Subject: RE: [PHP] Browser Control Help
> >
> >
> >> Not disabled in Firefox... Just did some copying and 
> printed a screen...
> >> also disabling ALT doesn't affect printscreen in IE... just took a 
> >> screeny
> >> there too
> >>
> >> -Original Message-
> >> From: Chirantan Ghosh [mailto:[EMAIL PROTECTED]
> >> Sent: 05 December 2005 15:05
> >> To: php-general@lists.php.net
> >> Subject: [PHP] Browser Control Help
> >>
> >> Hi All,
> >>
> >> I was wondering how do in trick in PHP page  part?
> >>
> >> I want to disable Ctrl, Atl, Print Screen and also remove 
> the File, Edit,
> >> View menus from the browser.
> >>
> >> I already have a working version with disabled Ctrl, Atl, 
> Print Screen (
> >> http://www.art-nyc.us/ )but I need some help with coding 
> with the later.
> >>
> >> If someone can please help me remove the File, Edit, View 
> menus from the
> >> browser in PHP it would help a LOT.
> >>
> >> Thanks,
> >> C
> >>
> >>
> >> __ NOD32 1.1311 (20051202) Information __
> >>
> >> This message was checked by NOD32 antivirus system.
> >> http://www.eset.com
> >>
> >>
> >>
> >
> > __ NOD32 1.1311 (20051202) Information __
> >
> > This message was checked by NOD32 antivirus system.
> > http://www.eset.com
> >
> >
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP] Browser Control Help

2005-12-05 Thread Chirantan Ghosh

Hi Dan,

You are sooo right. We know certain kindda people would love to break the 
code just cuz its  there :D


I am least worried about programmers. Its stupid rich  Art collage kids I am 
trying to prevent using my stuff. You would be amazed to know I walked in 
SVA( School of Visual Arts), NYC & saw my painting exactly as is  printed in 
their merit list with a kid's name under.


What I want to achieve is, only my homepage will have File, View, Edit 
menus. I have mapped navigation over images, once they go anywhere it should 
open a window that has no menus like http://creative.gettyimages.com/ uses 
for display of images.


I am not even sweating hot-linking.

Thanks  a lot for the input,
C

- Original Message - 
From: "Dan Parry" <[EMAIL PROTECTED]>

To: "'Chirantan Ghosh'" <[EMAIL PROTECTED]>
Sent: Monday, December 05, 2005 10:32 AM
Subject: RE: [PHP] Browser Control Help



Hi

No probs... I hate cross-browser problems myself and any help I get with
them I appreciate :)

Securing your public facing graphics and/or code is essentially too
difficult to achieve... You can't (I'm pretty sure of this) remove (or
disable) the menus in the browser (security implications there)

There are usually ways around these client-side types of protection too...
consider that if a person really does want to see your code/steal your 
pics

they will look for ways around the system... Usually these exist with
injection of JS into the URL (this is evident in at least 1 commercial
system... can't remember what it is though :) )

Also, if a user can get your image path (on hover in Opera, for instance)
the image URL can be directly input and stolen from there

I decided a while ago to bite the bullet and accept that there are things 
I
can't protect... I can't remember much of the research I did on the 
subject

but it was pretty damning

Last point... There are people out there that will break security on your
site purely because it's there

That's my 2 penn'orth :)

Dan
-Original Message-
From: Chirantan Ghosh [mailto:[EMAIL PROTECTED]
Sent: 05 December 2005 15:20
To: Dan Parry
Subject: Re: [PHP] Browser Control Help

Hi Dan,

Thanks a lot man...as you can guess I am more a designer than a coder
(unfortunately).
Do you know how to fix the problem for Firefox?

I really would appreciate the help.
Thanks,
C

- Original Message - 
From: "Dan Parry" <[EMAIL PROTECTED]>

To: "'Chirantan Ghosh'" <[EMAIL PROTECTED]>
Sent: Monday, December 05, 2005 10:14 AM
Subject: RE: [PHP] Browser Control Help



Not disabled in Firefox... Just did some copying and printed a screen...
also disabling ALT doesn't affect printscreen in IE... just took a 
screeny

there too

-Original Message-
From: Chirantan Ghosh [mailto:[EMAIL PROTECTED]
Sent: 05 December 2005 15:05
To: php-general@lists.php.net
Subject: [PHP] Browser Control Help

Hi All,

I was wondering how do in trick in PHP page  part?

I want to disable Ctrl, Atl, Print Screen and also remove the File, Edit,
View menus from the browser.

I already have a working version with disabled Ctrl, Atl, Print Screen (
http://www.art-nyc.us/ )but I need some help with coding with the later.

If someone can please help me remove the File, Edit, View menus from the
browser in PHP it would help a LOT.

Thanks,
C


__ NOD32 1.1311 (20051202) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com





__ NOD32 1.1311 (20051202) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com





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



Re: [PHP] Browser Control Help

2005-12-05 Thread Chirantan Ghosh

Thanks Jay,

In the site of example I did in JS :)
I thought It would be improvement if there was something similar then I 
could use it for other things later.


Thanks again,
C

- Original Message - 
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "'Chirantan Ghosh'" <[EMAIL PROTECTED]>; 


Sent: Monday, December 05, 2005 10:08 AM
Subject: RE: [PHP] Browser Control Help



[snip]
I was wondering how do in trick in PHP page  part?

I want to disable Ctrl, Atl, Print Screen and also remove the File, Edit,
View menus from the browser.

I already have a working version with disabled Ctrl, Atl, Print Screen (
http://www.art-nyc.us/ )but I need some help with coding with the later.

If someone can please help me remove the File, Edit, View menus from the
browser in PHP it would help a LOT.
[/snip]

You need JavaScript, not PHP. JavaScript is client-side, PHP is 
server-side.


--
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] Multiple callback_outputs for ob_start

2005-12-05 Thread Chris Shiflett

Mathijs wrote:

How can i add more callback_outputs to ob_start?

I want to have both: ob_start('switchContent');
and: ob_start('ob_gzhandler');


I don't think you can, but you could have a single function that calls 
both, then specify that function in ob_start().


Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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



RE: [PHP] Browser Control Help

2005-12-05 Thread Jay Blanchard
[snip]
I was wondering how do in trick in PHP page  part?

I want to disable Ctrl, Atl, Print Screen and also remove the File, Edit,
View menus from the browser.

I already have a working version with disabled Ctrl, Atl, Print Screen (
http://www.art-nyc.us/ )but I need some help with coding with the later.

If someone can please help me remove the File, Edit, View menus from the
browser in PHP it would help a LOT.
[/snip]

You need JavaScript, not PHP. JavaScript is client-side, PHP is server-side.

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



[PHP] Browser Control Help

2005-12-05 Thread Chirantan Ghosh
Hi All,

I was wondering how do in trick in PHP page  part?

I want to disable Ctrl, Atl, Print Screen and also remove the File, Edit, View 
menus from the browser.

I already have a working version with disabled Ctrl, Atl, Print Screen ( 
http://www.art-nyc.us/ )but I need some help with coding with the later.

If someone can please help me remove the File, Edit, View menus from the 
browser in PHP it would help a LOT.

Thanks,
C


Re: [PHP] Mail SMTP settings

2005-12-05 Thread Brent Baisley
There are a lot of limitations in the built-in PHP mail function. If  
you want more control over how your email is sent, try using  
phpmailer. It's all php code, so you can customize it to your needs,  
not that you need to.

http://phpmailer.sourceforge.net/


On Dec 3, 2005, at 2:45 AM, Dan wrote:

I have a PHP 4.x install on an Apache server.  I have a PHP  
application and a call to the mail function.  I have 2 static IP's  
on the server and I have one web server and one instance of postfix  
for each IP to basically separate the two sites.  The only issue I  
have right now is sending mail via PHP.


I have tried to set the SMTP server and reply address via a  
php_value in my httpd.conf file and via the ini_set function for my  
site in question.  Regardless of these setting mail is sent from  
the www user at my main site domain:


Return-Path: <[EMAIL PROTECTED]>
Received: from mail.wavefront.ca ([unix socket])
 by mail.wavefront.ca (Cyrus v2.2.12-OS X 10.4.0) with LMTPA;
 Fri, 02 Dec 2005 12:45:07 -0700

I've also tried the IMAP functions but also with no success.  I  
basically want the mail to look as though it was from the other  
domain.


Dan T

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




--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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



[PHP] PHP and Flash Remoting

2005-12-05 Thread Yaswanth Narvaneni
Hi!

I am using amfchat from tufat.com, and wanted to integrate it with my
site's session data. amfchat uses flash remoting to communicate to the
server.

It initally sends

sessionid=time() to gateway.php

gateway.php starts a session using:

function session($name=false){
if($name){
$prev_name = session_name();
if($prev_name != $name){
session_name($name);
}
}
@session_start();
}

And accesses the session variables in another function thats called
using flash remoting.
as $_SESSION['username'];


I wanted to replace all this and I have made gateway.php start a
session as follows:
$prev_name = session_name();
session_start();

But I am not able to access my session variables in the functions
using $_SESSION['login']

This is the function I have modified:

$session_name = session_name();
session_start();
$username=$_SESSION['login'];
$password=$_SESSION['passwd'];

$result['description'] = "User= $username, Password: $password,
Session: $session_name"

When flash prints the 'result' arrary, the output for description is as follows

User= , Password: , Session: PHPSESSID

Can any one tell me if I am making a mistake some where or give me a solution?

Regards,
Yaswanth

--
"In theory there is no difference between theory and practice.
In practice there is." -- Fortune Cookie

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



[PHP] Re: Count and Preg_Replace Using Version 4.4.1

2005-12-05 Thread Al

Shaun wrote:

Hi,

The following code matches all occurences of  tags within an html page 
and wraps form tags around it:


echo preg_replace(
'/]*>(.*?)<\/p>/ms',
'action="'.$CFG->edit_pages_adm.'/index.php?action=edit_paragraph" 
method="post">

  
  $1
 ',
file_get_contents($CFG->frontenddir_editable.'/'.$file) );

Unfortunately if there is more than one match the form won't submit because 
the forms have the same name. Does anyone know how can I modify this so that 
each occurence is numbered sequentially i.e.


form'.$count.'...

As I am using version 4.4.1 I don't have access to the count paramter in 
version 5.1.


Thanks for your advice 



Each of your html input elements must have a different name, otherwise the php 
code will only see the last one.

Consider a simple foreach loop to generate your html input elements, e.g.,

$report= ""; $i= 0;

foreach($array as $key=> $value){

$report .= "";

other stuff as needed

$i++;
}//end

echo $report;

I'm not sure I see why you need the JAVA script. Seems like you can let the user poke in everything and then provide a 
submit button to post everything.


Your $_POST will contain all the results.  e.g.,
$value1= $_POST['input1'];
$value2= $_POST['input2'];

etc.

Another simple foreach loop can be used to extract the input values.

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



[PHP] Re: Performance question

2005-12-05 Thread James Benson
I dont think either will give a performance decrease any less than the 
other will do.






Anders Norrbring wrote:


I've been spending some time to find performance pros and cons, but so 
far haven't had any real luck.


Can someone on this list say which is better than the other, and also 
why, when it comes to these kinds of syntax:


1.
php code
?>


$variable";
echo "$var2";
more php code

In both cases, some processing is done, not that 'echo' uses a lot of 
cpu time, but still...
On the other hand, there are more jumps in and out for the interpreter 
in the first example...


I'd love some thoughts on this.


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



Re: [PHP] functions that take variable arguments?

2005-12-05 Thread Richard Heyes

Eternity Records Webmaster wrote:

how do you create/use a function that takes an undefined amount of
arguments? I looked at the manual but its a little confusing. for example, i
want to make a function called Update inside a DB class:

class DB {
//vars here
var $host;
var $DbUser;

//functions
function Update(...) {
//this function can take as few as 1 argument or as many as php will allow
//its supposed to update a database with the new values of the arguments.
//any help getting started on creating a function like this would be
apreciated
}
//end class
}



class DB
{
function Update()
{
$args = func_get_args();
}
}

$args will then be a regular array of any/all the arguments passed to 
the function.


--
Richard Heyes
http://www.phpguru.org/

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



[PHP] functions that take variable arguments?

2005-12-05 Thread Eternity Records Webmaster
how do you create/use a function that takes an undefined amount of
arguments? I looked at the manual but its a little confusing. for example, i
want to make a function called Update inside a DB class:

class DB {
//vars here
var $host;
var $DbUser;

//functions
function Update(...) {
//this function can take as few as 1 argument or as many as php will allow
//its supposed to update a database with the new values of the arguments.
//any help getting started on creating a function like this would be
apreciated
}
//end class
}

thanks

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



[PHP] Re: PDF Generator

2005-12-05 Thread Norbert Wenzel

Dan Harrington wrote:

I have a TON of forms that I have to populate, can I make a PDF file using
Acrobat Professional, and then use PHP to populate those forms and have text
inserted into the pre-made text fields that I made using Acrobat?  And if
so, what is the best tool for that?  I'd prefer to do it for free, but
spending $$ is fine too. 


Thanks
Dan


Rick Lim wrote:



What is the best FREE pdf generator for PHP?


fpdf will only draw your documents, there is no way to use it with 
forms. and i don't know any way to process pdf forms in php, but i 
didn't really need it yet.


if you find any solutions, please post them.

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



RE: [PHP] template systems

2005-12-05 Thread Thomas
Hi,

Templating systems are really a matter of taste. You have a few options,
depending also on the paradigm you want to use (Model2, MVC ... maybe read
up on that as that is good general knowledge).

Also, please check the archives as this question has already been discussed
at length ;-)

Anyway, I will give my 5c worth, when I say that I have gotten to like
HTML_Template_Flexy (a pear package) quite a lot. This paradigm forces you
to do almost all of your logic stuff on the php side, whilst nicely
separating html and php code (you can really end up with some pretty
straight forward html pages, with a little Flexy code - cool things is also
that you can use Flexy code inline (as in ) makes for
neat code!)

Another plus for Flexy is that it is not bloated like Smarty. Fair enough,
Smarty is pretty cool, but it just gives you too many ropes to hang yourself
with.

Not sure how easy integration with Quickform is ... should not be a problem
as most things happen on the code side anyway.

Hope that helps. 

-Original Message-
From: Eternity Records Webmaster [mailto:[EMAIL PROTECTED] 
Sent: 05 December 2005 11:00 AM
To: php-general@lists.php.net
Subject: [PHP] template systems

Hi...

I was wondering if there are any template systems out there that are fairly
easy to use (that don't require hours and hours reading books) and that are
fairly good as well? I need one also that works with pear packages since I
use html_quickform a lot. I considered checking out smarty but wasnt for
sure if that one would be the best.

-- 
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: [PHP-DEV] Zend Sudio's Optimizer / PHP 5.1.1

2005-12-05 Thread Mike Bretz
ZendOptimizer will be available for PHP5.1 within "a few weeks" - that's 
what you get from zend support.


mike


Joseph Crawford wrote:


i keep getting an error that zend optimizer doesnt work with this version of
PHP, can anyone explain why that would be?
i have gone into zend studio and went to /lib/Optimizer-2.5.13/ created the
php-5.1.x dir and copied the ZendOptimizer.dll from the php-5.0.x directory
but it still complains ;( is there something else i need to change in zend
studio server?

Thanks,
--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]

 



--
mike peter bretzmetropolis ag / entwicklung
email:  [EMAIL PROTECTED]heinestraße 72
phone:  +49-7121-348-120d-72762 reutlingen
fax:+49-7121-348-111http://www.metropolis-ag.de/

metropolis ag. creating social internetworks.

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



[PHP] Re: R: [PHP] Performance question

2005-12-05 Thread Anders Norrbring

On 2005-12-05 09:05 Sebastian "En3pY" Zdrojewski wrote:

Hi,

I do prefer the first style programming after longer time in programming
PHP. I like the idea of keeping HTML and PHP code separate for cosmetic
purpose as well as mantainance. Actually a code with PHP only, I mean really
with NO HTML code in it, is more portable and easy to mantain. As for
performance I don't know, but a difference is present for sure. Actually I
never benchmarked the performance of the two styles, but wanted to give my
10 cents for the coding style :)

Cheers

En3pY



Yep, I like it too, for the same "cosmetic" reasons.. But now I've 
become involved in a project where extreme performance is a key issue, 
so of course I'd like to have some input on the situation...


Anders.






Sebastian Konstanty Zdrojewski 




URL: http://www.en3py.net/
E-Mail: [EMAIL PROTECTED]



Le informazioni contenute in questo messaggio sono riservate e
confidenziali. Il loro utilizzo è consentito esclusivamente al destinatario
del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei
non fosse la persona a cui il presente messaggio è destinato, La invito ad
eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandone
gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi
del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE). 


-Messaggio originale-
Da: Anders Norrbring [mailto:[EMAIL PROTECTED] 
Inviato: lunedì 5 dicembre 2005 8.27

A: PHP General
Oggetto: [PHP] Performance question


I've been spending some time to find performance pros and cons, but so far
haven't had any real luck.

Can someone on this list say which is better than the other, and also why,
when it comes to these kinds of syntax:

1.
php code
?>
  $variable";
echo "$var2";
more php code

In both cases, some processing is done, not that 'echo' uses a lot of cpu
time, but still...
On the other hand, there are more jumps in and out for the interpreter in
the first example...

I'd love some thoughts on this.



--

Anders Norrbring
Norrbring Consulting

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



[PHP] template systems

2005-12-05 Thread Eternity Records Webmaster
Hi...

I was wondering if there are any template systems out there that are fairly
easy to use (that don't require hours and hours reading books) and that are
fairly good as well? I need one also that works with pear packages since I
use html_quickform a lot. I considered checking out smarty but wasnt for
sure if that one would be the best.

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



[PHP] Multiple callback_outputs for ob_start

2005-12-05 Thread Mathijs

Hello ppl,

I Have a question about ob_start().

How can i add more callback_outputs to ob_start?

I want to have both: ob_start('switchContent');
and: ob_start('ob_gzhandler');

How can i do that?

Thx in advanced.

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



[PHP] R: [PHP] Performance question

2005-12-05 Thread Sebastian \"En3pY\" Zdrojewski
Hi,

I do prefer the first style programming after longer time in programming
PHP. I like the idea of keeping HTML and PHP code separate for cosmetic
purpose as well as mantainance. Actually a code with PHP only, I mean really
with NO HTML code in it, is more portable and easy to mantain. As for
performance I don't know, but a difference is present for sure. Actually I
never benchmarked the performance of the two styles, but wanted to give my
10 cents for the coding style :)

Cheers

En3pY


Sebastian Konstanty Zdrojewski 



URL: http://www.en3py.net/
E-Mail: [EMAIL PROTECTED]



Le informazioni contenute in questo messaggio sono riservate e
confidenziali. Il loro utilizzo è consentito esclusivamente al destinatario
del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei
non fosse la persona a cui il presente messaggio è destinato, La invito ad
eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandone
gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi
del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE). 

-Messaggio originale-
Da: Anders Norrbring [mailto:[EMAIL PROTECTED] 
Inviato: lunedì 5 dicembre 2005 8.27
A: PHP General
Oggetto: [PHP] Performance question


I've been spending some time to find performance pros and cons, but so far
haven't had any real luck.

Can someone on this list say which is better than the other, and also why,
when it comes to these kinds of syntax:

1.
php code
?>
  $variable";
echo "$var2";
more php code

In both cases, some processing is done, not that 'echo' uses a lot of cpu
time, but still...
On the other hand, there are more jumps in and out for the interpreter in
the first example...

I'd love some thoughts on this.
-- 

Anders Norrbring
Norrbring Consulting

--
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 Free Edition.
Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date: 02/12/2005
 


smime.p7s
Description: S/MIME cryptographic signature