WampServer

Apache, PHP, MySQL on Windows 

 
  • Accueil forum
  • Retour à WampServer
  • presentation
  • Download
  • Addons
  • Formations
  • Alter Way

 
Voir le sujet: Précédent•Suivant
Aller à : Liste des Forums•Liste des messages•Nouvelle discussion•Recherche•Connexion•Imprimer la vue
session function
Envoyé par: marc.nard (---.cust.tele2.it)
Date: 25 March 2006 à 17:25

Excusez moi but I don't speak french
I've got a problem with session function
I've always used session_register with PHP4, but now with WAMP (PHP5) the variables I pass from a page to another one are not visible

Ex.
$color="red";
session_register("color"winking smiley;
print "<a href='page2.php'>click here </a>";

and in page2.php

session_register("color"winking smiley;
print $color;

returns blank as the $color variable is not passed from a script to another
or

$_SESSION["color"]="red";
print "<a href='page2.php'>click here </a>";

and in page2.php:

(with or without session_start())
print $_SESSION["color"];

I have the same problem


can anyone help me?

merci beaucoup
marco

Options: Répondre•Citer ce Message
Re: session function
Envoyé par: Otomatic (---.fbx.proxad.net)
Date: 25 March 2006 à 19:25

Hello,

Each page I write begin with :
<?php
if (!isset($charset) or empty($charset)) $charset="iso-8859-1";
header("content-type:text/html; charset=$charset"winking smiley;
session_start();

and I set session variable with, for example :
$_SESSION['colonne_def']=4;
$_SESSION['une_page']=false;

And I access the session variables in every page with :
$page=$_SESSION['une_page'];
$colonne=$_SESSION['colonne_def'];

All things work fine ; no problem in local with Wamp and on the real site.
I use simple quote ' and not double quote ".

Does your problem is the same in local AND with the reel site ?

Options: Répondre•Citer ce Message
Re: session function
Envoyé par: marc.nard (---.cust.tele2.it)
Date: 27 March 2006 à 11:31

merci beaucoup otomatic
il march très bien

I've already found a solution on zend site but it gave me still a little problem, yours seems to be surely better
At the moment I can only work in local

thanks again
marco

Options: Répondre•Citer ce Message


Aller à : Liste des Forums•Liste des messages•Recherche•Connexion
Désolé, seuls les utilisateurs connectés peuvent envoyer des messages dans ce forum.
Cliquer ici pour se connecter

design by jidePowered by Alter Way get firefoxget PHP