KPIDelivery
Programmer
I am trying to use these sessions and php_self form in combination. For some reason the form will not change the variable values. Am I nuts?
Here is the code samples to see if some of you geniuses see what i am doing wrong. They are small and you can copy
//sessionvariables.php script
<?
session_start();
session_register ('apieceofdata');
session_register ('andanother');
require( "sessionvariables3.php" );
$apieceofdata = "this is";
$andanother ="all the data";
?>
<form action="<? echo $PHP_SELF; ?>" method="POST" ENCTYPE="multipart/form-data">
This overrides a piece of data: <input name="apieceofdata" type="text"> <br>
This overrides and another: <input name="andanother" type="text">
<input type="submit" name="submit" value="submit"> </form>
<?
If ($submit )
{
echo $apieceofdata." ".$andanother.'<br>';
echo "<a href='sessionvariables2.php'>|= ENTER =|</a>";
}
?>
//end of sessionvariables1.php script
//sessionvariables2.php script
<?
session_start();
echo "What have I got? ".$apieceofdata." ".$andanother.'<br>';
echo "Plus this? ".$abigdata;
?>
//end of sessionvariables2.php
//sessionvariables3.php script
<?
session_start();
session_register('abigdata'); $abigdata='A Lotta Data';
?>
//end of sessionvariables3.php
I made up this simple example becuase i had built a big multipart form program and variables were not getting passed between php scripts...i wanted to see if it was require problem or Form problem or session problem. All I know is that it does not change variable values.
ARG!!!
Here is the code samples to see if some of you geniuses see what i am doing wrong. They are small and you can copy
//sessionvariables.php script
<?
session_start();
session_register ('apieceofdata');
session_register ('andanother');
require( "sessionvariables3.php" );
$apieceofdata = "this is";
$andanother ="all the data";
?>
<form action="<? echo $PHP_SELF; ?>" method="POST" ENCTYPE="multipart/form-data">
This overrides a piece of data: <input name="apieceofdata" type="text"> <br>
This overrides and another: <input name="andanother" type="text">
<input type="submit" name="submit" value="submit"> </form>
<?
If ($submit )
{
echo $apieceofdata." ".$andanother.'<br>';
echo "<a href='sessionvariables2.php'>|= ENTER =|</a>";
}
?>
//end of sessionvariables1.php script
//sessionvariables2.php script
<?
session_start();
echo "What have I got? ".$apieceofdata." ".$andanother.'<br>';
echo "Plus this? ".$abigdata;
?>
//end of sessionvariables2.php
//sessionvariables3.php script
<?
session_start();
session_register('abigdata'); $abigdata='A Lotta Data';
?>
//end of sessionvariables3.php
I made up this simple example becuase i had built a big multipart form program and variables were not getting passed between php scripts...i wanted to see if it was require problem or Form problem or session problem. All I know is that it does not change variable values.
ARG!!!