如何使用$ _SESSION变量
中的参数生成URL$action = (isset($_GET['action'])) ? $_GET['action'] : '';
if($action == "first") {
//$arrQuote = array();
$_SESSION['arrQuote'][0] = '
<form method="post" action="index.php?action=second">
<div class="form-group"> <input type="text" class="form-control" name="klausimas_1"></div>
<button type="submit" name="submit_1" class="btn btn-default">Add Task</button>
</form>
$key = array_rand($_SESSION['arrQuote']);
echo $_SESSION['arrQuote'][$key];
unset($_SESSION['arrQuote'][$key]);
}
答案 0 :(得分:1)
$_SESSION["color_1"] = "yellow";
$_SESSION["color_2"] = "red";
echo 'http://example.com?' . http_build_query($_SESSION);