[PHP] New Session Ids generated with each page request
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: Next page on page2.php I have the following code 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.
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 ""; 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 "".$myString.""; 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
[PHP] error cannot instantiate non-existent class
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) $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) 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] 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): file(page5.php): 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
RE: [PHP] multiple FORMS on same page problem.
It is almost working.. I can't figure out why I can get the "someVal" to page5.php. file: page4.php http://127.0.0.1/Alarms/page5.php?"); }else{ echo "NO button clicked, do not act accordingly"; } ?> file: page5.php 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. 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): file(page5.php): 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
RE: [PHP] PHP class and extends
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
[PHP] set the PHP to look at library files.
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
[PHP] PHP not remembering sessions
Hi All, I have a problem with PHP not remembering sessions. for example: in page1.php: in page2.php 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
RE: [PHP] PHP not remembering sessions
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["var"] = "Please help"; ?> > >maxlength="20"> > > > > in page2.php > 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
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
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
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 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
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["var"] = "Please help"; ?> > > > > > maxlength="20"> > > > > in page2.php: > > > 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
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: The cookie data is: [] 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