captive portal login page help. [php]

  • Hi All,

    Developer/php noob here.

    I'm trying to get this login (captiveportal-login.php) page working, which is an extension of the ozy-captive portal registration page.

    This login page authenticate user's who is already registered using the default page against the radius's mysql db... only things is after the user query validation, the internet does not seem to work. ​

    if you have some time please help take a look at the login page.. let me know how much of it is wrong?

  • Hi,

    Your question can only be answered if mysql client php support is installed. By default, it isn't.
    I haven't.
    Did you ?

    Many tried this - you have to read the entire thread .... and after that you're on your own. Except if you find some one who has done the same thing. A normal situation for a developer. You're on the bleeding edge. So you deal with the blood ^^

    Installing FreeBSD packages like mysql client PHP support is not rocket science, but can't be considered as an easy thing to do.
    Added to that : pfSense will soon be upgraded, and PHP will move from 5.6 to 7.x. This will "break" your self installed packages (here : mysql-client). Things will get even better in the future : mysql support fades out because they moved away from the open source, so everybody embraces mariadb now.

    My advise : the MySQL hassle isn't probably needed anyway. With some old-school html and CSS, and why not, some PHP code, you can make your own captive portal loging page.

  • Hi gertjan,

    Thank you so much for your reply.. i have the got the whole thing working from the page you've have referrred.
    as of now my captive portal is able to register user's and provide the internet.

    I'm trying to extend its functionality in away. so that people who have registered already can login at ease rather than registering every single time. I built this login page with my limited knowledge i.e captiveportal-login.php but its not working need some help.

    This page is able to authenticate with mysql and but then internet does not work.. after that. can someone take a look at the code. let me what am i doing wrong.?


  • @srk3461 said in captive portal login page help. [php]:

    and but then internet does not work.

    "Doesn't work", that's more what an end-user would say.
    You, you are the administrator. You should say :
    "I checked the ipfw rules using ipfw table all list and discovered that the MAC/IP were not entered in the tables [ZONE]_auth_down and [ZONE]_auth_up)." Did you look at these rules ?

    First, you should understand how a captive portals works, and how pfSense implemented it.
    You should read and understand /usr/local/captiveportal/index.php and this one where everything happens : /etc/inc/

    You will find out that the file you mentioned, captiveportal-login.php is just a small part of what happens, only some mysql lookups are done in there.
    Even if I was a real PHP and pfSense expert, I couldn't look at the code and "see" errors. I would the make the code more verbose (by logging to log files) and thus actually "see" what happens and when.

Log in to reply