Guest User

Untitled

a guest
May 27th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. Kodi HTML
  2. -------------
  3. <form id="FormViewForm" method="post" action="" accept-charset="utf-8">
  4. <div><input name="data[Form][first_name]" type="text" id="FormFirstName" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Your Name':this.value;" value="Your Name" /></div>
  5.  
  6.  
  7. <div><input name="data[Form][e-mail]" type="text" id="FormE-mail" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Your e-Mail':this.value;" value="Your e-Mail" /></div>
  8. <div class="submit"><input type="submit" value="Regjistrohu" /></div></form>
  9.  
  10.  
  11. Kodi PHP
  12. ------------------
  13. if (!isset($_POST['submit'])) {
  14. echo "<b style=\"color:red;\">Ky teksti du te hupet kur ta shtajpe butonin submit</b>";
  15. }
  16. else {
  17. echo "Disabled";
  18. }
  19.  
  20. if(isset($_POST["data"]["Form"])){
  21. require_once 'api/NewsletterMailerAPI.php';
  22. $nlapi = new NewsletterMailerAPI("www", "dddd");
  23. $data=$_POST["data"]["Form"];
  24. //categories ids
  25. $data["Category"] = array(9);
  26. if (!$nlapi->checkSubscriber($data["e-mail"])) {
  27. $return = $nlapi->addSubscriber($data);
  28. if ($return["status"] == "ok") {
  29. echo "<b style=\"color:red;\">e-Mail i shtua</b>";
  30. } else {
  31. echo "" . $return["msg"];
  32. }
  33. }else{
  34. echo "<b style=\"color:red;\">e-Mail egziston</b>";
  35. }
  36. }
Add Comment
Please, Sign In to add comment