RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
It seems that there is a problem with the session management on windows/apache. I was 
surfing the web to find an answer, and I noticed that there are couple of other people 
who have the same problem. But alas, there were no answers posted to this problem. So 
someone, please help me if you know why this is happening.

Thanks
Moiz

-Original Message-
From: Daniel Guerrier [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:04 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


Use
$_SESSION['var']

instead of

$_SESSION[var]
--- Golawala, Moiz M (IndSys, GE Interlogix)
[EMAIL PROTECTED] wrote:
 Hi All, 
 
 I have a problem with PHP not remembering sessions.
 for example:
 
 in page1.php:
 
 ? session_start();
 $_SESSION[var] = Please help; ?
   form action=sessionTest2.php method=post
   input type=text name=loopCount size=21,
 maxlength=20/td 
   input type=submit value=Submit/td   
 
 
 in page2.php
 ? session_start();
 echo $_SESSION[var];
 echo $_POST[loopCount];
 ?
 
 what I see above is only data for loopCount. I am
 not able to see the Please help on page2
 
 I noticed that 2 cookies were created one for each
 session start. When I opened one of the cookies, I
 noticed that the data Please help was in the
 session cookie. Somehow php thinks a session is not
 already created and starts a new session on
 page2.php.
 
 my php.ini file has:
 register_globals = off
 session.use_cookies = 1
 session.use_only_cookies = 1
 session.auto_start = 0
 session.gc_maxlifetime = 1440
 
 Please can someone help me. I am not sure what I am
 doing wrong? Maybe it is some configuration that is
 causing this issue. Any help appreciated.
 
 Thanks,
 moiz
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
This is what is defined in the php.ini file for save handler routines.. I am newbie, I 
left it with default values:

session.save_handler = files
session.save_path = c:/Program Files/Apache Group/Apache2/htdocs/Alarms/

thanks
moiz


-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:27 PM
To: 'Curt Zirzow'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


are you using session save handler routines?

If not make sure you have a /tmp directory on your server, in fact you can
check phpinfo() to find out what the session save directory is (provided you
are not using save handler routines).

good luck

Warren Vail

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


* Thus wrote Daniel Guerrier ([EMAIL PROTECTED]):
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

This doesn't matter.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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

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

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
I was surfing the web to find out if I was the only one with this strange problem and 
I found out that I was not alone.. Aparently there was a bug in php version 4.1.0 
regarding this. However there is no bugs like this noted for php version 4.3.2 (which 
is what I am running).

rgds
moiz 

-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:27 PM
To: 'Curt Zirzow'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


are you using session save handler routines?

If not make sure you have a /tmp directory on your server, in fact you can
check phpinfo() to find out what the session save directory is (provided you
are not using save handler routines).

good luck

Warren Vail

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


* Thus wrote Daniel Guerrier ([EMAIL PROTECTED]):
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

This doesn't matter.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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

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

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
Hi Warren,

Ahh.. now i know what you mean by save handler routines.. I don't have any in any of 
my php files.

yes, the save_path was pointing to the place where I have the web files stored. I can 
see the session files in that directory. I have tried to point to another directory 
too. But I have the same problem. Each time I do a session start on a page, I have a 
new session file. The first one has data in it because I add the data to the session 
on the page. The second session file is empty. Infact if I have an ?echo SID;? on 
each of the 2 pages, I see different session Ids.

You are correct.. I didn't think about a user getting to the session files. modify the 
php.ini file to save the session files to a more secure location.  

 Regards,
 Moiz Golawala
 Casi-Rusco, a GE Interlogix Company
 791 Park Of Commerce Blvd., Boca Raton, FL 33487 *
 [EMAIL PROTECTED] *
 561-912-5972 *  561-912-1650 *
 


-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:42 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); Curt Zirzow;
[EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


while this doesn't mean that save handler routines are not used, it provides
some clues.

Does the directory pointed to by the session.save_path contain session files
(they will usually have an encrypted filename)?

save handler routines are actually defined in your php files, usually
dynamically, possibly in a common include file; and they override but do not
change the settings in your php.ini file.

http://us4.php.net/manual/en/function.session-set-save-handler.php

The directory pointed to, looks suspicious since it appears that it may be
in the web space area (accessible to http:), if someone can browse that
directory with a browser, all kinds of good things might be found inside
sessions???  if your http.conf file (for apache) points to something other
than htdocs as the web root, you may be ok.

Warren

-Original Message-
From: Golawala, Moiz M (IndSys, GE Interlogix)
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:31 PM
To: Vail, Warren; Curt Zirzow; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


This is what is defined in the php.ini file for save handler routines.. I am
newbie, I left it with default values:

session.save_handler = files
session.save_path = c:/Program Files/Apache Group/Apache2/htdocs/Alarms/

thanks
moiz


-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:27 PM
To: 'Curt Zirzow'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


are you using session save handler routines?

If not make sure you have a /tmp directory on your server, in fact you can
check phpinfo() to find out what the session save directory is (provided you
are not using save handler routines).

good luck

Warren Vail

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


* Thus wrote Daniel Guerrier ([EMAIL PROTECTED]):
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

This doesn't matter.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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

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

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

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
Chris,

I am sorry to call it a cookie.. I see the data in a session file (not a cookie) I 
don't have a html file. I simply call the .php file by typing the url as 
http://localhost/page1.php

Thanks
moiz


-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:49 PM
To: Daniel Guerrier; Golawala, Moiz M (IndSys, GE Interlogix);
[EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


--- Daniel Guerrier [EMAIL PROTECTED] wrote:
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

That won't make any difference.

As for the original question, I don't notice any immediate problems with the
code:

  in page1.php:

  ? session_start();
  $_SESSION[var] = Please help; ?
  form action=sessionTest2.php method=post
  input type=text name=loopCount size=21,
  maxlength=20/td 
  input type=submit value=Submit/td   

  in page2.php:

  ? session_start();
  echo $_SESSION[var];
  echo $_POST[loopCount];
  ?

You mentioned seeing Please help in a cookie. Are you certain about this? I
don't understand how that can end up in a cookie unless you set the cookie
yourself or there is a serious bug.

Aside from that, it is also worth analyzing exactly what cookies are getting
sent by the browser when it requets page2.php. Can you show us the HTTP for
this particular transaction?

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
I added the code you mentioned. Below is the result from the browser. I notice that 
the sessionId is the correct one from the previous page.
I think this is good new.. :)

2
[Array
(
[PHPSESSID] = 0572d98f00483accdc6e61348b359287
[loopCount] = 2
)
]

Thanks
moiz


-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 5:03 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); Daniel Guerrier;
[EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


--- Golawala, Moiz M (IndSys, GE Interlogix) [EMAIL PROTECTED] wrote:
 I am sorry to call it a cookie.. I see the data in a session file
 (not a cookie)

OK, so you just look in this file manually?

 I don't have a html file. I simply call the .php file by typing the
 url as http://localhost/page1.php

HTML and HTTP are two different things. What I wanted to find out is whether
your browser is sending the cookie when it requests that second page. Put this
code in there:

pThe cookie data is:
pre[? print_r($_POST); ?]/pre

Let us know what that shows.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] set the PHP to look at library files.

