@Intone said in Relationship between uploaded HTML and index.php in Captive portal.:
the relationship
When the device hits the captive portal's web server at @IP-Portal:800x the index.php is used.
"index.php" because : see the nginx main configuration file - one for http and one for https.
[image: 1726739465297-9c814fc8-8d56-4bad-acdb-fc7a62a19dc5-image.png]
If the user isn't already logged in, the index.php doesn't do match and falls trough the index.php up until this point.
The function portal_reply_page is called with $type set "login" so the main 'html' login page is sourced (line 1835), this is your uploaded html file, variables are put in place, stuff like #PORTAL_ZONE#, and then the magic happens at line 1868.
echo $htmltext;
and done.
When you hit "Connect", now your 'posting', the same index file is used, and you reach the most common point where user and password entries are tested, and if ok, access is granted.
short survey : You can use php in your self made 'html' page. edit : go for the easy mode : create a link text (URL) that links to another web page that you upload into pfSense. You will have to write some back end code (script) to handle the user input.
Get a copy of the default build in login page (you can see it here) for an example.