I work on a website which has free subscribers and paying subscribers.
if a user is a free subscriber than $_SESSION[‘sub’] = 0
if a user is a paying subscriber than $_SESSION[‘sub’] = 1
Example 1
Here is a menu:
<div class="dropdown-content">
<a href="includes/update_menu_order.php?mo=1&&
u='.$url.'">A B C ⤊</a>
<a href="includes/update_menu_order.php?mo=2&&
u='.$url.'">A B C ⤋</a>
<a href="includes/update_menu_order.php?mo=3&&
u='.$url.'">profit ⤊</a>
<a href="includes/update_menu_order.php?mo=4&&
u='.$url.'">profit ⤋</a>
<a href="includes/update_menu_order.php?mo=5&&
u='.$url.'">Trades ⤊</a>
<a href="includes/update_menu_order.php?mo=6&&
u='.$url.'">Trades ⤋</a>
</div>
I want it to be displayed to all users.
I want it to funstion when used by paying subscribers only .
When a free subscriber will try to use it- it will not function.
example 2
I have an HTML form. it can be downloaded here
filter_form.html (3.8 KB)
It had 3 divs assigned with unique ID
div id=“periods”
div id=“days”
div id=“intraday”
I want that the section in div id=“periods” will be functional for all users.
The sections in the 2 other divs (div id=“days” & div id=“intraday”)
will be displayed to all users but will be functional for paying subscribers only.
I thought I will use a PHP if statement in the 2 last sections
if( $_SESSION[‘sub’] = 1){
echo the existing code or include a file with that code
}
In that case, how will the code for free subscribers will be?
should I insert a screenshot of the section ?
(I intend to give the disabled sections a unique class and display a message on hover useng JQuery)
What should I do with the form code.
What can I change / remove so that it will not function and won’t issue an error ?
should the code in the menu
<a href="includes/update_menu_order.php?mo=4&&
u='.$url.'">profit ⤋</a>
``` be
` <a href="#'">profit ⤋</a>`
I want that the code could not be manipulated ustng dev tools or by other means