how can i set a custom header with javascript or php?


How can i set a custom header using javascript or php? I am trying to add a custom header to my html form but i’m new to programming so i’m still learning.

I’d like to add a custom header to my form and my current form code is this one:

<form>
[set-custom-header]
<input type="text" name="username" value="">
<input type="text" name="setterId" value="">
<input type="submit" value="send">
</form>

I’d like to set a custom header on that form, what could i use? Is it possible to do that without using xhr?

Thanks,