[PHP] Re: Postgres-Transaction-user_ignore_abort-Connection stop by theclient

2002-10-16 Thread Yasuo Ohgaki

Max Buvry wrote:
 My script php follows this steps :
 
 ignore_user_abort(0|1)
 Compute the key - v
 BEGIN WORK
 UPDATE the first bank account with v (credit)
 sleep(300)

Make sure you have long enough timeout limit.

 UPDATE the second bank account with v+1 (debit)
 COMMIT WORK

It works for me. (at least with CVS version)

If there is uncommitted transaction, pgsql module
rollback automatically.

BTW, if you have too long timeout limit, your site
became weaker for DoS attack.

--
Yasuo Ohgaki



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




[PHP] Re: Checking Insert to Postgre, whats wrong?

2002-07-28 Thread Yasuo Ohgaki

Bård Magnus Fauske wrote:
 But when I print the result from pg_fetch_result() to the browser (last 
 lines above), I only get the first letter in the string $fornavn[$i] and 
 similar strings not listed above, not the whole string. What is the 
 reason for this? Has it something to do with the pg_last_oid()? I can't 
 see how since this only identify the inserted row (or am I wrong?) which 
 I select afterwards.
 
 Thanks for answer.


This is not a direct answer.

Since you are using 4.2.0 or later, you are better to use
pg_status() or pg_result_status() to check these things.

i.e. You don't have to select row just to make sure
row is inserted or not. It wastes lots of resource.

--
Yasuo Ohgaki


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




[PHP] Re: Session data not being deleted on browser close.

2002-07-09 Thread Yasuo Ohgaki

Don't cross post such question...

All you need to understand is how cookie is managed unless
you are passing session id via URL.

Read RFC2965 and RFC2964.
You probably want to read netscape cookie spec also.

--
Yasuo Ohgaki

Youngie wrote:
 Why would my session data not be deleted after my browser is closed?
 
 I can set some session variables, close my browser, reopen them and the old
 values are still present,
 I can verify this by seeing that the file still containts my session data
 and values.
 
 Thanks
 
 John.
 
 



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




[PHP] Need info abou ASP/Java HTML Form handling

2002-06-06 Thread Yasuo Ohgaki

Hi All.

Could anyone tell me any reference for ASP and/or Java HTML
form handling script/program/module/class/etc?

I'm going to write PHP module for easier HTML form
handling and would like to know what kind of feature/options
ASP/Java have.

Thanks.

--
Yasuo Ohgaki


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




Re: [PHP] Need info abou ASP/Java HTML Form handling

2002-06-06 Thread Yasuo Ohgaki

Chris Knipe wrote:
 *urgh*
 
 So off topic it's not funny  http://www.microsoft.com/vbscript /
 http://www.microsoft.com/jscript/
 
 I might not be 100% correct on the urls.  Just search for VB / JS Script
 Refence at microsoft.com

Thanks for the input, but I know the url of cource.

I'm one of a PHP developer writing C code for you
and asking some inputs to develop HTML Form handling
module for PHP written in C.

There should be many people know much more about ASP/Java
than me especially ASP.

Anyway, I don't mind if it a commercial product or not.
Anyone knows what kind of HTML form handling mechanism
(I mean thing that does, automatic JavaScript validatator
code creation, automatic user input validator such as
CGISPAWN mentioned in MSDN, automatic HTML4 form generation
from XML definition, regular expression based server side
validation, etc)

I need feature list so that I can write better module.
It's always good to know what others do before starting
my own ;)

--
Yasuo Ohgaki
[EMAIL PROTECTED]
[EMAIL PROTECTED]


 
 
 Kind Regards,
 
 Chris Knipe
 MegaLAN Corporate Networking Services
 Tel: +27 21 854 7064
 Cell: +27 72 434 7582
 
 - Original Message -
 From: Yasuo Ohgaki [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 07, 2002 6:24 AM
 Subject: [PHP] Need info abou ASP/Java HTML Form handling
 
 
 
Hi All.

Could anyone tell me any reference for ASP and/or Java HTML
form handling script/program/module/class/etc?

I'm going to write PHP module for easier HTML form
handling and would like to know what kind of feature/options
ASP/Java have.

Thanks.

--
Yasuo Ohgaki


--
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] Why is there no OPTION EXPLICIT equivalent?

2002-05-30 Thread Yasuo Ohgaki

 Go to your php.ini and turn on full error reporting.you'll get 
 warning message if you do not initialize varsas of php4.2.1
 

Small correction.
Most version of PHP3/4 (if not all) can raise E_NOTICE error.

--
Yasuo Ohgaki






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




[PHP] Re: more session bugs?

2002-05-02 Thread Yasuo Ohgaki

Disable register_globals. Then it should work.
BTW, this is wrong behavior, but it's documented.

--
Yasuo Ohgaki

Mike Eheler wrote:
 Here's a test you can try yourself.
 
 On your server, set up these two files:
 
 test.php
 
 ?php
 session_start();
 if ($_REQUEST['var']) $_SESSION['var'] = $_REQUEST['var'];
 ?
 pre?php print_r($_SESSION); ?/pre
 a href=test-unset.phpClick here to unset/abr /
 a href=test.php?var=valueClick here to set/a
 
 test-unset.php
 --
 ?php
 session_start();
 unset($_SESSION['var']);
 session_write_close();
 header(Location: test.php));
 exit();
 ?
 
 What's supposed to happen: You click on the set link, this sets the 
 variable. You then click on the unset link. This loads another page 
 which unsets the variable, saves the session, then returns you to the 
 original page through a redirect.
 
 This does not happen. When you return to test.php, the _SESSION variable 
 remains. Why?
 
 Mike
 



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




[PHP] Re: Announcement: Smarty template engine 2.1.0 released

2002-05-01 Thread Yasuo Ohgaki

Monte Ohrt wrote:
 Homepage:
 http://www.phpinsider.com/php/code/Smarty/
 

I don't like most template implementations, but
Smarty is great.

--
Yasuo Ohgaki



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




[PHP] Re: file() and macintosh line break

2002-05-01 Thread Yasuo Ohgaki

Rodrigo Peres wrote:
 Hi list,
 
 I'm in a problem that is driving me crazy!!! I want open a file and puts 
 each line into an array, but this files was created in macintosh!! so 
 the file() can't recognize the end line and only outputs 1 element in 
 array!! How can I solve it. I tried to fread() the file and 
 eregi_replace the line breaks, it worked, but now I don't know how to 
 use this to create the array!
 

You can use split().
I think Mac linebreak is better to be recognized by PHP...

--
Yasuo Ohgaki




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




[PHP] Re: PHP4.2.0 + Apache2 prints code

2002-04-30 Thread Yasuo Ohgaki

James Stuart wrote:
 I've installed Apache 2.0.35 with PHP 4.2.0 on both FreeBSD and Linux, and
 both yield the same result.  When the test.php page is accessed it returns
 ?php phpinfo(); ? instead of actually processing it.
 
 I have the lines:
 LoadModule php4_modulemodules/libphp4.so
 AddType application/x-httpd-php .php
 in my httpd.conf files, and the /server-info page displays the server as:
 Server Version: Apache/2.0.35 (Unix) PHP/4.2.0
 It also indicates that sapi_apache2.c is loaded.  I've tried making the
 php files +x, and also accessing them in directories that are set as Options
 ExecCGI, but nothing causes apache to actually process the php.
 
 I have to be doing something wrong here, but for the life of me I can't
 figure out what it is.  The only thing I can think of that might help is an
 AddHandler line, but I don't know what I'd put there as a handler.
 
 Any thoughts/comments/ideas would be greatly appreciated.
 

Read README file in the SAPI directory.

sapi/apache2filter/README

--
Yasuo Ohgaki


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




[PHP] Re: PHP session / JavaScript conflict

2002-04-24 Thread Yasuo Ohgaki

Larry Linthicum wrote:
 I am finding that the simple ? session_start(); ?
 
 is causing pages with JavaScript menus to load with 'error on page and the
 JavaScript to not work
 
 the session without the JavaScript seems fine, as does the JavaScript
 without the session ( I can do other things in PHP without conflict)
 
 Lastly... refreshing the page causes it to load fine...with the session
 started
 
 Ideas?  on what I might be doing wrong?   I have used php sessions without
 problem for some time, the JavaScript is generated by DreamWeaver
 

Turn off trans-sid feature.

--
Yasuo Ohgaki


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




[PHP] Re: .phps

2002-04-20 Thread Yasuo Ohgaki

Mantas Kriauciunas wrote:
 Hey [EMAIL PROTECTED],
 
  as i understand files .phps should view code nice and in colors...
  but when i set up everything good in http.conf and (as i think)
  everything is perfect it wants me to download that .phps
  file...what can be wrong? im using PHPTriad on win2k
 
  thank you

Don't even try to use it. It's a obsolete feature.
use show_source() instead. It always works.
(Read .phps does not work always, even if you
set things up right)

--
Yasuo Ohgaki


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




[PHP] Re: php printer functions...

2002-04-18 Thread Yasuo Ohgaki

Jimmy wrote:
 I'm running PHP 4.1.1 on a Win2K box.  If I understand the manual correctly,
 the printer functions have been integrated into PHP as of v4.0.4.  However,
 when I try to call any of the printer functions, nothing works.
 
 Any ideas or suggestions?
 

You need to build/install extension by yourself.
printer extension is PECL module now, IIRC.

--
Yasuo Ohgaki



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




[PHP] Re: unlink security problem

2002-04-17 Thread Yasuo Ohgaki

If you care about this problem, upgrade to 4.2.0 when
it's available.

--
Yasuo Ohgaki


Patrick Cossette wrote:
 I'm running PHP 4.1.2 as an Apache module (Apache 1.3.24) under AIX 4.3.3.
 
 My problem has been covered in Bug #13447 but I still have it and the bug
 was under Windows 2000 but I'm running AIX. It's a security
 problem with unlink. My site runs as the user web but different parts of
 my site are modified by different developpers. Since all
 files are owned by web, I set up an open_basedir so each developper is
 limited to make file operations on his directory-tree. My
 problem is that this setup does not prevent unlinking, which means that one
 can delete files that are not under his directory-tree, and
 I do not want that. With the following setup, fopen and include are
 restricted by openbasedir, which is good. But one can unlink a file
 even if it's not under his directory-tree. I have the following in
 httpd.conf:
 
 Directory /u/uq/web/www.uqtr.ca/
 Options Indexes Includes FollowSymLinks
 AllowOverride None
 Order allow,deny
 Allow from all
IfModule mod_php4.c
   AddType application/x-httpd-php .php
   php_flag engine on
   php_admin_value safe_mode 1
   php_admin_value safe_mode_exec_dir /u/uq/web/www.uqtr.ca/
   php_admin_value doc_root /u/uq/web/www.uqtr.ca/
   php_admin_value open_basedir /u/uq/web/www.uqtr.ca/
   php_admin_value user_dir /u/uq/web/www.uqtr.ca/
/IfModule
 /Directory
 
 
 The file testerase.php is in /u/uq/web/www.uqtr.ca and contains this:
 
 ?php
 include ('/u/uq/web/entete.uqtr.ca/file_to_include');  // THE INCLUDE DOES NOT WORK: 
IT'S RESTRICTED BY OPEN_BASEDIR AND I'M GLAD
 unlink ('/u/uq/web/entete.uqtr.ca/file_to_delete');  // THE UNLINK WORKS: NO 
