I am trying to pass data from one php file to another. I have tried sessions and cookies and neither works. Here is what I want to do:
Passing data from one php program to another
10
I am trying to pass data from one php file to another. I have tried sessions and cookies and neither works.
Here is what I want to do:
test1.php
<?php session_start(); ?>
<html>
<body>
<?php
$_SESSION['testparm']='Hello';
?>
<a href="http://www.mydomain.com/test2.php">click here</a>;
</body>
-------
test2.php
<body>
<?php echo $_SESSION[['testparm']; ?>
</body>
I show the example with SESSION but Cookies are ok too, if they work. Right now I can't get either to work.
I'm unclear as to whether I should call session_start() in test2.php, but I have tried both ways.
Help please?
thanks,
Roger.
Here is what I want to do:
test1.php
<?php session_start(); ?>
<html>
<body>
<?php
$_SESSION['testparm']='Hello';
?>
<a href="http://www.mydomain.com/test2.php">click here</a>;
</body>
-------
test2.php
<body>
<?php echo $_SESSION[['testparm']; ?>
</body>
I show the example with SESSION but Cookies are ok too, if they work. Right now I can't get either to work.
I'm unclear as to whether I should call session_start() in test2.php, but I have tried both ways.
Help please?
thanks,
Roger.
- AndyBlackSEO
- PCRoger
- AndyBlackSEO
- [1] reply
- PCRoger
- AndyBlackSEO
- PCRoger
- PCRoger
- lharding
Next Topics on Trending Feed
-
10