Domanda

I am not an expert in php and I want to do the following.

I have three views index, step1 and step2

In index view I have an input for a website link, I also have a function which grab some data (name, price, details) from the website and display it on step1. Here I have some other inputs, but I want to post name, price and details in my session so I can get them to step2 without using any inputs.

I tried $name = $_SESSION['name']; and on step2 I tried to display it

 echo $_SESSION['step1']['name'];

But I think this isn't the solution. I hope I made my self clear.

È stato utile?

Soluzione

Store value from $name to $_SESSION['name']:

$_SESSION['name'] = $name;

Echoing content of the session-variable:

echo $_SESSION['name'];

Easy as that!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top