RESTRICTION AT ALL AND I'M UNHAPPY
 ?
 
 I need help. Is it possible to bypass file deletion permission and restrict
 the directories in which to unlink?
 
 Thanks,
 
 Patrick
 [EMAIL PROTECTED]
 
 
 
 



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




[PHP] Re: mailing list using mail()

2002-04-10 Thread Yasuo Ohgaki

Michael Virnstein wrote:
Should I just use one message and append the BCC: line of the one message?
 
 
 this could probably be the best way.

Right, but some MTA cannot handle too large header(s).

Why don't you use list server in first place?
For example, ezmlm support database backends if you
are using qmail. PHP has ezmlm_hash function for it.

--
Yasuo Ohgaki



 
 Petre Agenbag [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
Hi,
the combination of PHP and mysql and the ease of use of the mail()
function obviously leads me to believe that it *should* be a singe to
use php to send customised messages to all my users , of whom I have
details in a mysql table by simply running a select * from table and
then using a while loop to run through every row and sending an e_mail
to $user_in_table.

The obvious problem here is that ( in my case 17 000 users) this can
easily kill the mail server and could also cause the script to timeout
or ( if increasing the timeout) kill the server outright.
So, what are my options?
Should I be attempting this ( if not, how can I keep others that are
hosting on my machines from trying this with their own tables)
Should I just use one message and append the BCC: line of the one message?

Thanks

 
 
 



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




Re: [PHP] sablotron XMl XSLT

2002-04-09 Thread Yasuo Ohgaki

Matthew Luchak wrote:
 Thanks Ray  but what I need to know is if there is indeed a better way than what 
I've tried to test if sablotron has been complied or not.

http://www.php.net/manual/en/function.get-loaded-extensions.php
http://www.php.net/manual/en/function.get-extension-funcs.php

You are probably looking for these.

--
Yasuo Ohgaki






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




[PHP] Re: Newman Says: Error when starting sessions.

2002-03-31 Thread Yasuo Ohgaki

Philip J. Newman wrote:
 I'm trying to start a session, and I get this error.
 
 I have been told its something to do with a missing dir is my php dir?
 
 Warning: open(1\sess_0513b5c5d7021f1acdcf9f732032081f, O_RDWR) failed: No such file 
or directory (2) in Unknown on line 0
 

You have invalid session.save_path

--
Yasuo Ohgaki


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




[PHP] Re: Postgres question

2002-03-31 Thread Yasuo Ohgaki

In addition to oid2name mentioned, you might want to know
about system catalog schema.

It's explained in manual

http://www.postgresql.org/idocs/index.php?catalogs.html

--
Yasuo Ohgaki

Robert Abbate wrote:
 Greetings to all!
 
 I have a webhosting company, and I'm trying to be able to use PHP to
 calculate each of my hosting customer's Postgres database disk usage. It
 doesn't seem as easy as MySQL (since MySQL uses the user name to store all
 their database files).
 
 Does anyone know how I can calculate PostgreSQL disk space usage for each of
 my hosting user accounts?
 
 It seems I'm going to have to find out how Postgres keeps track of which
 user's database name is and it's corresponding number (so far, I've been
 able to determin that Postges uses numbers instead of names).
 
 Can anyone give me some insight?
 
 Thanks!
 Robert
 
 



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




[PHP] Re: Text Editor

2002-03-24 Thread Yasuo Ohgaki

Hiroshi Ayukawa wrote:
 Hello,
 
 What text editor do you use to write PHP?
 I use Maruo editor http://www.ac.wakwak.com/~tetsuyat/maruo/ more than 1 
 year.
 Is there any better text editor for PHP?

Emacs is _much_ better than HideMaru.

I use emacs for most text editing. If you need multi byte char
under windows, use Meadow (it's a Emacs(Mule) for Windows, kind of).
I use php-mode/folding-mode for PHP sources.

If you are looking for IDE, ZendStudio is the way to go.

--
Yasuo Ohgaki


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




[PHP] Re: Each() behaving different with PHP 4.1.2

2002-03-03 Thread Yasuo Ohgaki

Greg Breland wrote:
 I recently upgraded my site from PHP 406 to PHP 412  The following
 bit of code quit working:
 
 static $navigationLinks = array (
   indexphp3 =  News,
   downloadphp3 = Download,
   linksphp3 = Links,
   archived_newsphp3 = News Archives );
echo   div style=\border-style:solid;\\n;
echo ul\n;
  while( list( $link, $label) = each( $navigationLinks ) ) {
echo li;
if( $PHP_SELF == $link ) echo  class=\currentPage\;
echo a href=\$link\$label/a/li\n;
  }
echo /ul\n;
echo   /div\n;
 
 
 If $navigationLinks is NOT declared as static, then the code will work
 with PHP 412  It works both ways with 406  Just an FYI and
 wondering if anyone knows why?
 
 Greg Breland
 
 

Create shortest  complete script and submit this bug with the script
I don't notice this bug nor bug report, but make sure you search
bug db for the same bug

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Re: Global Variable Change

2002-03-01 Thread Yasuo Ohgaki

Thomas Brodkorb wrote:
 Hi folks,
 
 small problem with globals:
 
 I would like to set a variable global called Language
 
 This seems to be not a really problem, but it is
 
 Indexphp:
 
 ?php {
   session_start();
   if (!session_is_registered('Language')) {
 session_register('Language');
 $Language = 1031;
   }
  
 ?
 
 But all other pages do not have really access to this variable without
 calling start_session() from within the other pages()

You must start session implicitly or explicitly I suggest to start
session explicitly Do not use auto start

 
 If I call, it works
 
 Now the real problem
 
 I would like to set $Language by an Hyperlink with image hyperlinks, but it
 doesnt change anything
 Within the hyperlink I call setlanguagephp?lang=1033
 
 ?php {
   session_start();
   if ( ($lang  1031) and ($lang  1033) ) {
 $lang= 1031; }
   $Language = $lang;
   if (session_is_registered('Language')) {
 session_unregister('Language');
   }
   session_register('Language');
 } ?
 
 But it doesnt change ANYTHING 

What is not changed?

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] [ANN] session_pgsql 0.2 (alpha) released

2002-02-20 Thread Yasuo Ohgaki

Hi all,

session_pgsql version 0.2 (beta) is released.

New:
  - Auto global variable $_APP is added. It's a
application scope variable. You can share
values in the same application. It uses
session name for application name.

Feature:
  - More than 2 times faster than 'user' save
handler and PostgreSQL.
  - Automatic session and applicaton variable
table creation.
  - Time based GC.
  - Don't read expired session data.
  - Since it uses PostgreSQL, you can query
session and application data whatever
you want.
  - Multiple web servers shares session.

Manual:
  http://pear.php.net/manual/en/pecl.session-pgsql.php
  (a little old...)

Download:
  http://sf.net/projects/phpform-ext/

Read README file for details.
Enjoy!

-- 
Yasuo Ohgaki


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




[PHP] Re: class and session identyfier

2002-02-14 Thread Yasuo Ohgaki

Sasza wrote:
 hi
 I've got session identyfier in $session_id. In all sites it can be see very
 well. But in one site I use class in this form:
 class name {
 function1();
 function2(); etc.
 } and inside it the $session_id is unknown(outside class is OK). What should
 I do inside class that my session idetyfier will be known??
 thx
 sasza
 
 
 

Read the manual
http://www.php.net/manual/en/

PHP has a little different concept for globals.

-- 
Yasuo Ohgaki


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




[PHP] Re: Sessions just not working...

2002-02-14 Thread Yasuo Ohgaki

Norman Cates wrote:
 I cannot get session information to work under any circumstances
 
SNIP
 But even reading the comments on the above page, nothing will work. It will
 not persist with the session variable...
 
 Am I doing something wrong?

If you are using recent PHP, track vars are always on.
Anyway, try E_ALL for error reporting, you might see
some error messages from sessoin module.

-- 
Yasuo Ohgaki


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




Re: [PHP] Re: Changes in Sessions (PHP Versions)

2002-02-05 Thread Yasuo Ohgaki

If you really need to use 4.0.6, try to use different
session save handler and/or serializer. Try WDDX
serializer at first, then try verious combinations.

If you use other save handler/serializer, it may work.
I suggest you to upgrade, though...

--
Yasuo Ohgaki


Travis Simpson wrote:
 Sorry, I probably worded my question wrong.
 
 I am creating a 10 step (or so) form that is non-linear... The user
 enters all of their information and is able to go back and change
 information that they have filled in. So I have the form (POST)
 information set into session variables as soon as they click Next in
 the form. Well, with 4.1.1 there were no problems... It ALL worked
 perfectly. But unfortunately, in 4.0.6 it doesn't act the same.
 
 I just have a foreach loop go through all the POST variables and make
 them into SESSION variables,
 
 --- Snippet ---
 start_session();
 foreach ($HTTP_POST_VARS as $key = $value) {
   $HTTP_SESSION_VARS[$key] = $value;
 }
 --- End Snippet ---
 
 Easy enough... Now, I have all the 10 steps linked to on the side bar.
 a href=step1.php?PHPSESSID=$PHPSESSIDStep 1/a
 
 But for some weird reason, those links BLANK all the session variables.
 I tested this by doing a count() on the HTTP_SESSION_VARS array. And as
 soon as I click one of the Step links on the side, it clears all of
 them. I am not sure if I am doing this wrong, but it works fine (as I
 said) in 4.1.1.
 
 Another problem that I seem to be having... Is that 4.0.6 almost seems
 like it is maxing out with a certain number of SESSION variables. Once
 it has so many, it just starts over.
 
 I will just post the link here tomorrow, unfortunately I don't have the
 files on this computer.
 
 I hope this is a little more clear.
 
 Thanks,
 -Travis
 
 
 
 -Original Message-
 From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, February 04, 2002 6:11 PM
 To: [EMAIL PROTECTED]; Travis Simpson
 Subject: [PHP] Re: Changes in Sessions (PHP Versions)
 
 
 Travis Simpson wrote:
 
Hey,

I am just wondering if there were any changes done to the session 
engine or settings between PHP 4.0.6 and 4.1.1.

I have been getting nothing but grief from 4.0.6 and 4.1.1 seems to 
work fine.


 
 
 What did work with 4.0.6 and what didn't with 4.1.1?
 
 If you are trying to use mm/msession save handler, it's broken somewhat.
 
 


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




[PHP] Re: PHP v4.1.1 WDDX problems

2002-02-04 Thread Yasuo Ohgaki

Adam Cassar wrote:
 Hi All,
 
 I am attempting to compiler php v4.1.1 as a fast cgi runner with WDDX.
 
 I get all the way through the compile and it get's stuck at:
 
 ./.libs/libphp4.a(wddx.o): In function `php_wddx_push_element':
 /usr/local/src/php-4.1.1/ext/wddx/wddx.c:780: undefined reference to
 `xml_utf8_decode'
 ./.libs/libphp4.a(wddx.o): In function `php_wddx_process_data':
 /usr/local/src/php-4.1.1/ext/wddx/wddx.c:911: undefined reference to
 `xml_utf8_decode'
 
 I take it that it's having some problems linking to the xml module? Any
 ideas?
 
 
 

WDDX requires XML. I suppose you don't have one.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


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




[PHP] Re: Changes in Sessions (PHP Versions)

2002-02-04 Thread Yasuo Ohgaki

Travis Simpson wrote:
 Hey,
 
 I am just wondering if there were any changes done to the session
 engine or settings between PHP 4.0.6 and 4.1.1.
 
 I have been getting nothing but grief from 4.0.6 and 4.1.1 seems to work
 fine.
 


What did work with 4.0.6 and what didn't with 4.1.1?

If you are trying to use mm/msession save handler, it's broken
somewhat.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


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




[PHP] Re: PHP Classes and Sessions

2002-02-04 Thread Yasuo Ohgaki

Php-List wrote:
 What is the proper way to transfer class properties through-out my pages...
 
 let's say i have a ShoppingCart Class and i have methods like
 addToCart(id, qty) and deleteFromCart(id)
 also i have properties like CartItems(id = array(), qty= array())
 
 this is what i do...
 
 //when the user enters my site, i do some...
 -
 if (!session_is_registered(myCart)){
 $myCart = new ShoppingCart();
  (some other stuffs...)
 session_register(myCart);
 }
 else {
 $myCart = new ShoppingCart();
 }
 

You are not following session manual page...

You are over writing $myCart with second new statement.
You don't need it and your can use $myCart if
ShoppingCart class definition is included before
starting session.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


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




[PHP] Re: Using session functions in PHP4.1.1

2002-02-03 Thread Yasuo Ohgaki

John Mpaliza wrote:
 Hi,
 
 I'm using Win ME-Apache1.3.22-PHP4.1.1 and run this script:
 ?php
 session_start();
 ?
 I got this error: Php has caused an error in PHP4TS.DLL and will be closed. If the 
problem continues try to reboot your system.
 And in the Apache log file I got : Premature end of script headers.
 This happens when using functions: session_start and session_register
 What can I do to resolve the problem.
 
 

You have invalid session.save_path, right?
It will be fixed next release or 4.2.0.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


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




[PHP] Re: Sessions in URL not being recognized!

2002-02-03 Thread Yasuo Ohgaki

Try to enable output bufffering to see if it helps.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


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




[PHP] Re: use_trans_sid

2002-02-03 Thread Yasuo Ohgaki

Justin French wrote:
 Hi,
 
 When I run phpinfo(), use_trans_sid is set to 1 (assume 1 = enabled) on
 both my test server, and on my live server.  Great!
 
 Only trouble is, when I disable cookies in my browser, the sessions are
 lost (in this case, each page asks me to login, rather than only once).
 
 Is there anything special I have to do to ensure I have a system which
 uses cookies by default, and use_trans_sid as a second option, without
 have to carry the SID around in the URL? (page.php??=SID?)?

Look for my PHP4 sesison helper HTML in www.zend.com Code Gallary.

-- 
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)


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




[PHP] Re: use_trans_sid

2002-02-03 Thread Yasuo Ohgaki

Justin French wrote:
 Hi,
 
 I didn't have much luck finding it... If you have a chance to send me a
 link, that'd be great, otherwise I'll just keep looking :)
 
 Justin

Try link :)

http://www.zend.com/search_code_author.php?author=yohgaki

--
Yasuo Ohgaki

 
 
 
 Yasuo Ohgaki wrote:
 
Justin French wrote:

Hi,

When I run phpinfo(), use_trans_sid is set to 1 (assume 1 = enabled) on
both my test server, and on my live server.  Great!

Only trouble is, when I disable cookies in my browser, the sessions are
lost (in this case, each page asks me to login, rather than only once).

Is there anything special I have to do to ensure I have a system which
uses cookies by default, and use_trans_sid as a second option, without
have to carry the SID around in the URL? (page.php??=SID?)?

Look for my PHP4 sesison helper HTML in www.zend.com Code Gallary.

--
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 



-- 
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




[PHP] Re: --enable-transid and slash URI's

2002-01-29 Thread Yasuo Ohgaki

Tomek Golembiewski wrote:
 I've got a problem. I want to propagate sessionid using this greate php 
 feature --enable-transid but I want pretty slash url too (I mean 
 www.eee.com/w/12/2344556b44455).
 I don't want transid to add sessionid at the end of each link with ? or , I 
 want only slah
 (/session_id_here). Is the any way to change this behaviour?
 

Disable trans-sid and do it by yourself :)
-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: getmxrr() is not supported

2002-01-27 Thread Yasuo Ohgaki

Philip J. Newman wrote:
 I'm running PHP Version 4.0.5
 Php Says this:
 
 Warning: getmxrr() is not supported in this PHP build in d:\website\myphp\test1.php 
on line 5
 
 The documents say:
 
 (PHP 3, PHP 4 = 4.0.0)
 
 I'm condused.
 

Some functions are missing in Windows version :)

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Need opinion On sessions - Cookies mandatory?

2002-01-24 Thread Yasuo Ohgaki

AND don't forget about X-FORWARDED-FOR.
(ie load balanced cache servers)
X-FORWARDED-FOR can be faked.

--
Yasuo Ohgaki

Compman86 wrote:
 If there are two people behind a NAT, then the site would check for a
 session ID and the IP. If a session ID is introduced AND their IP
 matches the session, they are allowed to proceed. This would prevent
 people from moving a session ID to another machine. If two people are
 behind a NAT and share a session ID, I don't think there is a way of
 preventing them to be assumed as the same person. So basically, it will
 try to use cookies alongside a matching IP, and if cookies are disabled,
 it will use the GET method alongside a matching IP. It just makes a
 double check of the user...half the risk of transferring session ID's
 among people...but still not fullproof...but I don't think there is a
 fullproof way.
 
 Dl Neil [EMAIL PROTECTED] wrote in message
 news:0ad801c1a4ba$3d49bec0$7215100a@jrbrown...
 
Entering the conversation late...

1 IP addresses
Remember these are not necessarily 'unique'. If two of us here log in,

 
won't we appear (to you) have the same IP address if we're 'hiding' 
behind a NAT (Network Address Translation) box? Also dial-up users 
share a pool of IP addresses which are reallocated between customers 
as they disconnect/reconnect.

2 Cookies
I think someone has already made points against their use. Many 
corporates set up/require that browsers are configured to reject all 
cookies (plays havoc with many shopping and banking sites). Obviously 
there is popular advice that cookies are 'not good', because I've had 
a number of friends and clients tell me that they regularly clear out 
their 'cookie jar' - and need help when they get over enthusiastic and

 
clear more than they should...

There's a balance between easing life for those who are 'in', and 
turning off those trying to arrive. The trick is finding it! =dn


- Original Message -
From: SpamSucks86 [EMAIL PROTECTED]
To: 'PHP-General' [EMAIL PROTECTED]
Sent: 23 January 2002 23:46
Subject: RE: [PHP] Need opinion On sessions - Cookies mandatory?



The idea of building a website is largely to accommodate as large a 
portion of your visitors as possible. I'm not worried about people 
bookmarking sessionID's, but what if someone copy/pastes the URL to 
a friend and they use the section. My friend gave me an excellent 
idea, and that is to check their IP and store the IP in the session.

 
If the IP doesn't match, then start a new session. This would be 
perfect, because there's a double check. If someone disconnects to 
the internet but never closes their browser, I don't think they 
should be allowed to continue their session anyway, they should be 
required to login again.

-Original Message-
From: Nick Wilson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 3:35 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Need opinion On sessions - Cookies mandatory?

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Jason G. blurted

If cookies do not work, then you must have a session_id appended 
to

the

URL.  HTTP is a stateless protocol.  So every time you make a

request via

HTTP, you must let PHP know what the session_id is either through

cookies,

or url query strings (or possibly posted with a form).

Yep, now I'm with you. The amount of times you'd see that kind of 
ugly URL would be fairly minimal in most situations as most users 
these days aren't even aware they *can* disable cookies.



disable cookies, but appending the session ID could be a 
security

risk.

Consider this: Someone is viewing a page and says oh cool, I 
want

Joe

to see this. He then copy/pastes the URL, sessionID and all, 
to

Joe,

who then loads up the page using his friend's SessionID. With

cookies,

this would not happen.

Not a problem. The session is *destroyed* as soon as a user 
closes

the

browser.

A session will only be *destroyed* if it uses a cookie. PHP never

knows

when you close the browser, but the browser will remove the 
cookie.

Next

time you fire up the browser, it will not send the cookie, and a

different

session will be started.

Sure. But there is some kind of clean on the host machine right? You

 
couldn't expect to continue a session a week later because you've 
bookmarked a URL containind a SID. I think this is controlled by 
something like a timeout var in the php.ini.


In my personal experience, using cookies only has not proven to be

 
a problem.  Your call.

When you say using cookies only do you mean 'requiring' the user to 
have cookies enabled?

- --

Nick Wilson

Tel: +45 3325 0688
Fax: +45 3325 0677
Web: www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8TnW3HpvrrTa6L5oRAthOAJ0WOpUWC5fFMokhYF2QsaQaQolp+wCfQWHL
03BrqRN2kLf+VWC/tzDSHho=
=Gek0
-END PGP SIGNATURE-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional

[PHP] Re: [Kopia] [PHP] Re: Sessions problem with FreeBSD 4.3

2002-01-23 Thread Yasuo Ohgaki

Jeff Sheltren wrote:
What happens if you set register_globals=Off and use
$_SESSION?


 Thanks for the reply.  I will try changing register_globals to Off.  I am
 not quite sure I know what you mean by using $_SESSION though, could someone
 please explain how that is uesd?
 

Session manaul pages are updated. There is enough explanation how to
use $HTTP_SESSION_VARS/$_SESSION now :)

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP Sessions

2002-01-23 Thread Yasuo Ohgaki

David Orn Johannsson wrote:
 I'm Trying to make a simple authentication for a news-system.
 I have a encrypted passwd in a db that i fetch and compare to the user
 input and if it compares ok then the user sees the catagories that he
 can select from. 
 
 The thing is I'm not quite getting the thing with sessions I mean I
 start a session with session_start() and then register vars with
 session_register(), in this case I register uid = user_id and sid =
 session_id().

I recommend *NOT* to use session_register/unregister/is_registered().
Use $HTTP_SESSION_VARS/$_SESSION.

If you really have to use session_register and others, *NEVER* use 
$HTTP_SESSION_VARS/$_SESSION in your script.

BTW, you don't have to keep track session id.

 
 Then I print out a link lets say it is called just news and I want to
 pass the uid along I just print out 
 a href=\news.php?uid=$uidsid=$sid\news/a or aint I requred to
 print it along? Can I just start a session on the news.php and check if
 $sid exists.

If you use trans-sid, you don't need to add session ID to your
php script (HTML part I mean)

It also handles automatic fallback from cookie session to URI session.
(Although, it sometimes fails to detect cookie for some browser. You
need additional effort to make sure use cookie when cookie is available.)


 
 And one thing if I have a link like this one a
 href=\news.php?uid=$uidsid=$sid\news/a can people just type
 news.php?uid=2sid=something and get the page or am I just being silly?

Any one can change session ID. It just only easier when session ID is in
URI :) We have to live with that.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Having a problem with sessions?

2002-01-21 Thread Yasuo Ohgaki

Henrik Hudson wrote:
SNIP
 
 _
 session_start();
 
 if (!isset($HTTP_SESSION_VARS[count])) {
 $HTTP_SESSION_VARS[count] = 0;
 }
 else {
 $HTTP_SESSION_VARS[count]++;
 }
 //Print the counter
 
 echo Counter is now: $HTTP_SESSION_VARS[count];\nbr\n;
 echo Let's go to another a href=\sessions.php\page/a...brbr;
 ___
 
 On my box at home running PHP 4.0.6 it works great.
 
 On the work server running PHP 4.0.6 it doesn't work. Just keeps setting 
 count to 0.
 
