Question: In development, should we convert the .html or .htm file extension to .PHP?
To implement the PHP session, and not to redirect if the session is destroyed?

I mean, in C# we use `RedirectToPagePermanent` to keep the user to only access the pages the system will be redirected.

How about PHP?

for example process.

1. Login Page
2. If the user exists:
3. Create a cache or session.
4. Redirect to Main Page.
5. if not then notify the user, and stays on the login page.
6. On Main Page, there is a logout button.
7. User clicks.
8. Session destroyed.
9. Redirect to the Login page.
10. if the user clicks the back button of chrome, the main page will not be shown or redirected because there is no session.

So, in PHP, should I convert all the .HTML or .Htm file to .PHP?

Answer: 
```
subqueries1 = ['name','name2','name3']

def sub_view(qry, subqueries):
  qry_list = []
  for sub in subqueries:
    qry_list.append(qry + """SELECT * FROM""" + sub + """ WHERE id=weather""")
  return qry_list

x=sub_view('qry',subqueries1)
for i in x:
  print(i)

```
It's not clear what your objective is because the query strings don't look that useful, however, you can create a list of queries containing the substitutions using a list comprehension:

```
def sub_view(qry, subqueries):
    return [f"{qry} SELECT * FROM {table} WHERE id='weather'" for table in subqueries]

>>> subqueries = ['name','name2','name3']
>>> sub_view('Some prefix string', subqueries)
["Some prefix string SELECT * FROM name WHERE id='weather'", "Some prefix string SELECT * FROM name2 WHERE id='weather'", "Some prefix string SELECT * FROM name3 WHERE id='weather'"]

```

This will return a list. To bind each of the queries to a variable requires that you know how many items there will be in the list and their order. You could manually code it like this:

```
>>> name, name2, name3 = sub_view('Some prefix string', subqueries)
>>> name
"Some prefix string SELECT * FROM name WHERE id='weather'"
>>> name2
"Some prefix string SELECT * FROM name2 WHERE id='weather'"
>>> name3
"Some prefix string SELECT * FROM name3 WHERE id='weather'"

```

Given that you need prior knowledge of the variable count you could just use the list. Call it `names` and refer to the "variables" by index:

```
>>> names = sub_view('Some prefix string', subqueries)
>>> names[0]
"Some prefix string SELECT * FROM name WHERE id='weather'"
>>> names[1]
"Some prefix string SELECT * FROM name2 WHERE id='weather'"
...

```

Or use a dictionary comprehension to create a dictionary:

```
def sub_view(qry, subqueries):
    return {table: f"{qry} SELECT * FROM {table} WHERE id='weather'" for table in subqueries}

>>> queries = sub_view('Some prefix string', subqueries)
>>> queries
{'name': "Some prefix string SELECT * FROM name WHERE id='weather'", 'name2': "Some prefix string SELECT * FROM name2 WHERE id='weather'", 'name3': "Some prefix string SELECT * FROM name3 WHERE id='weather'"}

>>> queries['name']
"Some prefix string SELECT * FROM name WHERE id='weather'"
>>> queries['name2']
"Some prefix string SELECT * FROM name2 WHERE id='weather'"
...

```

This last example is probably the closest to what you want. It will handle any number of queries and you can still access the individual queries by using the name as the key for a dictionary lookup.