skip to Main Content

I have a php page,
user can sign up/log in to this page,
after pressing the "map button"
this should load the submap page (leafletjs),
but in two versions:

  1. When a user is logged in to my site, he can add marker to this page and that this marker will stay on the map
  2. When the user is not logged in to my website, he cannot add a marker, the map should be displayed with all markers entered by any user (displayed automaticily)

Few questions:

  1. How to display the same page but in 2 version like i said above?
    (I would like to just permit logged in user edit page)
    This is incorrect :
if(isset($_SESSION["useruid"]))
{
header("location: ../mapa1.php");
}
else
{
header("location: ../mapa2.php");
}

2

Answers


  1. Do you mean that header location does not work on the browser? you must set the absolute URL

    header("location: https://YOURDOMAIN.COM/PATH/mapa1.php");
    
    Login or Signup to reply.
  2. there is some solutions for your problem.

    first : you can fix your header function. in header function you have to write a URL not a path.

    second: you can use php between your js codes and write a few if,else for handling your problems.

    if you send all of your file , i can help you better .

    do you have any problem in storing your data ?

    (sorry if my English ain’t good.)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search