SNIP

I don't see any significant options here.
What is your session save handlers?

 
 The only major difference that I could find in the php.ini file is that at 
 home I have register globals off and at work they are on? 
 
 Even with register globals on, you can still use the $HTTP_*_VARS, right?

Yes. It's supposed to work, but could you try without register_globals?
If it works without register_globals, submit bug report.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: manual : Call-time pass-by-reference has been deprecated

2002-01-21 Thread Yasuo Ohgaki

Bruce Brackbill wrote:
 
 Hi,
 
 If Call-time pass-by-reference has deprecated
 so long ago, why are the instructions on how
 to do it still in the manual?
 
http://www.php.net/manual/en/html/functions.arguments.html#functions.arguments.by-reference
 
 
 
 At least it should point out that it has been
 deprecated.

Thanks for pointing it out.
I've deleted the description in CVS. Next time, please
submit bug report with type=Documentation problem :)

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: differences between ini_set() with php cgi and module?

2002-01-17 Thread Yasuo Ohgaki

Gk wrote:
 First of all, does php cgi use php.ini at all?
 Is it the exact same behavior as the module version in realtion to
 php.ini settings and the ability to change them with ini_set()?
 
 My ISP runs php as a cgi, version
 He tells me that I cannot change php.ini variable, upload_max_filesize
 to larger than 2M, although he says I can decrease it.
 This does not make sense to me - if ini_set() can decrease the value,
 why can't it be increased? Is there some secret way the ISP can limit
 php at compile time or some thing?

I think ISP has costomized PHP. It's easy to change PHP to work
this way.

 
 I have tested ini_set() with phpinfo() and the value I set for
 upload_max_filesize is correctly being reported by phpinfo(), yet I do
 not know if phpinfo() is reporting the truth about php behavior since I
 am unable to upload files greater than 2M.

Then ISP's change made in PHP is wrong/broken, at least PHP is not
modified the way should be.

 
 The problem I am working on is that the browser reports connection
 failure when I try to upload large files; same script works fine with
 small files  1M.

Hmm. Your ISP seems to have dirty hack for PHP :)
Ask question to your ISP.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: benchmarking php scripts

2002-01-16 Thread Yasuo Ohgaki

Eugene Lee wrote:
 Is there a way to benchmark a PHP script to see how intensive it is?
 For example, execution time, CPU/RAM/disk usage, etc.  Thanks in advance.
 


Try APD.

http://apd.communityconnect.com/

It's a degugger and profiler.
It does not show all of bench you want,
but it works well for profiling.

For CPU/RAM/DISK, you can take system bench
while you are accessing scripts.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Extending PHP

2002-01-16 Thread Yasuo Ohgaki

Anas Mughal wrote:
 Yasuo,
 I have created the module skeleton using the ext_skel
 script. I don't have any problems doing that.
 I am not able to create the dynamically loadable
 module library. Were you ever able to create a
 dynamically loadable module?
 How did you do it? 
 Did you use a make file or did you do a manual build?
 
 Thank you very much for your guidance.
 

I'm not sure if it is explained in Zend API doc or
anywhere else.

You can configure like

./configure --with-pgsql=shared,/usr/local/pgsql

To build shared object.

There is another way. Read README.SELF-CONTAINED-EXTENSION.

--
Yasuo Ohgaki

 
 
 
 --- Yasuo Ohgaki [EMAIL PROTECTED] wrote:
 
Anas Mughal wrote:

I presume you have created dynamically loadable
modules in PHP4.
If so, how do you create your module file?
Do you run a specific make command or do you build

it

manually?

Thanks for your help...


Again, read Zend API manual...
You are also interested in README.EXT_SKEL file that
can
be find under PHP source root.

There is a nice program that create skelton for new
modules :)

If you are plainning to marge PHP source dist, use
CVS
source instead of source distribution.

-- 
Yasuo Ohgaki




 _
 
Do You Yahoo!?
Get your free @yahoo.com address at
http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
To contact the list administrators, e-mail:
[EMAIL PROTECTED]


 
 
 =
 Anas Mughal
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 Tel: 973-249-6665
 
 __
 Do You Yahoo!?
 Send FREE video emails in Yahoo! Mail!
 http://promo.yahoo.com/videomail/
 
 



-- 
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Version conflicts with extentions

2002-01-16 Thread Yasuo Ohgaki

Anas Mughal wrote:
 Does anybody know if I need to be concerned about
 version conflicts between the PHP executable and a
 dynamically loadable module?
 (e.g. my web hosting company's server is running PHP
 4.0.3pl. Would it be okay for me to build a dynamic
 extention using PHP 4.1.1 and run it on the server.)
 

No. You cannot do that.
4.1.x has different structure for module entry.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: I18n problems: Working with double-byte languages

2002-01-15 Thread Yasuo Ohgaki

Ricardo Junior wrote:
 Hi people !
 
 I have a query regarding double-byte languages on PHP. 
 I need to sort a index localized from English to Korean.
 
 My idea is:
 * get the Korean strings from file;
 * convert them to UTF8;
 * insert them in a Oracle database set to work with UTF8;
 * set NLS_LANG with Alter session SQL command to this variable
 match with Korean language;
 * get the strings sorted by Oracle with a SELECT * FROM table SORT BY
 field ASC SQL command;
 
 I've tried to convert the Korean string to UTF8 with utf8_encode function,
 but this function converted each byte from double-byte string to its
 relative in UTF8 chars.
 Reverting this string encoded to UTF8 with utf8_decode function, the browser
 can display successfully the Korean chars (because the individual bytes of
 the double-byte string will be as them were before), but Oracle can't sort
 the strings properly because that UTF8 chars converted by utf8_encode
 function were not relative to a double-byte char, but relative to a 2 single
 bytes chars!
 
 How can I convert a double-byte string to UTF8 properly???
 
 
 Really thanks 

UTF-8 works but EUC-KR may be better.
Anyway, take a look at mbstring, iconv, gettext modules.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Extending PHP

2002-01-15 Thread Yasuo Ohgaki

Anas Mughal wrote:
 I am looking into building a dynamically loadable
 module under PHP4. The documentation on extending PHP4
 is unclear or is missing instructions on how to
 generate dynamic loadable module file. I have followed
 the instructions but I can't seem to be able to create
 the module. 
 (I even looked at Sterling Hughes article on
 WebTechniques.) 
 Is there a step that I am missing or what?
 Do I need to modify the m4 file or the makefile?
 Please advise...
 

Most basic thing you need is explained in Zend API Doc.
Visit www.zend.com for the document.

BTW, api docs in source dist is too old. It does not
worth to read :)

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Extending PHP

2002-01-15 Thread Yasuo Ohgaki

Anas Mughal wrote:
 I presume you have created dynamically loadable
 modules in PHP4.
 If so, how do you create your module file?
 Do you run a specific make command or do you build it
 manually?
 
 Thanks for your help...
 

Again, read Zend API manual...
You are also interested in README.EXT_SKEL file that can
be find under PHP source root.

There is a nice program that create skelton for new
modules :)

If you are plainning to marge PHP source dist, use CVS
source instead of source distribution.

-- 
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: session class

2001-12-21 Thread Yasuo Ohgaki

Christian Haines wrote:

  (sorry if this has been posted a thousand times..i am having problems
  posting)
 
  hi all,
 
  how does one access and manipulate session variables from within a class?
  i have hunted the net high and low but received no relief.
 
  i have tried (where error is a session variable)
 
  class test
  {
  var $global['error'];
  }


This is wrong.

 
  class test
  {
  var $HTTP_SESSION_VARS['error'];
  }


This is wrong thing to do also


 class test
 {
 session_register(error);
 var $error;
 }
 

This is also wrong, too

Try to find example code. There are many of them on net.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: web server crashing with either 4.1.0 or 4.0.6

2001-12-21 Thread Yasuo Ohgaki

Ian McNish wrote:

 when trying at access any php scripts my web server is crashing. i'm
 experiencing this problem with both php 4.0.6 and 4.1.0 on iplanet
 enterprise 6.0sp1 on solaris 8. my web server is logging the following
 error:
 
 catastrophe (21929): Server crash detected (signal SIGSEGV)
 info (21929): Crash occurred in NSAPI SAF php4_execute
 info (21929): Crash occurred in function _pthread_mutex_lock from module
 /usr/lib/libthread.so.1
 
 
 i'm getting this behavior with php code as simple as:
 
 ?php
 phpinfo();
 ?
 
 
 any help would be appreciated.
 

Visit http://bugs.php.net/ and read *carefully* how to report bug.
There is link for How to generate back trace. Make sure you
paste backtrace to your bag report.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Limit script memory usage !!

2001-12-21 Thread Yasuo Ohgaki

Nicolas Guilhot wrote:

 Hi all,
 I need to limit the amount of memory that a script can use. Is there a
 function that I can use to tell the script to die if its memory usage
  becomes greater than $MAX_MEMORY ! Or maybe, I could use a cron job to
 monitor processes and kill them if they become too big ?
 
 Thanks for your help.
 

Enable memory limit when you configure (--enable-memory-limit)
Read php.ini-dist/recommended.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: postgres session handling

2001-12-18 Thread Yasuo Ohgaki

You have bug in your session handler script.
In code exchange at zend.com, you can find mine.
Search HTTP section.

BTW, I'll add pgsql session handler module.
Anyone could use PosrgreSQL for session storage w/o writing script
from 4.2.0. It's written in C and more efficient ;)

James Gregory wrote:

 I have need to get php to use postgres to store session information. 
 I've changed the directive in php.ini and written a set of functions 
 that should do the job and I've made the call to set the session 
 handler. The following simple test case works:
 
 ?
 
 require_once ('database.php');
 require_once ('sess_handler.php');
 
 //session_start ();
 
 session_register ('asdf');
 
 $asdf = 123;
 
 print $asdf;
 
 ?
 
 the idea being that the line where $asdf is assigned is commented out in 
 the second execution of it and the value is still there upon reloading.
 
 That works fine. But, when I try to use it with the code for which it 
 was originally intended I get this error:
 
 *Fatal error*: Failed to initialize session module in 
 */usr/local/apache/vhosts/600xl/httpdocs/fe_login.php* on line *44*
 
 Keep in mind that this is all code which worked perfectly with the bulit 
 in session handler before. Any ideas?
 
 Thanks,
 
 James.
 

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: postgres session handling

2001-12-18 Thread Yasuo Ohgaki

For reference, I attached README for pgsql session save handler.
It's NOT in 4.2.0-dev, yet.

James Gregory wrote:

 I have need to get php to use postgres to store session information. 
 I've changed the directive in php.ini and written a set of functions 
 that should do the job and I've made the call to set the session 
 handler. The following simple test case works:
 
 ?
 
 require_once ('database.php');
 require_once ('sess_handler.php');
 
 //session_start ();
 
 session_register ('asdf');
 
 $asdf = 123;
 
 print $asdf;
 
 ?
 
 the idea being that the line where $asdf is assigned is commented out in 
 the second execution of it and the value is still there upon reloading.
 
 That works fine. But, when I try to use it with the code for which it 
 was originally intended I get this error:
 
 *Fatal error*: Failed to initialize session module in 
 */usr/local/apache/vhosts/600xl/httpdocs/fe_login.php* on line *44*
 
 Keep in mind that this is all code which worked perfectly with the bulit 
 in session handler before. Any ideas?
 
 Thanks,
 
 James.
 



