Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Ukrywanie - div3
- if($_SESSION['admin']==1){
- echo '<form action="hide.php" method="POST">';
- echo '<input type="hidden" name="id_art" value="'.$art['id_art'].'">';
- if($art['visible_art']==1)
- {echo "<input type='submit' name='hide' value='hide'>";}
- else{
- echo "<input type='submit' name='show' value='show'>";
- }
- echo '</form>';
- }
- // ukrywanie - hide.php
- <?php
- include('conn.php');
- $art_id=$_POST['id_art'];
- if(isset($_POST['hide']) || isset($_POST['show'])){
- if(isset($_POST['show'])){$query="UPDATE articles SET visible_art=1 WHERE id_art=$art_id";}
- else{$query="UPDATE articles SET visible_art=0 WHERE id_art=$art_id";}
- $result=mysql_query($query);
- if($result){
- header('location:index.php');
- exit;
- }
- else{
- echo 'problem';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement