html - always hiding a button after clicking on it using php and css -
i have php code hide download button after clicking on 1 time changing id 0 1 .. after if time user signed in , removes button using simple css hide code.
here code :
<?php $result = @mysql_query("select * scode updated= 1 , coden ='$username'"); if ($_post[downloadthefile]== "downloadthefile") { $upd_art = "update scode set downloaded='".$_post[t11] ."' id='$_session[userid]'"; mysql_query($upd_art) or die(mysql_error()); } if($row['downloaded']==1) { echo "<style> .thedownloadbutton {display:none;} </style>"; } ?> <form class="thedownloadbutton" method="get" action="<? echo '../download/'.$item_downloadlink .'.zip' ; ?>"> <button type="submit" name="downloadthefile" value="downloadthefile">download </button> <input name="t11" type="hidden" size="2" value="1"> </form>
(just clarifying: updated =1 field that'll open download page.. if updated =1 there download page )
i don't know why doesn't work .. can me please , till me part wrong part ? know it's bad way hide element using css , there suggestion ?
$_post[downloadthefile]
should $_post['downloadthefile']
if($row['downloaded']!=1) { echo '<button type="submit" name="downloadthefile" value="downloadthefile">download </button>'; }
Comments
Post a Comment