2003-10-03 Thread Golawala, Moiz M (IndSys, GE Interlogix)
Hi, 

I am running PHP with apache. I put all my webpages in the htdocs folder. A lot of my 
scripts use a bunch of open source libraries. Until now I have been including these 
libraries in my scripts by defining a full path to the library 'inc' files. If I put 
the library itself in my htdocs folder I can see it. However, I want to simply include 
the library by saying:

include (xmlrpc.inc);

I don't want to put the absolute path in the include statement nor do I want to have 
the xmlrpc.inc file in the same directory as the script that needs it. Is there a some 
configuration setting in the php.ini file that I can set so that It always points to 
some path to look for the include files (It would be nice if the any thing below that 
path is also seen if I set the path. So if i set the path in the configuration to see 
/usr/home/ , even if i put something under /usr/home/install/.. I will be able to pick 
it up.) Thank in advance for any help.

Moiz

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



RE: [PHP] PHP class and extends

2003-09-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
You can do one of 2 things. 

1. You can comment out the ExecuteQuery Function in the child class. 
2. When you call the function in the child class simply call it as 
Parent::ExecuteQuery. This way php will know what function you are trying to call. 

cheers
Moiz


-Original Message-
From: BENARD Jean-philippe
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 23, 2003 7:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP class and extends


