Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Session variables

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Related Topics:
apache ENV variables - Ladies and I'll try to make myself as clear as I can so that the task would be clear. 1 there is services with a free month trial 2 it provides ftp, ssh, mail, etc... 3 mail is qmail 4 qmail has a

environment variables. - Hello, I set and inthe however when I run phpInfo I get to see that the USER variable is set to root. (Do I have to set the User and Group variables to apache in every virtual host that I set up ? thanks, Ron

Apache configuration for PHP variables - How do I configure apache which allows PHP to create program variables with the same name as the HTML form elements. Thanks.

mod_rewrite can't acces to SSL variables ? - Hi all, I think there is a bug in : It works with (phpinfo will see TMP1), but not with Any idea ? ..

mod_rewrite: Variables %{SCRIPT_URI} and %{SCRIPT_URL} not.. - Hello I have apache 1.3.20 on a linux system and in the of I read: module keeps track of two CGI/SSI variables named and But these variables are not ..
Next:  Apache: Mac IE 'Security failure. Data decryption error'  
Author Message
kkrolski

External


Since: Mar 26, 2004
Posts: 5



(Msg. 1) Posted: Mon Mar 29, 2004 6:56 pm
Post subject: Session variables
Archived from groups: alt>apache>configuration (more info?)

Basic session variable.
This does not work.
The session name and ID are the same on each page.
In php.ini: register_globals = On

Session variable test11 does not transfer to test12.php
What am I doing wrong? Thanks for the help.

TEST11.PHP
<?php
session_start();
echo "<br><br>".session_name()." = ".session_id();
echo "<center><b>T E S T 11 ---</b></center><br>";
?>
<html><body>

<form name="form1" method="post" action="test12.php">
<input type="hidden" name="test11" value='Hidden - Test11'>
<center><input type="submit" value="test11"></center>

</form></body></html>

TEST12.PHP
<?php
session_start();
echo "<br><br>".session_name()." = ".session_id()."<br><br>";
echo "<center><b>T E S T 12 </center><br>";
echo "Session variable ( hidden - test11 ) =
".$_SESSION['test11']."<br><br>";
?>
<html><body>

<form name="payment" method=post action="test11.php">
<center><input type="submit" value="test12"></center>

</form></body></html>

 >> Stay informed about: Session variables 
Back to top
Login to vote
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 2) Posted: Mon Mar 29, 2004 7:16 pm
Post subject: Re: Session variables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ken wrote:

 > Basic session variable.
 > This does not work.
 > The session name and ID are the same on each page.
 > In php.ini: register_globals = On
 >
 > Session variable test11 does not transfer to test12.php
 > What am I doing wrong? Thanks for the help.

You never assugned the $_POST['test11'] to a session variable...

 > TEST11.PHP
 > <?php
 > session_start();
 > echo "<br><br>".session_name()." = ".session_id();
 > echo "<center><b>T E S T 11 ---</b></center><br>";
 > ?>
 > <html><body>
 > <form name="form1" method="post" action="test12.php">
 > <input type="hidden" name="test11" value='Hidden - Test11'>
 > <center><input type="submit" value="test11"></center>
 > </form></body></html>
 >
 > TEST12.PHP
 > <?php
 > session_start();

// of course you should validate that
// $_POST['test11'] is the type of
// data that you expect first...
$_SESSION['test11']=$_POST['test11'];

 > echo "<br><br>".session_name()." = ".session_id()."<br><br>";
 > echo "<center><b>T E S T 12 </center><br>";
 > echo "Session variable ( hidden - test11 ) =
 > ".$_SESSION['test11']."<br><br>";
 > ?>
 > <html><body>
 >
 > <form name="payment" method=post action="test11.php">
 > <center><input type="submit" value="test12"></center>
 >
 > </form></body></html>

HTH

--
Justin Koivisto - spam.TakeThisOut@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
SEO Competition League: <a style='text-decoration: underline;' href="http://seo.koivi.com/" target="_blank">http://seo.koivi.com/</a><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Session variables 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]