J
J
jef02015-12-08 20:02:45
PHP
jef0, 2015-12-08 20:02:45

What is the best way to fulfill the condition?

How can the user be redirected? Inclusion or what?


<?php
if ($_GET['type']) {
if ($_GET['type' === '1']) // Do I need to send the user to the page where he is logged in
?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Makarov, 2015-12-08
@jef0

php.net/manual/ru/function.header.php
and in your code - tin.

if (isset($_GET['type']) && $GET['type'] === '1') {
    header( 'Location:  http://host.dom/');
    exit;
}

D
Denis Kotlyarov, 2015-12-08
@denisandroid

1. if(isset($_GET['type'])) //What you're checking if ($_GET['type']) { if it's null and the get exists it will come out so it doesn't exist
2. I wonder why you === and this is $_GET['type' === '1'], the meaning is not clear
3. Send the browser, or whoever you have there header header('Location: yandex.ru ');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question