Advertisement
Guest User

uploader

a guest
Jul 23rd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.33 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title> Uploader Jodel </title>
  4. <style>
  5. input[type=text] {
  6.     padding:5px;
  7.     border:2px solid #ccc;
  8.     -webkit-border-radius: 5px;
  9.     border-radius: 5px;
  10. }
  11.  
  12. input[type=text]:focus {
  13.     border-color:#333;
  14. }
  15.  
  16. input[type=submit] {
  17.     padding:5px 15px;
  18.     background:#ccc;
  19.     border:0 none;
  20.     cursor:pointer;
  21.     -webkit-border-radius: 5px;
  22.     border-radius: 5px;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <center>
  28. <form method="POST" action="">
  29. <font color="blue">City : </font><input name="city" type="text"><br>
  30. <br><br>
  31. <input type="submit" name="upload" value="Upload">
  32. </form>
  33. <?
  34. if($_POST['upload']){
  35. ///////////////////////////////////////////////////////////////////////////////////////////
  36. $uuid = "21321786-db46d573-9cf39077-d4e5-4987-b475-bd62a47258d3"; # Your UUID
  37. ///////////////////////////////////////////////////////////////////////////////////////////
  38. # Setup
  39. $city = $_POST['city'];=
  40. $encoded_data = base64_encode(file_get_contents('zzzz.jpg'));
  41. echo $encoded_data ;
  42. $co = file_get_contents("http://maps.google.com/maps/api/geocode/json?sensor=false&address=$city");
  43. $startlat = explode('"lat" : ' , $co );
  44. $endlat = explode(',' , $startlat[1] );
  45. $lat = $endlat[0];
  46. $startlng = explode('"lng" : ' , $co );
  47. $endlng = explode(' }' , $startlng[1] );
  48. $lng = $endlng[0];
  49. echo "LAT: $lat<br><br>LNG: $lng";
  50. $postdata ='{"color":"9EC41C","image":"'.$encoded_data.'","location":{"city":"'.$city.'","loc_coordinates":{"lat":'.$lat.',"lng":'.$lng.'},"country":"SA","name":"'.$city.'","loc_accuracy":0.0},"message":"","has_drawing":false,"has_hashtag":false,"mention":false,"to_home":false}';
  51. ///////////////////////////////////////////////////////////////////////////////////////////////
  52. $request = curl_init();
  53. curl_setopt($request, CURLOPT_URL, "https://api.go-tellm.com/api/v3/posts/");
  54. curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
  55. curl_setopt($request, CURLOPT_FOLLOWLOCATION, 1);
  56. curl_setopt($request, CURLOPT_HTTPHEADER, array(
  57.     "Authorization: Bearer $uuid",
  58.     'X-Client-Type: android_4.53.1',
  59.     'X-Api-Version: 0.2',
  60.     'Content-Type: application/json; charset=UTF-8',
  61.     'Connection: Keep-Alive'
  62.     ));
  63. curl_setopt($request, CURLOPT_POSTFIELDS, $postdata);
  64. echo $response = curl_exec($request);
  65. }
  66. else
  67. {
  68.     echo "<font color='green'>Welcome :)</font>";
  69. }
  70. ?>
  71. </body>
  72. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement