Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    How to display voucher remaining time?

    Scheduled Pinned Locked Moved Captive Portal
    5 Posts 3 Posters 2.7k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      redeyes
      last edited by

      I'm trying to display remaining voucher time on logout page
      I'm using pfSense 2.3 .

      I tried this code which I found  -> https://forum.pfsense.org/index.php?topic=83385.0

      
         <title>rEdEyEs</title> 
      
               Login Successful! Thank you for using our service.
                           function secondsToWords($seconds)
                  {
                      $ret = "";
      
                      /*** get the days ***/
                      $days = intval(intval($seconds) / (3600*24));
                      if($days> 0)
                      {
                          $ret .= "$days days ";
                      }
      
                      /*** get the hours ***/
                      $hours = (intval($seconds) / 3600) % 24;
                      if($hours > 0)
                      {
                          $ret .= "$hours hours ";
                      }
      
                      /*** get the minutes ***/
                      $minutes = (intval($seconds) / 60) % 60;
                      if($minutes > 0)
                      {
                          $ret .= "$minutes minutes ";
                      }
      
                      /*** get the seconds ***/
                      $seconds = intval($seconds) % 60;
                      if ($seconds > 0) {
                          $ret .= "$seconds seconds";
                      }
      
                      return $ret;
                  }         
               ?>
      
               Remaining Time: 
      
               [Click to continue](<?=$my_redirurl;?>)
      
      

      Tried  to just echo  $remaining_time variable  in the script but  it doesn't work.  https://forum.pfsense.org/index.php?topic=66311.0

      Any help will be appreciated.

      1 Reply Last reply
      Reply Quote 0
      • R
        redeyes
        last edited by

        Managed to get it working  8) , but another problem  :( , It dosen't display if I refresh the page

        W 1 Reply Last reply
        Reply Quote 0
        • GertjanG
          Gertjan
          last edited by

          Visiting the logout page will ….. log out the user ;)

          So, there is no more session - so no more relation between the users's IP, MAC and voucher code.

          Or, all is not lost - visit the 'admin' page where you can check vouchers for remaing time, and (re) use (copie) that code over there to make your own "Voucher to remaining time info page".

          No "help me" PM's please. Use the forum, the community will thank you.

          1 Reply Last reply
          Reply Quote 0
          • W
            walter_leon @redeyes
            last edited by

            @redeyes podrias publicar tu codigo php que lograste funcionar??, Gracias.

            Could you publish your php code that you managed to work ??, Thanks

            1 Reply Last reply
            Reply Quote 0
            • GertjanG
              Gertjan
              last edited by Gertjan

              See https://forum.netgate.com/topic/147410/custom-logout-page/5

              No "help me" PM's please. Use the forum, the community will thank you.

              1 Reply Last reply
              Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
              Privacy Policy · Cookie Policy