-- 
Yasuo Ohgaki



README.MOD_PGSQL

mod_pgsql is a session save handler module. It provides session strage
with PostgreSQL database. This module is written by [EMAIL PROTECTED] 
Please report problems to http://bugs.php.net/ or [EMAIL PROTECTED]

Session Table Definition

CREATE TABLE php_sessoin (
  sess_idchar(32) PRIMARY KEY  CHECK strlen(sess_id) = 32,
  sess_name  char(32) NOT NULL,
  sess_created   integer, -- UNIX time
  sess_modified  integer, -- UNIX time
  sess_data  text,-- Max 1GB for 7.1, about 8KB for 7.0 or lower.
  sess_reserved1 integer,
  sess_reserved2 integer,
  sess_reserved3 integer,
  sess_reserved4 integer
);

User may *append* additional fields, sess_reserved* fields are place
holder for additional feture. Since mod_pgsql accesses field using
field index, user must use this field order.

How to use

To compile PHP with mod_pgsql, you need --with-session-pgsql[=DIR]
when you configure PHP. [=DIR] is installation path for
PostgreSQL. You don't have to compile PHP with PostgreSQL module, but
your system must have libpq and headers installed.

Following php.ini directives has special meanings for mod_pgsql

session.save_handler : pgsql for mod_pgsql session.
session.save_path: Valid PostgreSQL database connection string. 

How it works

It uses libpq which is written in C. It also uses aync query for
garbage collection. Therefore, user will not experience deley even if
barbage collection is performed. This module is much more efficient
than user handlers written in PHP.

How to customize

Since mod_pgsql uses PostgreSQL database. User can add more fields to
session database and create session access functions as user
want. Keep in mind that user is not supposed to order of standard
fields. User fields are must be defined after mod_pgsql fields.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] Re: Question: Should exit() print out the integer exit-status?

2001-12-18 Thread Yasuo Ohgaki

Jani Taskinen wrote:

 background information:
 
 http://bugs.php.net/bug.php?edit=1id=11008
 http://bugs.php.net/bug.php?edit=1id=14574
 
 exit() function is broken. Fixing the broken behaviour is the
 only real solution, IMO.


Since some people prefer to keep current behavior (for a while?)

How about just keep current behavior until ZE2? (PHP 5?)
ZE2 will break some ZE1 behavior, I suppose.
Making exit() to return return code is nice and would be
OK for ZE2. IMHO.

We really need to consider removing/changing legacy feature 
behavior at some point...

Error Level and Message handling in current source is one other
thing I would like to change :)
Do you want consistent error levels, error id, localized error
messges? I guess lots of you do ;)

 
 One solution:
 
 - When passed argument is string: print out this string
 - When passed argument is integer: Don't print it, use it as exit-status
 
 This is what is the expected behaviour is and I really can't think
 of any good examples where this would fail. Nobody ever gave any.
 And to get the REAL users (not only Zeev's opinion) I'm sending
 this also to php-general.
 
 From manual:
 
 The exit() function terminates execution of the script. It prints
 status just before exiting. If status is an integer, that value will be
 used as exit-status.
 
 This can be understood in many ways. If the status is integer,
 it is used as exit-status..but it's not clear that it's ALSO printed out
 which is simply buggy behaviour.

 
 Now, if general concencus amongs the users of PHP is that it should
 also print out the exit-status when it's an integer then 'shell_exit()'
 function should be added.
 
 --Jani



I agree. It's possilbe do this now, w/o much BC problem.

die()/exit() is identical in ZE1. How about make them separate?

If type is integer, die() for print and return exit code and exit()
for only return return code.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: mysql_query() problem

2001-12-16 Thread Yasuo Ohgaki

Brian Rue wrote:

 Hi,
 
 I'm getting the error
 Warning: Supplied argument is not a valid MySQL result resource
 
 from this code:
 
 function validateUser($username,$password) {
  $conn = connectToMySQL();
  mysql_select_db($db_name,$conn);
  $query=select * from members where username='.$username.' AND
 password='.$password.';
  $result = mysql_query($query,$conn);
  if (mysql_num_rows($result) != 0) { //*this is the line that returns the
 error*
return true;
  } else {
return false;
  }
 }
 
 I've checked that the connection works, and that the query is what it should
 be, and the query works when I type it into the terminal. Any ideas?
 
 Thanks,
 Brian Rue
 
 
 

I suppose it is fixed in 4.1.1-dev.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: DOM XML?

2001-12-14 Thread Yasuo Ohgaki

Daniele Baroncelli wrote:

 Hello,
 
 I would like to restyle one big site in XML and I would like some brief
 straight info/suggestions.
 
 I am definitely interested in DOM XML, but as far as I can understand, the
 module is still experimental and there to main risks:
 - The module is not completely stable
 - The functions are likely to change
 
 Are you able to confirm me these?


You are right about this.
But please use it and report bugs if you find one.
The more users, it will be more stable quickly.

Please also try latest snapshot for experimental modules/functions.
http://snaps.php.net/

 
 
 As an alternative, it seems the only safe way to develop XML in PHP is by
 using the Expat module.
 
 Is this your view too?


I would say yes, but you may experience problem(s).

 
 In any case, are you able to indicate some good web references for XML in
 PHP ?
 


I don't know this one ;)

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] seg fault with snmp

2001-12-14 Thread Yasuo Ohgaki

Kancha . wrote:

 i had compiled php with following configure
 parameters.
 
 ./configure  --with-apxs=/usr/sbin/apxs
 --enable-calendar --with-pgsql --with-snmp
 --enable-ucd-snmp-hack --enable-wddx --enable-sysvsem
 --with-sysvshm --enable-inline-optimization
 --enable-ftp --with-gd --enable-gd-native-ttf
 --with-openssl
 


Rasmus is asking backtrace. Read following link to get
one ;)

http://bugs.php.net/bugs-generating-backtrace.php

--
Yasuo Ohgaki

 
 
 --- Rasmus Lerdorf [EMAIL PROTECTED] wrote:
 
Backtrace?  Works just fine for me on a RH-7.2 box.

On Fri, 14 Dec 2001, Kancha . wrote:


I get segmentation fault when i try to execute
snmpwalk or any other snmp related functions. I'm
running php 4.1.0 on RH linux 7.2 with ucd-snmp

that

comes along with the linux distribution. I

compiled

php with --with-snmp and the compilation was error
free. phpinfo() alsow displyas the snmp

information.

any answers ?? 

__
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for

all of

your unique holiday gifts! Buy at

http://shopping.yahoo.com

or bid at http://auctions.yahoo.com



 
 
 __
 Do You Yahoo!?
 Check out Yahoo! Shopping and Yahoo! Auctions for all of
 your unique holiday gifts! Buy at http://shopping.yahoo.com
 or bid at http://auctions.yahoo.com
 



-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Unable to return object references from functions

2001-12-14 Thread Yasuo Ohgaki

Manuel Lemos wrote:

 Hello,
 
 I am trying to return a reference from an object created inside a
 function and at the same time have the object stored in a global
 variable.
 
 It seems that when I try doing it by assigning the object reference to a
 function argument that is passed by reference, nothing is returned in
 that variable despite inside the function the argument variable seems to
 have the right value.
 
 Is this a PHP bug or this is not the right way to do it?


No this is not a bug, but issue.

Please ask this kind of question only to php-general.
Thank you.

PS: Read manaul sections (Object and Reference.
It's explained ;)

--
Yasuo Ohgaki

 
 Try the example below.
 
 Manuel Lemos
 
 ?
 class test_class
 {
 var $dummy=nothing;
 };
 
 Function not_assigning($not_returned,$copy)
 {
 global $object;
 
 $object=new test_class;
 $object-dummy=original;
   $success=1;
 $not_returned= $object;
 $copy=$object;
 $copy-dummy=copy;
   var_dump(In the function,$success,$not_returned,$copy,$object);
   return $success;
 }
 
 $success=not_assigning($not_returned,$copy);
 
 var_dump(Out the function,$success,$not_returned,$copy,$object);
 
 ?
 



-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: php 4.1.0 output compression

2001-12-13 Thread Yasuo Ohgaki

Rares Vasilescu wrote:

 From: Yasuo Ohgaki
 
How does it work? Read RFC for HTTP/1.1

 
 I meant how do i tell PHP to use output compression.


Search zlib.output_compression ini directive in php.ini.
There is description in php.ini-dist, php.ini-recommended.


 Does PHP automatically detect the browser capability and send a compressed
 response or do i have to activate it in my scripts. Or in the configuration
 file?


It detects supported encoding, automatically.
Just enable zlib.output_compression in php.ini to enable.

-- 
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: subscribe me

2001-12-13 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:

 please subscribe me

Why not?
Have you take a look at
http://www.php.net/support.php ?

I recommend to use news server.
news://news.php.net/

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: PHP 4.1.0 and User-defined Sessions

2001-12-13 Thread Yasuo Ohgaki

Jaime Bozza wrote:

 I *HAVE* searched the database and there have been similar problems,
 with the request to try the latest CVS and to produce a short script
 that duplicates the problem.  Since I can't exactly put the CVS version
 onto a live website (and start having all sorts of other problems) and I
 can't duplicate the problem consistently on a non-active testing site,
 I don't really have anything else additional to offer except for Me
 Too!.
 
 My email already stated that I have tried to use --enable-debug and that
 I'm getting a segfault without any core file whatsoever.  The last
 paragraph explains my attempts on using enable-debug.


This is not practical, but you can try to run apache under gdb.
If any segfault happens while you are running apache under gdb, you can 
get backtrace.

BTW, did you try benchmarking tools like ab?
You may be able to reproduce problem with benchmark tools.

--
Yasuo Ohgaki

 
 Jaime Bozza
 
 
 -Original Message-
 From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, December 12, 2001 9:04 PM
 To: [EMAIL PROTECTED]; Jaime Bozza
 Subject: [PHP] Re: PHP 4.1.0 and User-defined Sessions
 
 
 Search bug database to see if the same problem is reported or not.
 
 If you get segfault, buld PHP with --enable-debug and get core file. If
 it is new, get backtrace as described in bugs.php.net. Submit new bug
 report. If you found multiple issues, submit bug report separately.
 
 There are more comments following.
 
 Jaime Bozza wrote:
 
 
Hello,
  I've run into a really intermittent and strange problem with PHP 
4.1.0, and before I try and figure out how to send in a bug report 
that'll get ignored (because I don't have all the data that is 
expected), I thought I would try here to see if anyone else is having 
similar problems.


  Configuration:  FreeBSD 4.4-STABLE, PostgreSQL 7.1.3, Apache 1.3.22,

 
PHP 4.1.0.


 
 
 So far I don't have problem with Linux 2.4.4/PosrgreSql 7.1.3/Apache 
 1.3.22/PHP 4.1.0 or 4.2.0-dev
 
 
 
  I use PHP Sessions for large parts of our sites.  I'm currently 
using the PostgreSQL Session Handler code from Jon Parise and it had 
been working pretty much perfectly under PHP 4.0.6. (The only issue 
was when multiple requests came in with the same session_id at the 
EXACT same time - AvantGo for instance - But I made some minor 
modifications to eliminate that problem)

  Once upgrading to 4.1.0, I started noticing Apache processes 
segfaulting left and right. (Signal 11's, with the occasional Signal 
10) At first I started to think perhaps memory was bad on that 
particular system.  I have 4 servers (running 3-5 separate Apache 
processes each) and each and every server was giving me the Signal 
10/11's.  I started looking into it further.

  I have an auto_prepend for my application code that defines the 
base session variables, config variables, includes the 
pgsql_session_handler file, etc.  All the processing is handled here 
so that my other pages can just use an array that stores all the 
session data.  That way I can pretty much ignore the backend in any of

 
my application code.

 
 
 This setting is similar to mine also.
 
 
  Once I turned this code off, bingo!  No more segfaults!  So I 
started hacking out code there.  If I kept all the startup code but 
eliminated the session commands, it still worked.  As soon as I turned

 
on the session (session_start/session_register), I'd get the segfaults

 
again.

 
 
 If you could make *short* script that segfault, attach it to bug report.
 
 
  If I turned off the pgsql_session_handler and went back to files 
(the default), I didn't have any problems either.  It was just a 
problem when I was using the pgsql_session_handler.

 
 
 I'm not sure what your session handler looks like, could try pgsql 
 session handler that can be found at Zend.com's code exchange?
 
 
 
  So I then turned off session handling and built my own session 
functions (quickie, but basically emulate the session functions I
needed) that called the SAME pgsql_session_handler code that was being

 
used by PHP's internal functions.  For the past hour I haven't had a 
single segfault on any of my servers.  (Within 5 minutes of turning on

 
the internal session routines, I would start getting segfaults every 
minute or so)

  One other thing I noticed was that I had compiled PHP with the mm 
shared memory library.  Previous to 4.1.0, each Apache process had a 
size of around 64MB.  (Without mm, the size was 4-5MB or so)  Once 
installing 4.1.0, the size went up to 130MB for each process!  Since 
I believe sessions utilize the mm library if it's available, I figure 
this may be one of the clues.  (I never tried using the shared memory 
style of sessions, so I couldn't tell you if it would segfault there.)

 
 
 This is strange, mm session module allocates shared memory that is 
 needed. (Description is not fully correct, but almost correct)
 
 
  Is anyone having any of these problems?  Is anyone else

Re: [PHP] Re: PHP 4.1.0 and User-defined Sessions

2001-12-13 Thread Yasuo Ohgaki

Alok K. Dhir wrote:

 Also, I saw the faults with little to no load on the server.  I.e. just
 me banging on it.  The faults are seemingly random, although I was able
 to duplicate failing test cases with some consistency.
 
 More on this in a day or two.
 


Unless you provide meaningfull backtrace, it's impossible to fix.
Anyway, don't try running httpd under gdb without -X

Read the following link for getting backtrace.
You may already know, but your server admin set
limit on your machine.

http://bugs.php.net/bugs-generating-backtrace.php

-- 
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: php 4.1.0 output compression

2001-12-12 Thread Yasuo Ohgaki

Rares Vasilescu wrote:

 Anyone has tried out yet the output compression?
 
 How does it work, is it really stable?
 
 Rares
 
 

Yes it is stable unless you delete output buffer with
ob_end_clean()/flush().

How does it work? Read RFC for HTTP/1.1

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: how do i get the browser's screen resolution?

2001-12-11 Thread Yasuo Ohgaki

Roel Derckx wrote:

 Hi
 
 I'm working on a large portal-like php/html site with some large graphics.
 The original design is for 1024x768 and up, but i also want it to be well
 viewable under 800x600 so parts of the design have to be resized for that.
 
 BUT, i can't seem to get that kind of information from within PHP. I found a
 way around (check it with Javascript and store it as a cookie), but that's
 not working fine for me.
 
 Can someone tell me:
 - how do i get the browser's screen resolution returned in a variable?
 OR
 - how can i read Javascript variables under PHP?
 
 Help please.


You must use JavaScript for browser info.
Just send browser resolution as GET vars using JavaScript.
(i.e. use query string)

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: session woes

2001-12-11 Thread Yasuo Ohgaki

Gaylen Fraley wrote:

 I have a friend who is using an ISP that uses php4.0.3pl1 .  It appears that
 session_register is not working between pages.  In script A, the session var
 gets registered and shows registered using session_is_registered('testvar');
 However, when script B is called, a session-start is issued and testvar is
 not registered.  Running the identical code, but not with his ISP, under
 4.06, it works perfectly.  Are there known issues?
 

If you can trun off register_globals, set it to OFF. 
register_glogals=Off is recommended setting BTW.

Use $HTTP_SESSION_VARS. Do not use session_register(), just set value to
$HTTP_SESSON_VARS. Do not use session_unregister(), just unset()
$HTTP_SESSION_VARS.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Again (still?) problems with php and ldaps

2001-12-07 Thread Yasuo Ohgaki
You also may want to try 4.1.0RC5.
http://www.php.net/~zeev/php-4.1.0RC5.tar.gz

I'm not sure which bugs have been fix, but there are sevral bug
fixes in 4.1.0.

--
Yasuo Ohgaki

Susanne Benkert wrote:

 Hi,
 
 After recompiling my Php with the newest LDAP-Libraries and Openssl
 "ldap_connect("ldap://hostname")" works. But I still have problems with
 "ldap_connect("ldaps://hostname")": 
 
 Connecting works, but Php can't bind with the Openldap-Server. I checked
 the debug output of slapd and found messages like the following.
 
 
 TLS trace: SSL-accept:SSLv3 read client hello A
 TLS trace: SSL-accept:SSLv3 write server hello A
 TLS trace: SSL-accept:SSLv3 write certificate A
 TLS trace: SSL-accept:SSLv3 write server done A
 
 TLS trace: SSL_accept:SSLv3 flush data
 tls_read: want=5 error=Operation would block
 TLS trace SSL_accept:error in SSLv3 read client certificate A
 TLS trace SSL_accept:error in SSLv3 read client certificate A
 TLS trace SSL_accept:failed in SSLv3 read client certificate A
 Tls:can't accept.
 
 
 
 What did I wrong? Does Php need its own Key/Certificate (as client
 certificate)? Or is something wrong with my server certificate of Ldap?
 (But I can't imagine, because other actions like ldapsearch already seem
 to work with TLS.) 
 Has anything should be change in the configuration of php when using it
 with SSL and Openldap?
 
 Can anybody help me? (I am new in SSL and such things and I have no idea
 how to solve this problem.)
 Bye Susanne
 



-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] Re: session_id()

2001-12-07 Thread Yasuo Ohgaki
Gede Gilijk wrote:

 This is a simple autentification script using session
 I try to echo the session_id().
 But to my surprise, the value of session_id() is different - in
 configuration -
 if I use difference browser.
 
 IE :
 9ff68d81039d9ece3ba9840328b91488
 
 Opera :
 7aa4895172b5a4785c9fb754eaf792aa
 
 NN :
 1007630964


How did you get this? Normal session ID is MD5 hash value.
Therefore, session id is string that has 32 chars and consists of
a-z0-9.

The only reason that I can think of is you have cookie that has
cookie in your NN.

Check your NN's cookie, I'm sure you have a cookie which has
"1007670964".

BTW, session module will *not* validate if session id is MD5 hash
or not. Programmer should check if session id format is valid or not.

--
Yasuo Ohgaki

 
 Anybody face this thing ?
 
 ?
 session_start();
 
  echo "h1Members only/h1";
 
  // Check session variable
  if (session_is_registered("valid_user"))
  {
  echo "pYou log in as $valid_user./p";
  $sess_id = session_id();
  echo "$sess_idbr";
  } else {
  echo "pYou have not login yet/p";
  }
 
  echo "a href=\"authmain.php\"Back to main page/a";
 
  ?
 
 Regards,
 
 Gede Gilijk
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] Re: session_id()

2001-12-07 Thread Yasuo Ohgaki

Michael Hall wrote:

 
 That NN value looks like a UNIX timestamp.
 
 Mick
 
 On Fri, 7 Dec 2001, Yasuo Ohgaki wrote:
 
 
This is a simple autentification script using session
I try to echo the session_id().
But to my surprise, the value of session_id() is different - in
configuration -
if I use difference browser.

IE :
9ff68d81039d9ece3ba9840328b91488

Opera :
7aa4895172b5a4785c9fb754eaf792aa

NN :
1007630964


 

He should have set cookie *before*
Deleting the cookie should solve the problem.

Regards,
-- 
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Classes within classes (Should I do this?)

2001-12-05 Thread Yasuo Ohgaki

Cameron Just wrote:

 Hi,
 
 Is this a bad thing to do have a class stored within another class?
 
 I would also like to store an array of another class within a class. 
 
 It seems to work apart from the fact that I can't reference an array of 
 class directly.
 ie
 $test_array[0]-get();
 This gives an error.


There is nothing wrong storing array of classes in a class.

$obj-array_of_obj[0]-method() 

works.


or array of classes
$array_of_obj[0]-method().
works.
-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: nested include_once()

2001-11-28 Thread Yasuo Ohgaki
Roko Roic wrote:

 If I use include_once() to include these files in main.php:
 
 main.php
 -
 include_once('lib.php');
 include_once('service.php');
 -
 
 And file service.php also has a line in it:
 
 service.php
 --
 include_once('lib.php');
 --
 
 Will lib.php get included twice or only _once() ?
 
 I am wondering because get_included_files() acts kind of 'strange' and does
 not display files included from included files. Damn recursion :)


include_once() include files once. Next include_once() looks up
hash and if file is already included, PHP does not include.


 
 [OT] Is there a way to tail files that get read from a Linux filesystem.
 That could help me find out what gets included and when?


I'm not sure why tail function is useful. Anyway, you can use
get_included_files()/get_requried_files() to know which files are
included/required.

--
Yasuo Ohgaki


 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] Redeclare a Function

2001-11-14 Thread Yasuo Ohgaki

Joffrey Van Wageningen wrote:

 its possible to create lambda-style functions with create_function() and
 redeclare the variable functions
 
 ---
 $funct = create_function('$x', 'return ++$x;');
 echo $funct(10);
 
 $funct = create_function('$x', 'return --$x;');
 echo $funct(10);
 ---
 
 its fun to create array's of functions :) try it :P
 
 with kind regards,
 Joffrey van Wageningen


APD can rename/redeclare functions also.

http://apd.communityconnect.com/

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: possible safe mode bug with opendir() ?

2001-11-12 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:

 Hi again,
 
 I believe it should disallow openning a directory in safe mode if the UID
 of the directory does not match the UID of the PHP script.
 
 That is exactly the behavior of fopen() in safe mode.

 Without that behavior, users are permitted to write a PHP script that lets

 them crawl around the webserver seeing things they have no rights to see.


Now I see what you want :)

 
 It happens on our system that there will never be any files owned by
 user A under a directory owned by user B. But even if there were, I think
 safe mode should disallow this type of filesystem reading.


Under UNIX like systems, /tmp is world writable and everyone on 
the system can open dir/wirte/read files, but it's possible to 
secure files/directory under /tmp. I think you can apply the same.

GID support also helps to allow opening files certain group.
Is it not enough for your security needs?

 
 Do you think the fact that this file reading is permitted is a bug that
 should be reported?
 

I think the feature that check dir UID/GID will be useful for some 
prople. How about submit a feature request (It's one of bug report 
types)

BTW, you have opotion that disallow opendir at all, with 
disable_functions directive in php.ini

