C
C
Chvalov2015-11-16 17:33:25
PHP
Chvalov, 2015-11-16 17:33:25

How to display the desired fragment on the site depending on the get request?

There is a script which should display only two pages. I thought that it would be easier to have one index.php and , depending on the get request, pull up
the desired script with: if the request is site.local/index.php?history then load the hist.php file
php include
php include about.php

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Andrew, 2015-11-16
@Chvalov

if (isset($_GET['history'])) {
include history.php;
}

well, something like this .. about about I think you will do it yourself

M
Mikhail Osher, 2015-11-16
@miraage

www.phptherightway.com

S
sl4mmer, 2015-11-16
@sl4mmer

Well, make a switch by request uri - enough for your task.
But in general, such questions arise - I strongly advise you to start from the basics, otherwise now you’ll do something that you yourself will be ashamed of later +)

D
De YURII, 2015-11-16
@Dejurin

Better use if conditions, works faster than switch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question