Guest User

Untitled

a guest
Feb 14th, 2016
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. global $current_user;
  3. get_currentuserinfo();
  4. $cur_user_username = $current_user->user_login;
  5. //echo $cur_user_username;
  6. $social_cpt_set_username = get_field('twibox_user_username');
  7. //echo $social_cpt_set_username;
  8. if ($tweet_box != 'No' && is_user_logged_in() && $cur_user_username == $social_cpt_set_username) {
  9. //Here I am checking for the social sharing page for the company based on the name set in the custom field.
  10. $return_survey_url = get_field('survey_url');
  11. //echo $return_survey_url;
  12. echo '<input type="hidden" value="'.$return_survey_url.'" id="return_url">';
  13. echo '<form style= "width: 50%; margin: 0 auto; " action="http://www.example.com/test.php" onsubmit="return test();" method="post" target="votar">';
  14. echo '<textarea name="somename" rows="8" cols="10" maxlength="130"></textarea>';
  15. echo '<input type="submit" value="test"/>';
  16. echo '<iframe name="votar" style="display:block; width: 500px; height: 500px;"></iframe>'; //showed Iframe to see API output, otherwise would be display:none
  17. echo '</form>';
  18. }else{?>
  19. //Doing something else here
  20. <?php } ?>
  21.  
  22. <script type="text/javascript">
  23.      function test() {
  24.        alert('thank you');
  25.         var return_url = document.getElementById('return_url').value;
  26.         window.location.href= return_url;
  27.  
  28.     }
  29.  </script>
  30. <?php get_footer(); ?>
RAW Paste Data