--
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: possible safe mode bug with opendir() ?

2001-11-12 Thread Yasuo Ohgaki

Yasuo Ohgaki wrote:

 [EMAIL PROTECTED] wrote:
 It happens on our system that there will never be any files owned by
 user A under a directory owned by user B. But even if there were, I think
 safe mode should disallow this type of filesystem reading.
 
 Under UNIX like systems, /tmp is world writable and everyone on the 
 system can open dir/wirte/read files, but it's possible to secure 
 files/directory under /tmp. I think you can apply the same.
 
 GID support also helps to allow opening files certain group.
 Is it not enough for your security needs?
 

BTW, if you get rid of read permission for a directory, directory 
listing is not possible under UNIX like systems. You can still 
read/write files with proper permission. (unlink/create files with 
proper permission also. You can get rid of write permission for 
directory, too.)

Just in case, you didn't know about it :)

php.ini entries like

safe_mode_opendir_sid
safe_mode_opendir_gid

will help to improve security still.
I just don't need this kind of feature, but others may need it.

--
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Serial Port Programing

2001-11-12 Thread Yasuo Ohgaki

Mark wrote:

 On Mon, 12 Nov 2001 12:36:07 -0500, Brian C. Doyle wrote:
 
Hello all,

Does PHP have the ability to control a serial port?  I see we can
use the
Printer but that was All I saw.

 
 I don't know about windows but on linux I guess you would just fopen
 /dev/ttyS0 and read or write to it.
 


Make sure your serial interface supports hardware flow control. 
PHP is not enough for handling software flow control...
(Almost all serial interface supports h/w flow control, though :)

--
Yasuo Ohgaki




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: possible safe mode bug with opendir() ?

2001-11-11 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:

 
 When in safe mode shouldn't PHP check to see if the directory that is
 about to be opened with a opendir() function has the same UID as the PHP
 script itself, and fail if the UIDs do not match?


 From 4.1.0, optional GID check is available.

 
 Because in PHP 4.0.6 with safe_mode on, a PHP script owned by fred can
 open any directory owned by any other UID, so long as the directory is
 under the open_basedir.  This does not seem right to me, as it allows a

 user in safe_mode to browse all the files on the entire webserver, looking
 for things he might be able to peek at with a web browser.
 
 Please advise whether this should be a bug report.

Take a look at lastest implementation see if you still have issues.

http://snaps.php.net/

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: possible safe mode bug with opendir() ?

2001-11-11 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:

 But where user fred can opendir() a directory owned by user mary
 (underneath the open_basedir), that action doesn't even pass a UID check
 if the UIDs are supposed to match in safe mode in order for the action to
 be allowed.
 
 How would an optional GID check help?



It may, it may not. It works like user/group permission as you 
know. I don't know what you want to protect :)

Do you mean a script with opendir() shouldn't allow openning any 
directory under open_basedir if UID does not match?

I think it should be allowed. It's perfectly valid to me.

What if directory is owned by other user, but there is files owned 
by the user. Would you like to disallow to list directory? I guess 
not.

You can protect file basis, why do you need other protection for 
directories under open_basedir? Do you have good reason for this?

--
Yasuo Ohgaki

 
 
When in safe mode shouldn't PHP check to see if the directory that is
about to be opened with a opendir() function has the same UID as the PHP
script itself, and fail if the UIDs do not match?


 From 4.1.0, optional GID check is available.

Take a look at lastest implementation see if you still have issues.

http://snaps.php.net/

--
Yasuo Ohgaki


 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Forking and BG processes in PHP

2001-11-08 Thread Yasuo Ohgaki

Massimiliano Bariola wrote:

 Hello Yasuo,
 
 Tuesday, November 06, 2001, 12:12:59 PM, you wrote:
 
 
 YO *SNIP*
 
 YO Try to redirect stdout  stderr to /dev/null (If you are on Unix 
 YO like systems)
 
 YO Then it will return immediately to PHP.
 
 YO --
 YO Yasuo Ohgaki
 
 Sorry  Yasuo,  but  I  don't  understand  well  what you mean. Can you
 clarify?
 
 thank you

For example
system('/usr/bin/find / -name core  /dev/null 21 ');

if you would like to take a look at output
system('/usr/bin/find / -name core  /tmp/corefiles 21 ');

'find / -name core' should take some time, but system() will 
return immediately when you redirect stdout/stderr to files and 
put the command background.

--
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: pass javascript variable to php?

2001-11-08 Thread Yasuo Ohgaki

A. Dixon wrote:

 So say I have a link on the page that the checkbox is on to a file called
 program.php How would I add name value pairs to the querystring when
 someone clicks on the checkbox?  Then when I click on the link program.php
 it should read program.php?checkbox1=on   where checkbox1 is the name of
 the checkbox that is selected.
 


When you can use JavaScript, you can set/get any query string with
location object and can make a new request with the query string.

You can catch any event that JavaScript supports including click 
at checkbox,etc, to change query string, to make a new request, etc.

Try to take a look at JavaScript book/reference, you'll see how it 
can be done :)

--
Yasuo Ohgaki

 Thanks,

 
 Aaron
 
 On Thu, 8 Nov 2001, Yasuo Ohgaki wrote:
 
 
Aaron wrote:


I've got checkbox that I get the status of with javascript and I put the
status into a javascript variable.  How do I get that variable over to php?
I don't want to hit the submit button to get the variable into php.


Use query string or cookie.
Just becareful with cookie isn't on always and has limitations.
You cannot use too large query string also.




_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: why cant I: array_keys($arr)[0] ?

2001-11-04 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:

 Why does PHP give a parse error if you do:
 
   echo array_keys($arr)[0];


This breaks syntax...

 
 It makes you assign the result of the function to a var first like this:
 
   $arr = array_keys($arr);
   echo $arr[0];


How about

reset($arr);
list($key,) = each($arr);
echo $key;

It's much more efficient.

 I just want to grab the 1st element of the array. Why does it make you do
 it in 2 lines instead of letting you index right on the array that results

 from the function?


Writing 2 or 3 lines for printing first key name, is not
hard work...

PHP script may need more lines to do the same thing compare
to Perl, but it's much easier to maintain. IMHO.

--
Yasuo Ohgaki



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Sendmail entry in PHP.ini

2001-11-03 Thread Yasuo Ohgaki

Jason Michael wrote:

 Does anyone know what the correct entry for the php.ini that allows you to
 to use sendmail in OSX 10.0.4 Server?

Sendmail support is disabled when OS is Windows, it should be able 
to use sendmail support with Mac OSX. (It it work :)

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Questions per installing on linux (Php 4)

2001-11-03 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:

 Hello, and thanks for your time. First time...
 
 I saw a great resource on installing php on raq 3 (What I have, linux)
 http://marc.theaimsgroup.com/?l=php-generalm=98039640119670q=raw
 
 but the thing is I have mysql installed
 
 when I do am done downloading, it says to use:
 ./configure --with-apxs=/usr/sbin/apxs --with-mysql=/usr/local/mysql 
 --enable-track-vars --enable-trans-sid --enable-ftp
 
 Ok, but I have mysql. Should I remove the --with mysql ...


Depends, use which ever works better for you.

 and to have GD support, do I need a 'with gd ...'
 if so, what would that be? (I thought it was included)


Read manual and do ./configure --help for this

 
 Or if I install postgres. Should I do that first?


Yes. You need libpq and headers.


 Do I need *Specific* syntax for postgres, such as --with-mysql=/usr/...


If you install postgres to default locations, it's not required.

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: how to make IE show client side JavaScript output?

2001-11-02 Thread Yasuo Ohgaki

show source feature is broken in many Netscape (and Mozilla).
MSIE is behaving correctly. IMHO.

You cannot change client behaviours like this.

--
Yasuo Ohgaki

Moloko wrote:

 interesting one here for y'all
 
  if you use client side JavaScript to write HTML to the browser, eg
 script language=JavaScript
 document.write ('bHello world!/b');
 /script
 then look at the page source from IE, the page source will show you exactly
 what I've typed above, whereas if you view the page source from Netscape
 4.7, it shows this in the source:
 bHello world!/b
 (this is the way I ewould expect and want it work)
 
 Unfortunately the (rather complex) script I'm writing does completely
 different stuff in Netscrape so looking at the page source thru there to see
 what's going on is hopeless - is there any way to make IE behave like NS in
 this respect and actually show the correct JavaScript output, rather than
 the JavaScript code itself??
 
 Cannot believe that NS4.7 is actually better at doing something than IE!!!
 
 --
 Moloko
 'When the going gets weird, the weird turn pro' - Dr Gonzo
 GCM/CS/IT/MC d-- S++:- a-- C++ U--- P+ L !E W+++$ N+ K+ w+++$ M+ PS+++ PE-
 PGP- t+ 5- X-- R* tv++ b+++ DI D G e h-- r++ y++
 
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Problem with non us caracters and strtr

2001-11-01 Thread Yasuo Ohgaki

Rodrigo Peres wrote:

 Hi list,
 
 I'm in a big trouble. I'm brazilian, so I've made a script to clean up the
 special caracters from our language in order to not mess up my publisher,
 but this script don't work in Macintosh (macos 9.1, IE 5, all in american
 english).
 
 This is my code
 
 
 ?
 function myclean($name) {
 $name = strtolower(strtr($name,
 áéíóúàèìòùäëïöüâêîôûãçÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÃÇ ,
 aeiouaeiouaeiouaeiouacAEIOUAEIOUAEIOUAEIOUAC));
 return $name;
 }
 $temp = myclean($name_actor);
 echo($temp);
 ?
 
 What happens is if i try for example to clean up São Paulo it prints são
 paulo. Why??
 The $name will receive a string form a text field in a form. my html
 charset is iso-8859-1


I think you are better to use recode extension for this.
Check out recode manual page.

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: problems with sessions (not working)

2001-10-27 Thread Yasuo Ohgaki

Christian Dechery wrote:

 I have a file called miec.php that does quite a lot of processing and 
 then include()s user_track.inc.php...


Where did you register the session variable?
If you are registering local variable as session variable, it may 
not work...

I suggest to use $HTTP_SESSION_VARS, if it is possible...

--
Yasuo Ohgaki

 
 miec.php:
 
 ?
 a lot of db processing  (NO OUTPUT whatsoever)
 include(user_track.inc.php);
 UserTrack($products);
 the output starts here...
 ?
 
 user_track.inc.php:
 --
 ?
 session_start();
 
 function UserTrack($products)
 {
 global $prod_views;

 if( !session_is_registered(prod_views) )
 {
 fill the $prod_views array, serialize it...
 session_register(prod_views);
 // I've tested the code above... and session_register 
 returns TRUE and I saw the session file...
 }
 else
 {
 do other stuff with the prod_views array
 }
 }
 ?
 
 the problem is why does it NEVER go into the 'else'... it seems that 
 the session is registered... but as soon as I refresh the page the 
 session is lost...
 
 why?

 
 
 _
 . Christian Dechery
 . . Gaita-L Owner / Web Developer
 . . http://www.webstyle.com.br
 . . http://www.tanamesa.com.br
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Odd is_int() behaviour

2001-10-22 Thread Yasuo Ohgaki


