Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. <div id='cmsbody'>
  2. <div id='cmsinnerbody'>
  3. <?php
  4.  
  5. echo "
  6.  
  7. <form id='form1' action='article.php?id=".$_POST["id"]." method='post'></form>
  8. <form id='form2' method='get' action='./'></form>
  9. <input type='hidden' id='form1' name='id' value='".$_POST["id"]."'>
  10.  
  11. ";
  12.  
  13. if ($_POST["first"] !=='')
  14. {
  15. if($_POST["caption"] !=="" AND $_POST["content"] !=="" AND $_POST["categorie"] !=="" AND $_POST["img"] !=="")
  16. {
  17. echo "<div id='newnewscheck' style='background-color:#00DA00; border-color:#007300;'>Gespeichert</div>";
  18. include('edit.php');
  19. exit;
  20. }
  21. else {
  22. echo "<div id='newnewscheck' style='background-color:#AA0000; border-color:#6C1313;'>Bitte alle Felder ausfüllen</div>";
  23. }
  24. }
  25. else {
  26. echo "<input type='hidden' id='form1' name='first' value='true'>";
  27. }
  28.  
  29.  
  30.  
  31. $name=$_SESSION["n"];
  32.  
  33. $con = mysqli_connect("","watchbetterdb","w9nGyfxwhmQUZArn");
  34. mysqli_select_db($con, "go4watch");
  35. $res = mysqli_query($con, "SELECT * FROM usr WHERE usrname='".$_SESSION["n"]."'");
  36. while ($dsatz = mysqli_fetch_assoc($res))
  37. {
  38. $mail=$dsatz["email"];
  39. $roll=$dsatz["roll"];
  40. }
  41.  
  42. $from = mysqli_query($con, "SELECT * FROM news WHERE id='".$_GET["id"]."'");
  43. while ($fromsatz = mysqli_fetch_assoc($from))
  44. {
  45. $id=$fromsatz["id"];
  46. $caption=$fromsatz["title"];
  47. $img=$fromsatz["img"];
  48. $categorie=$fromsatz["categorie"];
  49. $content=$fromsatz["content"];
  50. $autor=$fromsatz["autor"];
  51. }
  52.  
  53.  
  54. if ($roll == "Admin" or $roll == "Redakteur")
  55. {
  56. echo "
  57. <br>
  58. <h3>Überschrift:</h3>
  59. <input form='form1' name='caption' style='height:2em; width:25em;' value='$caption'><br><br>
  60. <h3>Kategorie:</h3>
  61. <input form='form1' name='categorie' style='height:2em; width:25em;' value='$categorie'>
  62. <br><br>
  63. <h3>Bild URL:</h3>
  64. <input form='form1' name='img' style='height:2em; width:25em;' value='$img'>
  65. <br><br>
  66. <h3>Inhalt:</h3>
  67. <textarea form='form1' name='content' style='resize:none; resize:vertical ; width: 50em; min-height:30em'>$content</textarea>
  68. <br>
  69. <input form='form1' type='submit' class='cmssubmitbutton' value='Speichern'>
  70. <button form='form2' type='submit' class='cmssubmitbutton'>Abbruch & Zurück</button>
  71.  
  72. ";
  73. }
  74. else{
  75. echo "<h4>Du hast keinen Zugriff auf die Seite!</h4>";
  76. }
  77. ?>
  78.  
  79. </div>
  80. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement