get

Forcing “Save As” dialog via jQuery GET

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 01:59:03
问题 I'm calling a jQuery "GET" on the test.php file code below. I'm trying to get the script to pop a "Save As" dialog on the resulting test.ini file to allow it to be saved locally. However, although I can echo the result back to the jQuery fine, I can't seem to pop the "save as" dialog. Update: Thanks to the solutions below, I just changed my $.get to a window.location.replace. $('#test').click( function() { //$.get('<?php echo get_bloginfo('template_directory') ?>/test.php'); window.location

PHP GET variable array injection

旧街凉风 提交于 2019-12-04 01:53:16
I've recently learned that it's possible to inject arrays into PHP GET variables to perform code execution? .php?a[]=asd&a[]=asdasd&b[]=$a That was the example I was given. I have no idea how it works and was wondering if this is even possible? PHP will parse the query string, and inject those values in the $_GET super-global array (same for $_POST if this was done in a form using POST, btw) . In your case, the $_GET array will contain this : array 'a' => array 0 => string 'asd' (length=3) 1 => string 'asdasd' (length=6) 'b' => array 0 => string '$a' (length=2) Each value passed in the query

Facebook Graph API Returning Empty Data Set

妖精的绣舞 提交于 2019-12-03 23:03:26
I am attempting to use the Graph API Explorer to create an access token for my application to view my pages using 'me/accounts'. However, every time I try this, it returns me an empty data set. I have chosen manage_pages as a permission and it still doesn't work. Without checking any other permissions, I am able to view 'me/likes', 'me/movies', etc.. I have no idea what I am doing wrong. This is what I'm doing: https://developers.facebook.com/tools/explorer/ Select my application from the drop-down menu. Click "Get Access Token" >> Check "manage_pages" >> Get Access Token Submit "GET /me

How to get the category title in a post in Wordpress?

馋奶兔 提交于 2019-12-03 22:25:32
Say I have a post called Hello World in Wordpress and I'm directly viewing this page, how would I go about finding the category of "Hello World" and displaying it? Use get_the_category() like this: <?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?> It returns a list because a post can have more than one category. The documentation also explains how to do this from outside the loop. You can use <?php the_category(', '); ?> which would output them in a comma separated list. You can also do the same for tags as well: <?php the_tags('<em>:</em>', ', ', ''); ?>

HTTP GET with request body RETROFIT

倾然丶 夕夏残阳落幕 提交于 2019-12-03 22:19:31
I am using Retrofit to make api calls in my android application. I have to submit a @Body of JSON @GET("api/") void getData(@Body UserPostRequestBody request) I get error message retrofit.RetrofitError: apiCall: Non-body HTTP method cannot contain @Body or @TypedOutput. Have you any idea? harshitpthk To send data along with your Get Request you can do the following: //sending data as a url parameter @GET("/group/{id}/users") List<User> groupList(@Path("id") int groupId); as said in this SO answer , Server semantics for GET, however, are restricted such that a body, if any, has no semantic

Prestashop Web Service API keeps asking for authentication

倖福魔咒の 提交于 2019-12-03 22:17:31
I am having this problem I enabled the webservice from prestashop and I can access it if I write the URL directly passing the parameter from post method http://underwearstudio.mx/pruebas/api?&ws_key= "mykey". But If I try to access without passing the ws_key as parameter it keeps asking me to authenticate. From what I read when authentication is prompted you need to use the API key as username and leave the blank password, but it just keeps prompting the authentication. What can I do? I was trying to follow this tutorial.( http://doc.prestashop.com/display/PS15/Chapter+2+-+Discovery+-+Testing

jquery polling with smart poll plugin

一个人想着一个人 提交于 2019-12-03 21:55:13
I'm trying for the life of me to get this plugin to work but I'm not understanding the status function so retry is not firing. $.poll(10000, function(retry){ $.get('willfail', function(response, status){ if (status == 'success') { // Do something alert("YES"); } else { alert("NO"); //retry(); } }) }) If I set the get request to '/' it will give me the alert YES message, but as it is, the alert No message never gets fired despite the ELSE. I'm using a jquery polling plugin: https://github.com/jeremyw/jquery-smart-poll Any ideas? That is probably a bad example. The callback passed to $.get will

Android + PHP: Sending a GET request to PHP server

若如初见. 提交于 2019-12-03 21:53:15
I'm trying to send a GET request from an Android app to a web server, so the server will store the information in a database. Here is the Android Application : public class Final extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_final); Button btnSend = (Button)findViewById(R.id.BtnSend); btnSend.setOnClickListener(new OnClickListener(){ public void onClick(View arg0){ TestReceiver(); } }); void TestReceiver() { //ALERT MESSAGE Toast.makeText(getBaseContext(),"Please wait, connecting to server.",Toast

java, get set methods

大憨熊 提交于 2019-12-03 21:17:16
This question has been asked before, but even after reading: Java "Get" and "Set" Methods Java Get/Set method returns null And more I still don't understand how to solve my problem. When accessing variables in a class using get methods from another class I receive the value null. How do I recieve my correct values instead of null? This is the class where I try to get my variables FROM (not everything included). public class RLS_character_panel extends javax.swing.JPanel implements ActionListener, ItemListener { private String name1 = "hello"; public String getName1() { return name1; } public

How to write Get method Nexus Rest Api?

流过昼夜 提交于 2019-12-03 20:43:22
I have groupId , artifactId and version . How do i write a GET request using Nexus Rest API in order to get further artifact description? Not sure what information you're looking for. The REST API doco is availble here: Core API Lucene API Examples Obtain the repository id You're starting with: groupId , artifactId , version : $ curl --silent 'http://repository.sonatype.org/service/local/lucene/search?g=log4j&a=log4j&v=1.2.16' | grep repositoryId <repositoryId>central-proxy</repositoryId> <repositoryId>apache-staging</repositoryId> <repositoryId>central-proxy</repositoryId> <repositoryId