Advertisement
Guest User

updatepost.php

a guest
Dec 21st, 2011
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.59 KB | None | 0 0
  1.   <?php
  2.  
  3.     $sql="SELECT * FROM quotes ORDER BY quotes .`id` DESC";
  4.     $result=mysql_query($sql);
  5.  
  6.     $show = isset($_GET['show']);
  7.    
  8.     if ($show == '1') {
  9.       while($rows=mysql_fetch_array($result)) {
  10.       ?>
  11.          
  12.     <div class="box">
  13.      
  14.       <div class="tbar"> <?php echo "#" . $rows['id'] . " - " . $rows['datetime']; ?></div>
  15.       <div class="comment"> <?php echo nl2br(htmlspecialchars($rows['comment'])); ?></div>
  16.       <div class="bbar"</div>
  17.       <div class="edit"><a href='add.php?action=updatepost&id=<?php echo $rows['id']; ?>'>Edit</a></div>
  18.     </div>
  19.       <br>
  20.    
  21.   <?php
  22.  
  23.     }
  24.   }
  25.  
  26.  
  27.   $action = $_GET["action"];
  28.  
  29.  
  30.   if ($action == 'submitedit') {
  31.     echo "test";
  32.   }
  33.  
  34.   $id = $_GET["id"];
  35.   $sql = mysql_query("SELECT comment, id FROM quotes WHERE id=$id");
  36.  
  37.       while($rows = mysql_fetch_assoc($sql)) {
  38.            
  39.     ?>
  40.    
  41.     <div class="form">
  42.     <form id="form1" name="form1" method="post" action="add.php?action=submitedit&id=<?php echo $id; ?>">
  43.           <textarea name="comment" cols="65" rows="6" id="comment"><?php echo $rows['comment']; ?></textarea>
  44.             <input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="Reset" />
  45.     </form>
  46.     </div>
  47.  
  48. <?php
  49.      
  50.    
  51.   }
  52. ?>
  53.  
  54.  
  55.  
  56.  
  57. <!doctype html>
  58. <html lang="da">
  59.  
  60.   <head>
  61.     <title>#uplink</title>
  62.     <meta http-equiv="Content-Type" content="text/html; charset=utf8_genral_ci" />
  63.     <link rel="stylesheet" type="text/css" href="../style/index_style.css" />
  64.   </head>
  65.  
  66.   <body>
  67.  
  68.  
  69.   </body>
  70.  
  71. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement