Hello all. I’m working on a form but I can’t get the following task:
If a user don’t compile all the form, I want to pickup from another php script the POST values and insert them in a SESSION, so reload the form page but with the inputs, which the used compiled previously, with their values has SESSION vars.
This is my code but it doesn’t work…
formpage.php
[php]<?php session_start(); ?>
… some html code …
post.php
[php]
session_start();
if($_POST[‘name’] || $_POST[‘lastname’]) { … some todo code … } else { $_SESSION[‘name’] = $_POST[‘name’]; $_SESSION[‘lastname’] = $_POST[‘lastname’]; header(“Location: formpage.php”); exit; }
[/php]