capt787 Posted October 8, 2015 Report Posted October 8, 2015 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 Quote
Moderators servetas Posted October 8, 2015 Moderators Report Posted October 8, 2015 if(Auth::$userinfo->totalflights >= 10) { //place here the download link } else { echo 'You have to fly at least 10 flights to download.';} Can you check this? It should work if I have not missed anything. Quote
capt787 Posted October 8, 2015 Author Report Posted October 8, 2015 if(Auth::$userinfo->totalflights >= 10) { //place here the download link } else { echo 'You have to fly at least 10 flights to download.';} Can you check this? It should work if I have not missed anything. I will try waitng me but where should put the code ? which file @servetas Quote
capt787 Posted October 8, 2015 Author Report Posted October 8, 2015 dear friend where can i put the code ? for example To download files clcik Here ! ? Quote
Members Vangelis Posted October 8, 2015 Members Report Posted October 8, 2015 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.';} Quote
capt787 Posted October 12, 2015 Author Report Posted October 12, 2015 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> Quote
Moderators servetas Posted October 15, 2015 Moderators Report Posted October 15, 2015 <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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.