get

How can I add GET variables to the end of the current page url using a form with php?

ε祈祈猫儿з 提交于 2019-12-02 03:59:54
问题 I have some database information that is being shown on a page. I am using a pagination class that uses the $_GET['page'] variable in the url. When you click on a different pagination anchor tag, it changes $_GET['page'] to a new number in the url and shows the corresponding results. I have sort and search features which uses the $_GET['searchby'] and $_GET['search_input'] variables. The user enters their search criteria on a form that is using GET. The variables are then put into the url

mod_rewrite remove a GET variable

偶尔善良 提交于 2019-12-02 03:54:49
问题 I'm trying to take example.com/home?lang=fr&foo=bar and redirect to example.com/fr/home?foo=bar I tried RewriteCond %{QUERY_STRING} lang=([a-z]{2})&? RewriteRule ^(.*) /%1/$1 [R=307] but I get a redirect loop. This is because the lang=fr is not taken away from the query string after 'fr' is moved to the front of the request string. This results in: example.com/fr/fr/fr/fr/fr/fr/fr/fr/fr/.... I can use RewriteRule ^(.*) /%1/$1? [R=307] but that also removes the foo=bar from the query string

Linkedin OAuth2 authorization code error

给你一囗甜甜゛ 提交于 2019-12-02 03:36:22
问题 I´m trying to connect via Linkedin Auth2 from a java web application: Added my own app in linkedin. Generate the authorization URL: https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=XXX&scope=r_basicprofile%20r_fullprofile%20r_emailaddress&state=DCEEFWF454Us5dffef424&redirect_uri=http://localhost:9090/springmvc/token.htm Introduce my login/password for linkedin in the new popup. Get back successful the request on the redirect_uri previus, and take the

not getting integer value from SharedPreference

懵懂的女人 提交于 2019-12-02 03:30:58
I am trying to store user id in SharedPreference in one activity and want to get this integer id in any activity. To put this value in Shared Preference i use following code. SharedPreferences myPrefs = getSharedPreferences("myPrefs", MODE_WORLD_READABLE); SharedPreferences.Editor prefsEditor = myPrefs.edit(); prefsEditor.putInt("userId", varaible); prefsEditor.commit(); Then i am trying to get this value, i use following code for this SharedPreferences myPrefs = getSharedPreferences("myPrefs", MODE_WORLD_READABLE); int userId = myPrefs.getInt("userId", -1); But it return me -1 not userId. and

Facebook FQL Query with Ruby

跟風遠走 提交于 2019-12-02 03:27:28
问题 I'm trying to do a simple GET with ruby to the Facebook fql.query method without success. The url is basically structured like this: https://api.facebook.com/method/fql.query?query=SELECT total_count FROM link_stat WHERE url = "http://twitter.com/"&format=json I've read in a few posts here on StackOverflow about how to make those requests, but even tho I keep getting: /usr/lib/ruby/1.8/net/http.rb:560:in `initialize': getaddrinfo: Name or service not known (SocketError) On the first line of

Example of POST request in Android studio

感情迁移 提交于 2019-12-02 03:17:36
I just started learning android few days ago and I have a problem with uploading my JSON data to server. I manage to retrieve it via following code: Edit: I did manage to retrieve files using external OKHTTP library but I would like to do this without using external libraries. package cc.demorest; import android.os.AsyncTask; import android.renderscript.ScriptGroup; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.EditText; import android.widget.TextView; import org.json.JSONArray; import org.json.JSONException; import

Environments in R, mapply and get

﹥>﹥吖頭↗ 提交于 2019-12-02 02:57:08
Let x<-2 in the global env: x <-2 x [1] 2 Let a be a function that defines another x locally and uses get : a<-function(){ x<-1 get("x") } This function correctly gets x from the local enviroment: a() [1] 1 Now let's define a function b as below, that uses mapply with get : b<-function(){ x<-1 mapply(get,"x") } If I call b , it seems that mapply makes get not search the function environment first. Instead, it tries to get x directly form the global enviroment, and if x is not defined in the global env, it gives an error message: b() x 2 rm(x) b() Error in (function (x, pos = -1L, envir = as

transform data frame string variable names

て烟熏妆下的殇ゞ 提交于 2019-12-02 02:49:45
I have a data frame that contains dates and id's. I need to add multiple columns to this data frame based on each date. I use ddply to do this as follows: ddply(df, "dt", transform, new_column1 = myfun(column_name_1)) However,I have a bunch of column names and would like to add multiple new columns. Is there a way that I can pass a string to transform instead of new_column1? For example I tried: ddply(df, "dt", transform, get("some_column_name")=myfun(column_name_1)) but this does not work. Additionally, if I pass the column_name_1 to myfun as a string, can I just use get("column_name_1")

Facebook FQL Query with Ruby

旧时模样 提交于 2019-12-02 02:39:46
I'm trying to do a simple GET with ruby to the Facebook fql.query method without success. The url is basically structured like this: https://api.facebook.com/method/fql.query?query=SELECT total_count FROM link_stat WHERE url = "http://twitter.com/"&format=json I've read in a few posts here on StackOverflow about how to make those requests, but even tho I keep getting: /usr/lib/ruby/1.8/net/http.rb:560:in `initialize': getaddrinfo: Name or service not known (SocketError) On the first line of http_get function. def http_get(domain,path,params) return Net::HTTP.get(domain, "#{path}?".concat

mod_rewrite remove a GET variable

≯℡__Kan透↙ 提交于 2019-12-02 02:26:55
I'm trying to take example.com/home?lang=fr&foo=bar and redirect to example.com/fr/home?foo=bar I tried RewriteCond %{QUERY_STRING} lang=([a-z]{2})&? RewriteRule ^(.*) /%1/$1 [R=307] but I get a redirect loop. This is because the lang=fr is not taken away from the query string after 'fr' is moved to the front of the request string. This results in: example.com/fr/fr/fr/fr/fr/fr/fr/fr/fr/.... I can use RewriteRule ^(.*) /%1/$1? [R=307] but that also removes the foo=bar from the query string which I want to keep intact I cannot find a way of removing just one variable from the query string. I'm