Guest User

Untitled

a guest
Feb 23rd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: ICO New Page
  4. */
  5. get_header(); ?>
  6. <?php
  7. require_once('/../../../../wp-config.php');
  8. extract($_POST);
  9. if ( isset( $_POST['submit'] ) ){
  10.  
  11. $file = addslashes(file_get_contents($_FILES["logo"]["tmp_name"])); //image name
  12.  
  13.  
  14. $result=$wpdb->query("INSERT INTO ico_calendar (token_id, coin_name,logo,type,coin,start_date,end_date,description,link,comments) VALUES ('$token_id', '$coin_name','$file','$type','$coin','$start_date','$end_date','$description','$link','$comments')" );
  15.  
  16. if($result)
  17. {
  18. echo " Data inserted Successfully";
  19. }else
  20. {
  21. echo "Data insertion failed";
  22. }
  23. }
  24.  
  25.  
  26.  
  27.  
  28. ?>
  29. <div class="iump-register-form ihc-register-7">
  30. <form action="" id="ico" method="post" enctype="multipart/form-data">
  31.  
  32. <label for="token_id">Token ID:</label>
  33. <input type="text" name="token_id" id="token_id" value=""/>
  34. <label for="coin_name">Coin Name:</label>
  35. <input type="text" name="coin_name" id="coin_name" value="" />
  36. <label for="logo">Logo:</label>
  37. <input type="file" name="logo" id="logo" value="" />
  38. <label for="type">Type:</label>
  39. <input type="text" name="type" id="type" value="" />
  40. <label for="coin">Coin:</label>
  41. <input type="text" name="coin" id="coin" value="" />
  42. <label for="start_date">Start Date:</label>
  43. <input type="date" name="start_date" id="start_date" value="" />
  44. <label for="end_date">End Date:</label>
  45. <input type="date" name="end_date" id="end_date" value="" />
  46. <label for="description">Description:</label>
  47. <input type="text" name="description" id="description" value="" />
  48. <label for="link">Link:</label>
  49. <input type="text" name="link" id="link" value="" />
  50. <label for="comments">Comments:</label>
  51. <input type="textarea" name="comments" id="comments" value="" />
  52. <button type="submit" name="submit">Submit</button>
  53.  
  54.  
  55. </form>
  56. </div>
  57.  
  58. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment