Ask coding questions

← Back to all posts
How do you make an id for index.html
Korbindev (134)

Ok so what i mean is This, I want index to be websitename.com/home?id=12332
How do I get that?

Comments
hotnewtop
ch1ck3n (2035)

you can use PHP for

echo "id = " . $_GET["id"];

or use javascript

var url_string = "https://websitename.com/home?id=12332"; //window.location.href
var url = new URL(url_string);
var id = url.searchParams.get("id");
console.log(id);
Korbindev (134)

@ch1ck3n ok but like can i use that? for index.html like attach it so when i click on my website it will go to that?

ch1ck3n (2035)

@KorbinVanette I don't understand what you're saying

Korbindev (134)

@ch1ck3n like i put it in then the link is invalid