nth nth - 1 year ago 63
PHP Question

can i show what i entered input into sessions?

i want display all with session what i enter into input.. but only one shows .. i want display past results too with session.. here my codes;

<form method="post">

isim gir
<input type="text" name="isim" id="isim[]" />
<input type="submit" name="gir" value="sözler" />


if (session_status() == PHP_SESSION_NONE) {

echo $_SESSION["name"]=$isim;

Answer Source

Create a search_history session variable that contains an array of all the searches.

if (!isset($_SESSION['search_history'])) {
    $_SESSION['search_history'] = array();

if (isset($_POST['gir'])) {
    $isim = $_POST['isim'];
    $_SESSION['search_history'][] = $isim;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download