User Tools

Site Tools



This is the page that subscribers see when there is no default billing plan configured.


Initialize.php will initialize all the standard functions and variables. Plan_execute.php will perform the plan buying action and will login the subscriber automatically.

   <form name="selectPlan" action="<?=$form_action?>" method="post" onSubmit="this.submitbutton.disabled=true;"> 
      <input type="hidden" name="username" value="<?=$_SESSION['PORTAL']['user']?>">      
      <input type="hidden" name="password" value="<?=$_SESSION['PORTAL']['pass']?>"> 
      <input type="hidden" name="login" value="true">                                    
      <select  name="plan" id="billingPlans">
            echo '<option value="'.$plan->id.'">'.$plan->name.': '.$plan->price. ' EUR</option>';  
            while($plan = hsm_fetch_object($plans))
               echo '<option value="'.$plan->id.'" label="'.$plan->name.'" '.($plan->id==$currentplan->id?'selected="selected"':'').'>'.$plan->name.': '.$plan->price.' EUR</option>';       		
       <input id="buy_button" name="submitbutton" type="submit" value="Buy" <?=(isset($_SESSION['PORTAL']['preview'])?"disabled":"")?>>

The first and the third hidden field are required the second (<input type=“hidden” name=“password” value=“<?=$_SESSION['PORTAL']['pass']?>”> ) is optional. The billing plans are shown in a dropdownlist in this example. You can also use a radio button to let the subscriber select the billing plan that he want to use. It's important that the name of the select list is plan and that the value of the <option> item is the id from the billing plan.

portals/plan-page.txt · Last modified: 2021/06/03 14:40 (external edit)