1

Is there a way that PHP can track and keep a data for what page is being accessed and then this piece of data can be opened/ accessed by all other computers/ users?

For instance, when I am inside my CMS and editing a page called 'home' then I want to store this data in a global (maybe??) so the front end users can know that this page is being edited.

I was thinking using $_SESSION in the backend,

$_SESSION['url'] = $_REQUEST['url'];

Then in the front end page that is being viewed by other person from another machines,

print_r($_SESSION);

and this could be the result,

Array
(
    [url] => home
)

Of course it does not work! Any ideas what I can do to store a global information so it can be accessed by all other computers/ users?

Run
  • 54,938
  • 169
  • 450
  • 748
  • 1
    Database, File, Serialized Object...? Or did I miss something? – idmean Sep 29 '13 at 13:07
  • 2
    `$_SESSION` is only used for storing data for the CURRENT user, so not ALL users. – djot Sep 29 '13 at 13:10
  • 3
    Your concept seem to be wrong anyway ... "let users know that this page is being edited" ... ok nice to inform them - better, to not let them access such a page. So you need a database ("lock"), which holds all files currently being edited ... So I start editing a page - and then don't submit it for hours ... hmmm ;) – djot Sep 29 '13 at 13:12
  • just thought of using a table in the database after submitting this question! thank you! :) – Run Sep 29 '13 at 13:25
  • 1
    @wumm please consider posting your comment as an answer so the question can be closed. – Mikulas Dite Dec 31 '13 at 12:46

0 Answers0