Jump to content

Prevent download for some [pilots]


capt787

Recommended Posts

Good morning to all ,

How are you ?

I am trying to do something for pilots who has less than 10 flights in our Virtual

to prevent download the files from Downloads page in our Virtual

how can i do that ??

i have this code but i am not sure if it work and where can i put it

$userid = $_SESSION["userid"];
$result = mysql_query("SELECT count(*) from `topics` where `userid` = '$userid') or die(mysql_error());
$topicCount = mysql_result($result,0);
if($topicCount < 10){
echo "You have $topicCount topics so far. You need a minimum of 10 to get access to downloads.";
}

download just for pilot who has more than 10 flights otherways pilot cannot download the files

Thank you

Link to comment
Share on other sites

How did you created a download page ?

Just paste this code between every download

if(Auth::$userinfo->totalflights >= 10) {

//place here the download link

} else { echo 'You have to fly at least 10 flights to download.';}

dear this is the code that i created but i don't know how to put the abouve code


<body>



<!--start contain-->
<p align="center"><img src="http://www.omanair-va.org/resources/charts.jpg" width="923" height="300" alt=""/>
</p>
<p> </p>
<p><strong><em>Charts Files : - </em></strong></p>
<p align="center"><strong>Muscat Int Airport </strong></p>
<p align="center"><a href="http://www.omanair-va.org/resources/OOMS.pdf"><img src="http://www.omanair-va.org/resources/Download-Icon.png" width="100" height="100" alt=""/></a></p>
<p> </p>
<p align="center"><strong>Salalah Int Airport </strong></p>
<p align="center"><a href="http://www.omanair-va.org/resources/OOSA salalah.pdf"><img src="http://www.omanair-va.org/resources/Download-Icon.png" width="100" height="100" alt=""/></a></p>
<!--end contain-->


</body>

Link to comment
Share on other sites

  • Moderators


<body>



<!--start contain-->
<p align="center"><img src="http://www.omanair-va.org/resources/charts.jpg" width="923" height="300" alt=""/>
</p>
<p> </p>
<p><strong><em>Charts Files : - </em></strong></p>
<p align="center"><strong>Muscat Int Airport </strong></p>
<p align="center"><?php if(Auth::$userinfo->totalflights >= 10) { ?> <a href="http://www.omanair-va.org/resources/OOMS.pdf"><img src="http://www.omanair-va.org/resources/Download-Icon.png" width="100" height="100" alt=""/></a><?php } else { echo 'You have to fly at least 10 flights to download.';} ?></p>
<p> </p>
<p align="center"><strong>Salalah Int Airport </strong></p>
<p align="center"><?php if(Auth::$userinfo->totalflights >= 10) { ?><a href="http://www.omanair-va.org/resources/OOSA salalah.pdf"><img src="http://www.omanair-va.org/resources/Download-Icon.png" width="100" height="100" alt=""/></a><?php } else { echo 'You have to fly at least 10 flights to download.';} ?></p>
<!--end contain-->


</body>

Check the above.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...