Hi !

I've got a problem with class extends. I've a top class which
name is cl_app. xxx_cl_app is an extend of cl_app. Cl_app define a
function called ExecuteQuery. xxx_cl_app define this function too but
this one is obsolete. Now, I want to use the cl_app ExecuteQuery
function in my app but there is a problem :

In the cl_app class, ExecuteQuery function return 2 object : 
$return = array($nb_lines, $array_results)
and the xxx_cl_app defined this function as :
$return = array($array_results, $nb_lines)

I don't want to recode all others scripts and I don't want to put the
new function code in xxx_cl_app. So here is my question :

Is there something to do in order that when I use
xxx_cl_app-ExecuteQuery(), there's a function ExecuteQuery() in
xxx_cl_app that do something like this :

(xxx_cl_app.php)
function ExecuteQuery(x,y) {
$tmpResult = [herited_class]-ExecuteQuery(x,y);
return array($tmpResult[1], $tmpResult[0]);
}

Thanks in advance !

(o_   BENARD Jean-Philippe - Consultant STERIA Infogérance
(o_   (o_   //\ RENAULT DTSI/ODPS/[EMAIL PROTECTED] * ALO * API : MLB 02C 1 14
(/)_  (\)_  V_/_   2 Av du vieil étang * 78181 MONTIGNY-LE-BRETONNEUX
   Tél : +33 1-30-03-47-83 * Fax : +33 1-30-03-42-10

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

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



RE: [PHP] multiple FORMS on same page problem.

2003-09-16 Thread Golawala, Moiz M (IndSys, GE Interlogix)
It is almost working.. I can't figure out why I can get the someVal to page5.php.

file: page4.php

?php

if (isset($_REQUEST['submit1'])){
 echo button 1 was clicked, act accordingly;
 echo this the request values;
 echo $_REQUEST['someVal'];
}elseif(isset($_REQUEST['submit2'])){
 session_start();
 echo button 2 was clicked, act accordingly;
 $_SESSION['post'] = $_POST;
 header(Location: http://127.0.0.1/Alarms/page5.php??=SID?);
}else{
 echo NO button clicked, do not act accordingly;  
}
?
html
form action=page4.php method=post
?php echo this is page 4; ?
input type=text name='someVal' value=''
input type='submit' name=submit1 value='page4 Submit'
/form


form action=page4.php method=post
input type='submit' name=submit2 value='page5 Submit'
/form
/html


file: page5.php
?php
$_POST = $_SESSION['post'];
$val = $_POST['someVal'];
echo $val;
echo this is page 5;
?

for some reason I get the error that the header was already sent. I have to send the 
session Id to the next page the old fashioned way since I have another problem that 
causes a new session to be created everytime a page is loaded. Do you where the 
problem is?

Thanx
Moiz

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Monday, September 15, 2003 4:36 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); [EMAIL PROTECTED]
Subject: Re: [PHP] multiple FORMS on same page problem.


You can only use one form, as you've figured out. You can have PHP determine
the action for each button, though..

In a form with two buttons, say names submit1 and submit2, only one
variable will be set when the form is submitted, the actual button that was
clicked. So you can use logic like this in PHP.

?php
if(isset($_REQUEST['submit1']))
{ echo button 1 was clicked, act accordingly; }
elseif(isset($_REQUEST['submit2']))
{ echo button 2 was clicked, act accordingly; }
else
{ echo no button clicked, do not act accordingly?; }

So this would be in page4.php. $_REQUEST['someVar'] would be available
here.

Now, you want to redirect to page5.php if button two is pressed, right,
yet retain the value of $_POST?

if(isset($_REQUEST['submit2']))
{
$_SESSION['post'] = $_POST;
header(Location: http://www.yourdomain.com/page5.php;);
}

Now, on page5.php, to get $_POST back, just do:

$_POST = $_SESSION['post'];

That's assuming you have session_start() on each page and you don't have
anything in $_POST already on page5.php that you want to retain.

---John Holmes

PS: Sorry for the top-post, but OExpress sucks. :)


- Original Message - 
From: Golawala, Moiz M (IndSys, GE Interlogix) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 15, 2003 4:17 PM
Subject: [PHP] multiple FORMS on same page problem.


I am creating a page with 2 buttons. One which will refresh the page and the
other that will go to another page. My problem that I need to put all the
values into $_POST and have access to when any of the 2 buttons are clicked.
If I use the button in 2 seperate form tags I don't have access to all the
values in $_POST. Please look at the code below:

file (page4.php):

html

form action=page4.php method=post
?php echo this is page 4; ?
input type=text name='someVal' value=''
input type='submit' value='page4 Submit'
/form
form action=page5.php method=post
input type='submit' value='page5 Submit'
/form
/html

file(page5.php):

?php
$val = $_POST['someVal'];
echo $val;
echo this is page 5;
?

I would like to see the variable 'someVal' in the $_POST of both page4
Submit button and page5 Submit button. This code is a simplified version
of the more complecated code where a tonnes of other values are involved.
Any help is appreciated.

Moiz

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

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

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



[PHP] multiple FORMS on same page problem.

2003-09-15 Thread Golawala, Moiz M (IndSys, GE Interlogix)
I am creating a page with 2 buttons. One which will refresh the page and the other 
that will go to another page. My problem that I need to put all the values into $_POST 
and have access to when any of the 2 buttons are clicked. 
If I use the button in 2 seperate form tags I don't have access to all the values in 
$_POST. Please look at the code below:

file (page4.php):

html

form action=page4.php method=post
?php echo this is page 4; ?
input type=text name='someVal' value=''
input type='submit' value='page4 Submit'
/form
form action=page5.php method=post
input type='submit' value='page5 Submit'
/form
/html

file(page5.php):

?php
$val = $_POST['someVal'];
echo $val;
echo this is page 5;
?

I would like to see the variable 'someVal' in the $_POST of both page4 Submit button 
and page5 Submit button. This code is a simplified version of the more complecated 
code where a tonnes of other values are involved. Any help is appreciated. 

Moiz

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



[PHP] error cannot instantiate non-existent class

2003-09-12 Thread Golawala, Moiz M (IndSys, GE Interlogix)
I am newbie with php and I am trying to instantiate a class. I am using the command 
line to test my stuff out before I try it with a browser. The following is my class 
code: (name of file is AddConfigs.inc)
?php
class AddConfigs{

var $config;

function AddConfigs($config){
this-$config = $config;
echo  in constructor $config ;
echo  in constructor statement 2 .$config;
}


}
?

The following is the code of the file I am trying to instantiate the class with: (name 
of file is test.php)

?php
require('C:/Program Files/Apache Group/Apache2/htdocs/Alarms/AddConfigs.inc');

$a = new AddConfigs('testing');

?

I type in php test1 and I get the following errors:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in C:\Program Files\Apache 
Group\Apache2\htdocs\Alarms\AddConfigs.inc on line 7

Fatal error: Cannot instantiate non-existent class: addconfigs in C:\Program 
Files\Apache Group\Apache2\htdocs\Alarms\test1.php on line 4
Please can someone help me...?

Many Thanks
Moiz

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



[PHP] New Session Ids generated with each page request

2003-09-11 Thread Golawala, Moiz M (IndSys, GE Interlogix)
My problem is that I get a new Session Id with every request I send to the server. For 
that reason I am unable to share variables between pages using sessions. (I get a new 
session Id even I refresh the same page). The code below prints out different session 
id for page1.php and page2.php. Can someone please help me figure out what would 
be causing this.

on page1.php  I have the following code:
?php
session_start();
echo SID
?
a href=page2.phpNext page /a

on page2.php I have the following code
?php
session_start();
echo SID
?

Moiz 

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

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



[PHP] Problem with HTML Text box and PHP variable.

2003-09-11 Thread Golawala, Moiz M (IndSys, GE Interlogix)
I am having a problem with rendering PHP variables in an HTML text box. If the value 
of  $myString is Hello the line below will render it correctly
echo tdinput type=text name=value.$j.$i. size=20 value=.$myString./td;

However if the value of $myString is Hello 1 then the line above will populate the 
text box with only Hello and it will loose the 1 

If I change the problem line to the following:

echo td.$myString./td;

I don't have a problem. Hello 1 will be rendered correctly. But then I don't have a 
text box to edit the value. Please help.

Thanks
Moiz 

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