Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id='cmsbody'>
- <div id='cmsinnerbody'>
- <?php
- echo "
- <form id='form1' action='article.php?id=".$_POST["id"]." method='post'></form>
- <form id='form2' method='get' action='./'></form>
- <input type='hidden' id='form1' name='id' value='".$_POST["id"]."'>
- ";
- if ($_POST["first"] !=='')
- {
- if($_POST["caption"] !=="" AND $_POST["content"] !=="" AND $_POST["categorie"] !=="" AND $_POST["img"] !=="")
- {
- echo "<div id='newnewscheck' style='background-color:#00DA00; border-color:#007300;'>Gespeichert</div>";
- include('edit.php');
- exit;
- }
- else {
- echo "<div id='newnewscheck' style='background-color:#AA0000; border-color:#6C1313;'>Bitte alle Felder ausfüllen</div>";
- }
- }
- else {
- echo "<input type='hidden' id='form1' name='first' value='true'>";
- }
- $name=$_SESSION["n"];
- $con = mysqli_connect("","watchbetterdb","w9nGyfxwhmQUZArn");
- mysqli_select_db($con, "go4watch");
- $res = mysqli_query($con, "SELECT * FROM usr WHERE usrname='".$_SESSION["n"]."'");
- while ($dsatz = mysqli_fetch_assoc($res))
- {
- $mail=$dsatz["email"];
- $roll=$dsatz["roll"];
- }
- $from = mysqli_query($con, "SELECT * FROM news WHERE id='".$_GET["id"]."'");
- while ($fromsatz = mysqli_fetch_assoc($from))
- {
- $id=$fromsatz["id"];
- $caption=$fromsatz["title"];
- $img=$fromsatz["img"];
- $categorie=$fromsatz["categorie"];
- $content=$fromsatz["content"];
- $autor=$fromsatz["autor"];
- }
- if ($roll == "Admin" or $roll == "Redakteur")
- {
- echo "
- <br>
- <h3>Überschrift:</h3>
- <input form='form1' name='caption' style='height:2em; width:25em;' value='$caption'><br><br>
- <h3>Kategorie:</h3>
- <input form='form1' name='categorie' style='height:2em; width:25em;' value='$categorie'>
- <br><br>
- <h3>Bild URL:</h3>
- <input form='form1' name='img' style='height:2em; width:25em;' value='$img'>
- <br><br>
- <h3>Inhalt:</h3>
- <textarea form='form1' name='content' style='resize:none; resize:vertical ; width: 50em; min-height:30em'>$content</textarea>
- <br>
- <input form='form1' type='submit' class='cmssubmitbutton' value='Speichern'>
- <button form='form2' type='submit' class='cmssubmitbutton'>Abbruch & Zurück</button>
- ";
- }
- else{
- echo "<h4>Du hast keinen Zugriff auf die Seite!</h4>";
- }
- ?>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement