I’m trying to set a php session variable on post. When the action is left blank, the session is set, but if I try to redirect to a thank-you page the session isn’t set. I’m not well versed with setting session variables so I don’t know if it’s an EE limitation or something I’m doing wrong. I’ve tried both parsing on input and output.
This works:
<?
session_start();
$_SESSION['name'] = $_POST['name'];
echo "name = ". $_SESSION['name'];
?>
<form method="post" action="">
<input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
This doesn’t:
<?
session_start();
$_SESSION['name'] = $_POST['name'];
echo "name = ". $_SESSION['name'];
?>
<form method="post" action="http://site.com/thank-you">
<input type="text" name="name" />
<input type="submit" value="Submit" />
</form>Thanks in advance.