Yasuo Ohgaki wrote:

 This is expected behaviour.
 
 Ashley M. Kirchner wrote:
 
 I have the following snippet in my file:

   if ($PATH_INFO == ) { $PATH_INFO = /; }
   echo PATH_INFO: $PATH_INFObr\n;
   // All we want is the fist element, call it $section
   list($section) = explode('/', substr($PATH_INFO,1));
 
 
 
 explode() is string function and returns array of strings. Therefore, 
 type is integer.


Oops. Obviously this line is wrong. It should be

There for type is STRING not integer...

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: What attribute is used ... when a session will expire?

2001-10-22 Thread Yasuo Ohgaki

Jason Caldwell wrote:

  Just curious --
 
  What system attribute is used to help in determining when a
  session file will be cleaned up (GTC) or in other words,
  deleted?  Is it the delete time calculated based on the
  file's CREATED or MODIFIED time?

Modified time is used for mod_files.
There is case that session data files will not be deleted and user
has to delete session data files manually.

This behaviour might be changed, see mod_files.c for details and
current status.

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: require include

2001-10-22 Thread Yasuo Ohgaki

Jtjohnston wrote:

 Coverting from perl ...
 What's the differencw between require and include? Where, when, why?
 


I forgot from which version, but current PHP's require/include 
works the same way except

- require() raise fatal error, if it can't find file
- include() raise warning, if it can't find file


requrie_once()/include_once() works almost the same as 
require()/include() except they include file only once. (Hash 
table is used to determine if files are included or not)

See also get_{required|included}_files()

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Annotated PHP Manual

2001-10-21 Thread Yasuo Ohgaki

DL Neil wrote:

Khalid Hazmi wrote:

How I can download the current Annotated PHP Manual???

 
 
There is no such thing... AFAIK.

 = Yasuo Ohgaki
 
 
 Yasuo: Yes there is (and VERY useful it is too), check out the range of PHP 
documentation available from
 http://www.php.net/docs.php
 
 Khalid: Unlike some other packages I don't think there's a zipped-up, 
ready-for-download version. I presume this is
 because the online version is always 'the latest' - but I don't know how often they 
update it (maybe that's somewhere on
 the page I just quoted!?) You could try something called a webwhacker to download 
the web of pages that make up the
 manual...
 


I thought Khalid is talking about downloadable version of 
*Annotated* PHP Manual, not a usual HTML/PDF/etc version of PHP 
Manual.

AFIAK, PHP Manual is written in DocBook/DSSSL format and 
HTML/PDF/etc version is generated from XML source which does not 
have any info about notes in online version of PHP Manual

--
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Arrays in form

2001-10-21 Thread Yasuo Ohgaki

Use JavaScript.

Read PHP Manul if you need to pass array form vars.
There is a section for that.

Srinivasan ranganathan wrote:

 Hi all
 
 How can i implement a hotmail-inbox like checkbox
 functionality?
 
 thanks in adv
 Regards
 Srinivasan Ranganathan

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Odd is_int() behaviour

2001-10-21 Thread Yasuo Ohgaki

This is expected behaviour.

Ashley M. Kirchner wrote:

 I have the following snippet in my file:
 
   if ($PATH_INFO == ) { $PATH_INFO = /; }
   echo PATH_INFO: $PATH_INFObr\n;
   // All we want is the fist element, call it $section
   list($section) = explode('/', substr($PATH_INFO,1));


explode() is string function and returns array of strings. 
Therefore, type is integer.

   if (is_int($section)) {
 echo section: $sectionbr\n;
   } else {
 echo Invalid section (NON_INT: $section)br\n;
   }
 
 Um, why does it fail when I hit the script with any INT?


'1' is not integer, but string.
1 is integer.

BTW, all user inputs(POST/GET/etc) are string.

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP 4.0.6 Mysql 4.0

2001-10-19 Thread Yasuo Ohgaki

Jeroen Geusebroek wrote:

 Hi there,
  
 Does the current stable PHP (4.06) support the use of the newly released
 Mysql 4?

No. Not even with CVS version AFAIK.

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Annotated PHP Manual

2001-10-19 Thread Yasuo Ohgaki

Khalid Hazmi wrote:

 How I can download the current Annotated PHP Manual???
 
 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
 

There is no such thing... AFAIK.

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: !!! URGENT [PHP] php mail() function Problem

2001-10-19 Thread Yasuo Ohgaki

If your sendmail is set up correctly, you should be able to send 
mail. Check your sendmail. Look for sendmail Manul, FAQ, etc, 
since it's not PHP problem.

--
Yasuo Ohgaki

Simos Varelakis wrote:

 Hi to everyone
 
 i have problem with php4 mail() function.
 
 Os:mandrake 7.2 Mailprog:Sendmail
 
 the following php code
 
 ?php
 
 mail("[EMAIL PROTECTED]","subject","body","From:[EMAIL PROTECTED]");
 ?
 
 does not send e-mail
 
 my /var/log/mail/info files log the following
 
 thewall sendmail[8313]: f9HAE9I08313: from=apache, size=0, class=0,
 nrcpts=0, relay=apache@localhost
 
 my php.ini sendmail path is /usr/sbin/sendmail -t
 
 Ive try to make apache sendmail trusted user
 + change my php.ini path to
 is /usr/sbin/sendmail -t -f root@localhost
 
 but nothing :-)
 
 any ideas
 thanks in advance for any help :-)
 
 Simos
 
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Variable Configuration Problem

2001-10-19 Thread Yasuo Ohgaki

I guess you are using php.ini-optimized, right?
Take a look at
http://www.php.net/manual/en/language.variables.external.php

I suggest to read PHP Manual :)

--
Yasuo Ohgaki

Patrick Quaedackers wrote:

 Hello all!
 I installed PHP 4.0.6 om my server (Winnt server, Apache), and I started testing 
with it.
 
 The problem I have now is this:
 I want to read the data passed from a form trough a variable.
 Let's say the form field is called Test. I want to use $Test in my PHP script to 
read that variable.
 
 But all variables stay empty. I don't wan't to use the Query_string to get my 
variables.
 
 Can anybody tell me what INI-setting(s) I got to turn on or off??
 
 Thanks!!!
 
 Greetz
   Patrick
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: contstant in heredoc

2001-10-19 Thread Yasuo Ohgaki

Pierce wrote:

 is it possibe to include defined constant in heredoc block?
 for example:
 define(_ACONST_,CONSTVAL);
 $str = EOL
 value is _ACONST_
 EOL;
 echo $str;
 
 *Normal* variables usage in {} doesn't woks :((
 

Heredoc treat string as if they are enclosed by . So constant 
does not work obviously

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Deleting HTTP auth...

2001-10-19 Thread Yasuo Ohgaki

Lic. Rodolfo Gonzalez Gonzalez wrote:

 Hello list,
 
 Is it possible to delete the data from an Apache's HTTP authentification
 directly from a PHP script?. I know that the username/password pair is
 stored in two variables which are sent by the client to the server,
 right?. is it possible to alter them from PHP¿?.
 
 Thanks a lot,
 Rodolfo.


I guess not. I though HTTP auth cannot be deleted from server 
side. Is it possible?

--
Yasuo Ohgaki




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: is js set?

2001-10-19 Thread Yasuo Ohgaki

Martín marqués wrote:

 Is there a way to know if the web client has javascript enabled?



Sure. You can redirect to page with javascript and if JavaScript 
is enabled, use JavaScript and load pages you want.

--
Yasuo Ohgaki




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Compiling php like C

2001-09-17 Thread Yasuo Ohgaki

Andrew Perevodchik wrote:
Has anyone done this to date?? I was thinking
of compiling my programs for better perfomance,
and of course, protect the source code. Anyone
have any ideas on this issue?

 
 Another question: is it possible to compile PHP
 script in COM or EXE file?


PHP Compiler is probably what you want.

http://phpuser.com/download/files/dev-tool/phpcompiler/

I think this URL isn't a home site, search php-general archive for the 
home site. (2001-02 to 2001-04. I've posted the URL once there) It was 
dead when I checked few months ago, though...

Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Compiling php like C

2001-09-16 Thread Yasuo Ohgaki

Kunal Jhunjhunwala wrote:
 Hi,
 Has anyone done this to date?? I was thinking of compiling my programs for
 better perfomance, and of course, protect the source code. Anyone have any
 ideas on this issue?
 Regards,
 Kunal Jhunjhunwala
 

There are sevral cache modules. These are cache modules that I know.
  - Alternative PHP Cache (APC): http://apc.communityconnect.com/
  - AfterBuaner Cache (bwcache) : http://bwcache.bware.it/
  - PHP Accelerator : http://www.php-accelerator.co.uk/
  - Zend Cache : http://www.zend.com/zend/products.php#cache

All of them gives 2 - 3 times perfomance improvment in general.

Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: apache 1.3.20 segfaults with php 4.0.6/midgard/imap

2001-09-03 Thread Yasuo Ohgaki

Vincent Stoessel wrote:

 I am trying to use php 4.0.6 with imap. midgard and mysql
 extentions compiled in.
 When I start apache I get information in the logs about many child 
 proccesses dying. Yet I have plenty memory left and everthing else seems 
 OK. Not a lot of traffic here at 3.27 am.
 
 I ran gdb and this is what I got:

You need to build PHP with debug option (--enable-debug when you 
configure)

Anyway, search bug report see if this problem is reported (hopefully it 
may be fixed)
If this problem is not reported, get backtrace from debug enabled PHP 
core file and report this as a bug.

Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: mail() not supported

2001-08-30 Thread Yasuo Ohgaki

Cyrille Mortreux wrote:

 Hi.
 Troubles with PhpNuke and mail():
 When an user register, no mail i sent to him, but a message warning;
 mail() is not supported in this php build.
 I got postfix working fine, php.ini all right with
 sendmail_path=/usr/sbin/sendmail -t -i
 Any idea ???
 


How did you install PHP?
I guess you are building from source. I'm not a postfix user, but I 
think you have configured PHP w/o sendmail warpper.

Install sendmail wrapper then build PHP again.
(e.g. configure checks if your system have sendmail or not)
--
Yasuo Ohgaki





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: incorrect Timezone using mail() -- HELP!

2001-08-27 Thread Yasuo Ohgaki

Jeffrey Iskandar Ahmad wrote:

 When i use this function mail(), mail was sent successfully but when
 recipient receive the mail the date timezone is incorrect. It
 displayed  -0800 instead of +0800. Im from +0800. The timezone does not
 display correctly. I have tried different servers but still the same.
 And all clients get the wrong date. Im Using php 4.06 and win2k and
 winnt4.

Under Windows, PHP sets Date header for mail if sendmail_path is _not_ 
defined. If you are using sendmail compatible progmram, this won't apply 
to your problem.

Looks like someone commented out following lines in sendmail.c (I'm 
refering PHP 4.0.7-dev source)

/*
extern int _daylight;
extern long _timezone;
  */

And _timezone is used as follows

(_timezone  0) ? + : (_timezone  0) ? - : ,zoneh,zonem)

They are probably commented out due to thread safe issue. I guess this 
bug is introduced when this change is made. (I'm just looking at source 
briefly and _not_ 100% sure.)

It is possible you have configuration problem also. Is your web server 
can get zoneinfo that you want? If not, it is possible having this 
problem even if there is _no_ bug.

Check your server configuration first. If you are sure that your server 
is ok, submit bug report and ask developers if this is a bug or not.If 
this is a bug, it will be fixed hopefully.

PS: You might want to ask W2K users to verify this problem. Post new 
article with title like Possible mail() bug under Windows. Then 
Windows users will pay attention. I'm not a windows user :)

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   3   4   >