C
C
Corsair_TM2021-12-07 17:42:08
PHP
Corsair_TM, 2021-12-07 17:42:08

How to load different landings by condition?

Good evening!
There is a root directory in it
index.php
lend1
lend2

In the lend1 and lend2 directories there are different lands in index.php, the city of the user is determined at the root, if the user from the desired city loads the land from the lend1 directory otherwise from lend2, while the lend1 subdirectory should not be displayed in the url or lend2.

Please tell me how to implement this? Of course, you can do all this in index.php - write the code for both landings and execute the necessary part according to the condition, but is there a way to do this with different directories for each landing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2021-12-07
@Corsair_TM

in index.php

if ($city === 1) {
include('lend1/index.php');
} else if ($city === 2) {
include('lend2/index.php');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question