Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. function LoadItemX(){
  2.  
  3. echo '<form action="mypage.php" method="POST" class="formX" id="searchh">
  4. <div class="Dleft">Nome Oggetto</div><div class="Dright">
  5. <select name="oggetto" id="seee">';
  6.  
  7.  
  8. $urlX = 'data.json';
  9. $request = wp_remote_get( $urlX );
  10. $body = wp_remote_retrieve_body( $request );
  11. $data2 = json_decode($body, true);
  12. for ($j=2;$j<count($data2);$j++){
  13. echo '<option value="'.$data2[$j]['NomeOggetto'].'">'.$data2[$j]['NomeOggetto'].'</option>';
  14. }
  15.  
  16.  
  17. echo '</select></div>
  18. <input type="submit" name="search" Value="Trova" class="subinvia">
  19. </form>';
  20.  
  21. }//end [LoadItemXX]
  22.  
  23. add_shortcode( 'LoadItemXX', 'LoadItemX' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement