I am new to PHP, just trying to finish my first app...
It's a real estate page. 
User may add info for open house. Code directs to add general info. Then Picture. This route works very well with session. There is log in system. Same user would add new open house and edit current ones all while logged in.

There is a link to Edit Account which at this point users can edit whatever, inclusive listings, add pictures, etc. 
But when I go this route, the session brings he same values for address from the first info entry, and not for the item to be edited. 

My guess is that I basically have two routes:
a) have two sessions at the same time  

**Question**: how to differentiate them? How to call them? I just can't understand php.net yet. Maybe within a few months. I tried.

b) I learned (after a lot of sweat and endless nights) the very basic \_POST using the URL. But the way i learned it is mostly useful for consecutive pages. I need to go through multiple hoops...

**Question**: Is there a way to keep passing the post and get values over several different pages? Or create a global variable?

Is there a better way to do this besides what I have researched?

Thank you for you time.

**EDIT\*\*EDIT**

I was asked to put some code here. 
Once I get all info for the open house, I have one file that insert all data in DB, and gets address, city and state to geocode address in order to insert data (lat , lng) in DB

```
$username = $_SESSION['user']['username'];

$sql="INSERT INTO braaasil_brokerstour.property(day, hours,laundry_equip, VERY LONG QUERY, ETC.)
VALUE ('$_POST[day]','$_POST[hours]','$_POST[laundry_equip]',VERY LONG QUERY, ETC. ETC'$username')"
    or die ("fail");  

if (!mysqli_query($connection,$sql))
  {
  die('Error: ' . mysqli_error($connection));
  }

$P_ID = $connection->insert_id;
printf ("New Record has id:  %d.\n", $P_ID);
$_SESSION['P_ID']   = $P_ID;
ETC. ETC.

```

Than, I get a few values in SESSION to use in different pages. 

```
<?php session_start(); 
$address = $_SESSION['address'];
$city = $_SESSION['city'];
$zip_code = $_SESSION['zip_code'];
$P_ID = $_SESSION ['P_ID'];

```

The problem is that the same user may add a new listing and fix old stuff and the session is there. It would be nice that pageInsertNew.php (the geocode stuff) gets one session. The pageFIX.php (update/fix stuff) creates a different session. This way I could separate stuff. 

I will use this info about ID and address to insert pictures in different table with user's ID and address to make sure we can easily debug if something goes wrong. 

I **really appreciate** all the answers. But I need a full day to understand them, study them, and I will get back. I am new here, but i think you may get an email with any change I do here. 

Thank you again for all the responses. I have no idea how to implement them today, let's hope things will change soon. 

Besides there is this issue between some people who like post/get and some people prefer session. I am in no position to judge this at this point with my computer skills. 

**EDIT #2**
Thank you imsiso. 
These is the second source of values that I need (first one is above in this question). Both have the same names (address, city, zip\_code). Both to be used by the same user either in the same session or not. 

```
<?php
  require_once('config.php');       

   $query = sprintf("select P_ID, address, city from property WHERE username =  '".(
                 htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8'))."'");

    $result = mysql_query($query, $db);

    $images = array();

  while ($row = mysql_fetch_array($result)) {
      $address = $_SESSION['address'];
      $city = $_SESSION['city'];
      $zip_code = $_SESSION['zip_code'];
      $P_ID = $_SESSION ['P_ID'];
         echo $P_ID;
        echo $city;

 ?><br />

Edit pictures:

<form action="formAddPic2.php" method="post">
<li> <a href="formAddPic2.php?P_ID=<?php echo $row['P_ID']; ?>">Property ID: <?php  print  $row['P_ID'] ?> </a><br /><br />
&ensp;&ensp;  Address: <?php print $row['address']?>,   <?php print $row['city'] ; ?> 
</li>  
<form>
<?php

```

As you see, I had abondoned the session and gone back to get/post just of the property ID, but now I need to get also values for the address just in case I start to have problems. 

Therefore, after one loop, this is what I will try:

```
$properties=array(
/* like:    id=>array(
        'id'=>id
    ),*/
    1=>array(
        'id'=>1,
        'property_name'=>'echo $row['P_ID']',    // automatic id in database
         'zip_code => 'echo $row['zip_code']',
        'some_other_things'=>'some other value',
    ),
    2=>array(
        'id'=>2,
        'property_name'=>'echo $row['P_ID']',    // automatic id in database
         'zip_code => 'echo $row['zip_code']',
        'some_other_things'=>'some other value',
    ),

);

$_SESSION['properties']=array();
$_SESSION['properties']=$properties;

```

So, the array will go after the loop, than I just call the values as in the @imsiso' answer. 
Also, one loop may be always empty depending whether user has to add new listing and fix old stuff or just fix or just add new stuff.