Hi,
i'm developing a kind of a project in school, and i need to pass variables from one page to another.
i've tried to do this, passing the session to the other page
<td width="15%"><a href="alterar.php?PHPSESSID=<?php $HTTP_SESSION_VARS["idempregado"]?>">Alterar</a></td></tr>
the problem is that, in the other page,
i got the same value. the variables are not the same, the value is not the same, but the result is the same.
i register the variable that i want to pass as a session variable
if ($_POST[escolha]) {
$idempregado = $_POST[idempregado];
session_register ("idempregado");
ver_caracteristicas ($idempregado);
the problem is that i get the same value for the two variables
$var = $_SESSION[idempregado];
$var2 = $_SESSION[idadministrador];
how to do ?
regards
Error retrieving session variables
Moderator: General Moderators
- feiticeir0
- Forum Newbie
- Posts: 8
- Joined: Tue Nov 05, 2002 1:33 pm
- Location: Castelo Branco, Portugal
So where are you getting the $var2 = $_SESSION[idadministrador];
You should just be able to do
And then on every page have the session_start(); and you can pass that information along.
I have a pretty long one for one of my sites.
You should just be able to do
Code: Select all
<?php
session_register ("idempregado", "idadministrador");
?>I have a pretty long one for one of my sites.
Code: Select all
<?php
session_register("valid_user", "user","email", "url", "twgs", "level", "id", "sitename", "canpost");
?>