Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. $hostname="localhost";
  2. $databasename="editoncms";
  3. $username="root";
  4. $password="PASSWORT";
  5.  
  6. try
  7. {
  8. $dbhandler=new PDO('mysql:host='.$hostname.';dbame='.$databasename,$username,$password);
  9. $dbhandler->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
  10.  
  11. }
  12.  
  13. catch(PDOException $errormsg)
  14. {
  15. die($errormsg->getMessage());
  16. }
  17. echo"Databse Connected to MySQL!";
  18.  
  19. require 'include/bdconnect.php';
  20. $id=$_GET['edit'];
  21. // i am fetching id from other page by clicking on edit button.
  22.  
  23. if(isset($_GET['edit'])){
  24. $SQL=$dbhandler->prepare("SELECT * FROM banner WHERE id=?, Title=?, seo=?, images=?");
  25. $SQL->bindParam(1, $id, PDO::PARAM_INT);
  26. $SQL->bindParam(2, $title, PDO::PARAM_STR);
  27. $SQL->bindParam(3, $seo, PDO::PARAM_STR);;
  28. $SQL->bindParam(4, $img_final, PDO::PARAM_STR);
  29. $SQL->execute();
  30. }
  31.  
  32. <body>
  33. <div class="cont">
  34. <form action="" method="post" enctype="multipart/form-data">
  35. <input class="input-text" type="text" name="title" value="<?PHP print $title ; ?>" />
  36. <input class="input-text" type="text" name="seo" value="<?PHP print $seo ; ?>" />
  37. <input class="upload-img" type="file" name="imgupload" >
  38. <input class="submit-btn" type="submit" name="update" value="UPDATE BANNER" />
  39. </form>
  40. <p style="color:#FFF; clear:both; font-size:14px; margin-top:80px; line-height:0;">Current Image :</p><img src="../images/<?PHP print $img_final ; ?>" width="256" height="110" alt="" style="background:#FFF; padding:2px; margin:0;">
  41. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement