[PHP] Stack Overflow with: zend optimizer

2002-07-04 Thread colin mcdonald

Hi there,

zend optimizer 1.3.1 / IIS 5 / PHP 4.2.1 / Windows 2000

I've been getting Stack Overflow errors frequently.  Our software has
hundreds of db queries and hundreds of includes per page execution.  Just to
give you some context, so I can't tell you exactly what I'm doing that's
causing this.

I recently disabled the zend optimizer from the server and since then I
haven't run it again.  Could it be that it the Zend Optimizer that's causing
this problem?

Any help would be appreciated.

Thanks,

Colin


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




[PHP] Re: Removing the #!/usr... from cgi output?

2002-07-05 Thread colin mcdonald

I think you can make the AddType location specific

ie:
in /home/httpd/html/cgi-bin all files ending in .php will be cgi php
everywhere else /home/httpd/html/ will be php module

the line at the top tells the parser which program should execute the 
code in the file ... so I think you don't add the AddType in apache and 
maybe something different?

David Brannlund wrote:
 Got it to work! I removed that line and configured apache to serve certain
 filetypes through php cgi. (I have the php module installed, so i had to
 come up with a new ext.)
 
 But there should be some way to write the script with #!.. and not get it
 printed out anyway. Ah, well...
 
 Thanks.
 
 David Brannlund
 
 
 Colin McDonald [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...
 
Did you try it without that line at all?

I'm pretty sure you can setup apache (you are using apache right?) to
use /usr/.../bin/php for all files with the extension .php

colin

David Brannlund wrote:

Example:

  #!/usr/local/bin/php
  ?php
  print foo;
  ?

becomes

  #!/usr/local/bin/php
  foo

 
 



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




[PHP] Re: textarea new line

2002-07-05 Thread colin mcdonald

use \n
Adi wrote:
 i want to add in textarea a string with new line tag in it. how to do that?
 
 my try:
 $string=-line1n\ -line2 n\-line3;
 echo brtextarea name='aria' cols='50' rows='2'$string/textarea;
 
 but i see a single line instead of:
 -line1
 -line2
 -line3
 
 tx in advance for any help
 



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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-05 Thread colin mcdonald

I'll try to explain:

If you have a form at a http URL and the action of the form is to a 
https URL, then the data from the form is submitted to the new URL in an 
encrypted format.

hope that helps,
colin

Jason Caldwell wrote:
 I'm a little confused about how HTTPS actually works when you call it via a
 FORM tag or HEADER(Location: ...)
 
 This may sound like a stupid question -- but it was never explained to me,
 so...
 
 I have my users fill out (for example) FORM A -- this form has basic
 non-secure info.  Then they press SUBMIT, now on FORM B, I want them to fill
 out their payment information.
 
 Now, I notice that when I go to web sites and fill out payment information,
 I see the little lock icon at the bottom of my browser, and the
 https://yadadada in the URL field... however, I'm unclear about something...
 
 If I call FORM B with HTTPS will my blank FORM B transmit to the user
 encrypted, and will I have to call HTTPS again for my PHP CC Processing App?
 
 In other words, what's taking place when I call a form or page with HTTPS?
 Is it that the data only gets encrypted on a SUBMIT ?
 
 Dunno if my question makes much sense .. but I guess I'd like to know if
 it's even required for me to call FORM B in a secure state (for the users CC
 data to be SENT encrypted), but instead just call the process attached to
 the FORM (submit button) on FORM B in HTTPS ?? Does that make sense?
 
 Jason
 
 Miguel Cruz [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...
 
On Thu, 4 Jul 2002, Jason Caldwell wrote:

Is there a way I can programmatically switch between HTTPS and HTTP... I

 use
 
a lot of INCLUDE's instead of HEADER(Location: ...);

Can I use HEADER in another way (without redirecting) to activate HTTPS

 or
 
HTTP for any given page?

Nope. The protocol is determined by the client when it makes its request.
Once your code is running, it's too late. At that point you can only
redirect to a https:// URL, which leads the client to generate a new
request.



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




Re: [PHP] textarea new line+mysql update

2002-07-05 Thread colin mcdonald

use addslashes

update table1 set column1= '.addslashes($string).' where ID = 
'$IDcurent'

Adi wrote:
 tx, it's working now
 but i still have a problem:
 i want to insert into mysql database value $string:
$result2 = db_query(update table1 set column1= '$string' where ID =
 '$IDcurent') or db_die();
 When i try to view in text area the new value from column1, the newlines
 disappear!
 
 ps.column 1 have type text or varchar(100)
 Is a problem of type?
 
 tx again
 adi
 
 
 - Original Message -
 From: Henning Sittler [EMAIL PROTECTED]
 To: 'adi' [EMAIL PROTECTED]
 Sent: Friday, July 05, 2002 4:05 PM
 Subject: RE: [PHP] textarea new line
 
 
 
$string=-line1\n -line2 \n-line3;

\n

Henning Sittler
www.inscriber.com



-Original Message-
From: adi [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 05, 2002 9:04 AM
To: php-general
Subject: [PHP] textarea new line


i want to add in textarea a string with new line tag in it. how to do
 
 that?
 
my try:
$string=-line1n\ -line2 n\-line3;
echo brtextarea name='aria' cols='50' rows='2'$string/textarea;

but i see a single line instead of:
-line1
-line2
-line3

tx in advance for any help

 
 



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




[PHP] Re: php form with textarea

2002-07-05 Thread colin mcdonald

looks like it should work.  try echoing $action and make sure that it's 
the value you want.  you may want to try $_POST['action']

Adi wrote:
 I have a php file with two textarea and one button; i want when i press button, 
value from textarea2 is filled in textarea1.
 can u help me?
 
 my try is:
 
 //file1.php
 
 if ($action == change) {
 $arie1=$arie2;
 }
 
 echo textarea name='arie1' cols='50' rows='3'$arie1/textarea;
 echo form action=file1.php?action=change method=post\n;
 echo textarea name='arie2' cols='50' rows='3'$arie2/textarea;
 echoinput type='submit' name='submit' value='save';
 ...
 
 



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




[PHP] Re: Configuring the Session Function in php.ini for WinNT...

2002-07-05 Thread colin mcdonald

I set it to:

session.save_path = c:\temp\

And it works great for me

Kondwani Spike Mkandawire wrote:
 Does anyone know how to configure the session function in
 the php.ini File under WinNT...  The Session Function appears
 to be generic to UNIX...  What do I change the save_path
 variable to...
 
 session.save_path = ?
 
 
 


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




[PHP] Re: Stack Overflow with: zend optimizer

2002-07-08 Thread colin mcdonald

Richard Lynch wrote:
 
 You *MIGHT* try installing the Optimizer on a Dev box and turning on *ONE*
 opitmization group/feature at a time and then pounding on that Dev server
 with 'ab' until you narrow down which optimizations are the trouble-makers.

Tried that.  Each optimization value/setting fails in the same way.

 
 Why in the *WORLD* do you have hundreds of includes, though?
 

Easier to organize, maintain and it's the only a group of developers can 
  work efficiently on a project at the same time.

 
 You do realize that including a hundred include files is incredibly slow,
 right?...  You may be able to drastically improve performance if there's any
 way to combine those files...
 

We tested this a long time ago and there was little time difference 
between one file and many files.  I think this has to do with the fact 
that the page already take roughly a 2 seconds to load, so a couple tens 
of milliseconds didn't make a difference.

Thanks for the advice,

colin


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




[PHP] Re: Stack Overflow with: zend optimizer

2002-07-08 Thread colin mcdonald

Oh yeah, this is what I did to stabilize the server:

-take out zend_optimizer from php.ini
-put process isolation level to HIGH (as Michael suggested)
-put IIS in the ISAPI filter list
-disable chaching of isapi applications

colin

Colin McDonald wrote:
 Richard Lynch wrote:
 

 You *MIGHT* try installing the Optimizer on a Dev box and turning on 
 *ONE*
 opitmization group/feature at a time and then pounding on that Dev server
 with 'ab' until you narrow down which optimizations are the 
 trouble-makers.
 
 
 Tried that.  Each optimization value/setting fails in the same way.
 

 Why in the *WORLD* do you have hundreds of includes, though?
 
  
 
 Easier to organize, maintain and it's the only a group of developers can 
  work efficiently on a project at the same time.
 

 You do realize that including a hundred include files is incredibly slow,
 right?...  You may be able to drastically improve performance if 
 there's any
 way to combine those files...

 
 We tested this a long time ago and there was little time difference 
 between one file and many files.  I think this has to do with the fact 
 that the page already take roughly a 2 seconds to load, so a couple tens 
 of milliseconds didn't make a difference.
 
 Thanks for the advice,
 
 colin
 



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




[PHP] Re: snmpwalk

2002-07-08 Thread colin mcdonald

it's the space between ? and php

colin


Maas wrote:
 Hi
 
 Iam trying to use snmpwalk but I get this:
 
 Parse error: parse error, unexpected T_VARIABLE in
 c:\inetpub\wwwroot\alarm.php on line 7
 
 This Is my code:
 
 HTML
 HEAD
 TITLEALARM ???/TITLE
 ? php
 $a = snmpwalk(192.168.10.8, pub_likt, 1.3.6.1.2.1.1);
 ?
 /HEAD
 /HTML
 
 
 



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




[PHP] Re: hide a select tag

2002-07-08 Thread colin mcdonald

why not use a hidden field instead of a select?

Anil Garg wrote:
 Hi,
 
 sorry for going a lil out of way of php.
 can i hide a drop down menu.(as i always want to pass the default value
 selected in the drop down.
 
 thanx and regards
 anil
 



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




[PHP] Re: sessions

2002-07-10 Thread colin mcdonald

try this (I think you have register_globals turned off)

  Page 2:
 
  ?
  print $_SESSION['test_var'].!;
  ?
 


Alexander Ross wrote:
 I'm trying to understand sessions so I can set session variables. I set up 2
 very simple pages:
 
 Page 1:
 
 ?
 session_start();
 $test_var = froggy;
 session_register('test_var');
 ?
 a href=page2.phpClick here/a
 
 
 Page 2:
 
 ?
 print $test_var.!;
 ?
 
 
 This doesn't seem to work though.  $test_var doesn't seem to have a value
 when I go the second page.  What am I missing.  Thanks for helping a newbie.
 
 Alex
 
 



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