如何检测URL中的GET参数,并根据该值放置值?

I am working on a project in PHP and JavaScript, where i have to create a value from my end, and pass the same in URL query string on redirect from my URL, Below is Description: I have a URL, https://abc.amindfad.com/c.php?id={abdid}

on above URL I want redirection, and pass value from my end by detecting where is {abdid}

The above URL will be redirecting from (my URL) :- https://console.adcashod.net/click.php

i have not done anything yet, Because i am little confused in Code which should be used here.

in Results I want that, when I click on (my URL) :- https://console.adcashod.net/click.php

it get redirects to :- https://abc.amindfad.com/c.php?id={abdid} but,

replace {abdid} with a value which is defined by me. for it.

Waiting for suggestions.

Take a look at this https://www.php.net/manual/en/function.str-replace.php

$value = 'value_defined_by_me';
$url = 'https://abc.amindfad.com/c.php?id={abdid}';
$url = str_replace('{abdid}', $value, $url); //output: https://abc.amindfad.com/c.php?id=value_defined_by_me

As in simple

let url = new URL('https://abc.amindfad.com/c.php?id=value&name=john');

let searchParams = new URLSearchParams(url.search);

console.log(searchParams.get('id')); // outputs "value"

console.log(searchParams.get('name')); // outputs "john"