image
image
Ticket Options
Question Details
TICKET ARCHIVE -> Php On Macintosh
nishith - Jul 16, 2005 - 6:46 am
image
image
How to pass data between files in php 5 which is to be used on macintosh server?

to get more clear idea, i am writing code of both the files.

"test1.php"
session_start();
if($_post['txtuser']!= ""){
session_register("admin");
$_session['admin']=$_post['txtuser'];
pageredirect("tester2.php");
}
function pageredirect($page){
echo "";
}
?>



username :


-------------------------

"test2.php"
echo $_session['admin'];
echo $_post['hidlog'];
echo $http_post_vars['hidlog'];
echo $http_session_vars['admin'];
?>

---------------------------------------------
i am not getting any value.
please help me out in this concern.


macbri - Jul 16, 2005 - 8:09 am
image
image
Hi Nishith -

I believe you need to call session_start() in *both* PHP files. There's a concise description of creating & resuming a session at the following link - Hope it helps!

http://us2.php.net/manual/en/function.session-start.php

--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com
nishith - Jul 18, 2005 - 12:26 am
image
image
Dear Brian,

Thanks a lot for your reply. Yes, you are right, using session_start(), my half of the work is over. But how to pass value from one form to another? Hidden variables are not working on Mac Server. Even $_POST is not working. Please help me out in this concern soon.

Regards,
Nishith Shah.
nishith@cybervox.net
macbri - Jul 18, 2005 - 4:36 am
image
image
Hi Nishith -

Just a thought, check your /etc/php.ini file and make sure "register_globals" isn't set to "off". Recent updates changed this. Note that you may only have an /etc/php.ini.default file -- if you want to make changes copy it to /etc/php.ini first. Secondly, there's a detailed discussion of the "register_globals" setting and why it has been changed at http://www-128.ibm.com/developerworks/opensource/library/os-php1/

- Brian

--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com
macbri - Jul 18, 2005 - 4:37 am
image
image
By the way I may have not been very clear in what I said in my previous comments now that I read them back

The short version: Make sure register_globals is "on".

- Brian

--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com

IF THIS IS YOUR QUESTION AND YOU WISH TO RESPOND, LOGIN HERE FIRST.


Search Engine Friendly URLs by vBSEO 3.1.0