Re: php Session in linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message ----- 
From: "Papis" <>
To: <php-objects@xxxxxxxxxxxxxxx>
Sent: Friday, August 05, 2005 2:54 AM
Subject:  php Session in linux


I want to share session variable between to application typo3 and
dotproject  .

I haven't looked at Typo3 since last winter, so will assume that your
variables etc. are correct...

First off, is sessions working okay? Does a phpinfo.php file show
"Session Support   enabled"?\

contents of phpinfo.php file, upoaded to the root directory of your web
space:

<?php phpinfo(); ?>

If I don't know the configuration, at the top of the first file it looks
like this:

<?php session_start();
header("Cache-control: private"); // IE 6 Fix
// below gets rid of the automatic insertion of the hidden sesson field,
// used if you need to validate to xhtml strict and the field gets put
where you
// don't want it
ini_set("url_rewriter.tags", "a=href,area=href,frame=src,input=src");

then I explicitly include the hidden session input field with my form:

<form action="/dotproject-index.php" method="post" id="step_one"
onsubmit="return validateForm()">
<input type="hidden" name="PHPSESSID" value="<?php echo session_id();
?>" />
your other input(s)....
<input class="btn_input" type="submit" name="submit" value="Click to
Continue &gt;&gt;" />
</form>

> > In the first line of dotproject index.php, I try to get the variable
i created in typo3

I would make it look for each variable you want to pass like this then:

<?php session_start();
  $tpuser = $_POST['tpuser'];
  $tppass = $_POST['tppass'];
// etc.

// Register session key with the value
  $_SESSION['tpuser'] = $tpuser;
  $_SESSION['tppass'] = $tppass;
// etc.

then it's easy to change your variables:

$vartypo3user = $tpuser;
$vartypo3pass = $tppass;

although you may not need to do the above step...

if (isset( $_SESSION["tpuser"])){
    // you don't need this below now possibly
    //$vartypo3user    =  $_SESSION["tpuser"];
    //$vartypo3pass    =  $_SESSION["tppass"];
    //$vartypo3redirect=  $_SESSION["tpredirect"];

    // just do what ever you had to do with your information here
    echo "whole bunch of your info" . "$tpuser" . "$tppass"; // etc.
}

> > But theye are empty.

Add this right after your <body> element on the second page to see if
you are getting everything:

print "your session id is: ".session_id();
echo "<br />\n";
echo "Sessions: <pre>";
print_r($_SESSION);

Also, the Firefox browser with the Web Developer Toolbar will show you
the "Page Info" with a right click and you can see the values of the
sessionid and form fields etc. easily.

> > Would you mind to help me please I'm losting all my hair.

lol! none left to lose over here... try the above, adding the fields you
want as needed to the form and where it says 'etc.', it's an old
fashioned way of doing things but should work on any platform as long as
Session Support is enabled. You may want to check to make sure the
syntax is correct, my server calls it PHPSESSID, yours may be different,
the phpinfo.php file will tell you.

hth!

Warm Regards,

         Mark Groen

MG Web Services
FREE WEB SITE HOSTING! -  find out how
at www.mgwebservices.ca/referral-info.php
mark@xxxxxxxxxxxxxxxx
604-780-6917
Bowen Island, B.C., Canada




------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h1lrssi/M=362329.6886308.7839368.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1123517834/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux