A
A
Andrey2017-04-20 12:59:44
1C-Bitrix
Andrey, 2017-04-20 12:59:44

Forwarding to 1C bitrix?

Good afternoon!
Such a question on the site, which is made on 1C bitrix, there is a personal account of the buyer, how to make it redirect to the main page of the site when leaving the personal account (logout).
Now when you exit the personal account, it redirects to /personal/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DeclanBartowski, 2017-04-20
@Andrey_Tech

Check if the user is authorized and redirect

global $USER;
if (!$USER->IsAuthorized()) LocalRedirect("/");

V
Vladimir, 2017-04-20
Portev @Vladimir Portev

I used to do a redirect like this. I had a form that was submitted via POST.

<form action="/formdata.php" method="POST" enctype="multipart/form-data" name="form" id="form">	
<input type="hidden" name="curAdres" value="<?='https://'.$_SERVER["HTTP_HOST"].$APPLICATION->GetCurPage()?>">
<input type="email" name="email" placeholder="E-mail куда отправить" value="" required>
<input class="submitbutton" name="" type="submit"  value="Отправить">   
</form>

and this line
value="<?='https://'.$_SERVER["HTTP_HOST"].$APPLICATION->GetCurPage('/')?>"

I redirected to the main page. It's not the best way.
And if he redirects to /personal/ you need to find where he does it and instead of /personal/ Write the main

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question