H
H
hades4322020-12-09 18:04:19
css
hades432, 2020-12-09 18:04:19

How to place different content on one page?

In general, I'm completely new to the web and make the first site. I do for myself. Maybe, of course, I'm looking badly, but still. I want to make it so that on the same page to place a different file for download, and to determine which file using the id in the page url. To make it clear, here is an example. (Not advertising) https://s1.torrents-igruha.org/?do=download&id=8505 The page is the same, as I understand it, but if you go to download different games, the parameter changes ID. Initially, I thought it was just a matter of creating a separate file for each page, but if you really do it this way, then I think it will be better. If anyone knows, then you can just throw off the site with information for training.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yerdnaandrey, 2020-12-09
@yerdnaandrey

Create a torrents table. It will contain name, url, id.
In the dock we write something like:

$do = $_GET["do"];
$id =$_GET["id"];
if ($do == "download"){
$cnnct = new mysqli("localhost, root, root, yourdb");
$url = $cnnct->query("SELECT url FROM torrents WHERE id = $id");
echo "Ваш торрент: ${url}";
}

And with the help of separate admin pages you fill in your database. You will put all these links on the main page.
And yet, read about $_Get and PHP in general)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question