how to store variable values over multiple page loads

前端 未结 7 511
南笙
南笙 2020-12-18 07:34

I\'m making a php script that stores 3 arrays: $images, $urls, $titles based on the input data of the form within the php file.

<
7条回答
  •  心在旅途
    2020-12-18 08:22

    Store the variables in a PHP session.

    session_start();
    $_SESSION['images'] = $images;
    

    Then on next (or any other) page, you can retrieve the values as:

    session_start();
    $images = $_SESSION['images'];
    

提交回复
热议问题