Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sql="SELECT * FROM quotes ORDER BY quotes .`id` DESC";
- $result=mysql_query($sql);
- $show = isset($_GET['show']);
- if ($show == '1') {
- while($rows=mysql_fetch_array($result)) {
- ?>
- <div class="box">
- <div class="tbar"> <?php echo "#" . $rows['id'] . " - " . $rows['datetime']; ?></div>
- <div class="comment"> <?php echo nl2br(htmlspecialchars($rows['comment'])); ?></div>
- <div class="bbar"</div>
- <div class="edit"><a href='add.php?action=updatepost&edit=<?php echo $rows['id']; ?>'>Edit</a></div>
- </div>
- <br>
- <?php
- }
- }
- $action = $_GET["action"];
- $edit = $_GET['edit'];
- $id = $_GET['edit'];
- //$comment = $_POST['comment']);
- $sql = mysql_query("SELECT comment, id FROM quotes WHERE id=$id");
- //echo $comment;
- //if ($edit) {
- while($rows = mysql_fetch_assoc($sql)) {
- ?>
- <div class="form">
- <form id="form1" name="form1" method="post" action="add.php?action=submitedit&id=<?php echo $id; ?>">
- <textarea name="comment" cols="65" rows="6" id="comment"><?php echo $rows['comment']; ?></textarea>
- <input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="Reset" />
- </form>
- </div>
- <?php
- if ($action == 'submitedit') {
- //echo "Success";
- echo $_POST["comment"];
- }
- }
- //}
- ?>
- <!doctype html>
- <html lang="da">
- <head>
- <title>#uplink</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf8_genral_ci" />
- <link rel="stylesheet" type="text/css" href="../style/index_style.css" />
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement