S
S
Sergey Kravchenko2015-10-12 12:06:53
PHP
Sergey Kravchenko, 2015-10-12 12:06:53

How to cut down dependence of mode from the transferred parameter?

Good afternoon. Help a newbie. There is a multiland, it was created using

<?php if( (isset($_GET['mode']) && $_GET['mode'] == 'znachenie1') ) { ?>

<?php } elseif ( (isset($_GET['mode']) && $_GET['mode'] == 'znachenie2') ) { ?>

<?php } elseif ( (isset($_GET['mode']) && $_GET['mode'] == 'znachenie3') ) { ?>

<?php } else { ?>

<?php }?>

I need to disable the dependency of mode on the passed parameter, and define it by the name of the domain through which they access ( $_SERVER['HTTP_HOST'] )
, that is, as a result
, site.rf/?mode=znachenie1 should be redirected to the site znachenie1.rf . It's the same with the rest.
I apologize if I described the problems quite correctly, I am an absolute beginner in this matter.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Kravchenko, 2015-10-12
@Vinnica

Who helped thanks, found the solution, it was necessary to replace if( (isset($_GET['mode']) && $_GET['mode'] == 'znachenie1') with if( $_SERVER['HTTP_HOST'] == ' desireddomain.rf' )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question