get

Passing $_GET parameters to cron job

浪子不回头ぞ 提交于 2019-11-28 06:45:36
I am new at cron jobs and am not sure whether this would would work. For security purposes I thought about making a one page script that looks for certain GET values (a username, a password, and a security code) to make sure that only the computer and someone that knows all 3 can run the command. I made the script and it works running it in a browser but is it possible to run the cron job with GET values? a example would be me running * 3 * * * /path_to_script/cronjob.php?username=test&password=test&code=1234 Is this possible? RobB The $_GET[] & $_POST[] associative arrays are only initialized

How can I use GET forms with CodeIgniter?

梦想与她 提交于 2019-11-28 05:40:38
问题 I understand that CI is mostly URL segment based, but I want to have a query string: blahblah.com/search.html?q=keyword When I try $this->input->get( "q" ), it returns empty. Is there a route or something I need to configure? 回答1: The best way to get query strings working in CodeIgniter is to use Google. This question is asked (and answered) on the forums, here and on twitter at least 10 times a day. There are a few methods, but recently I am a fan of the following method: http://www.dijexi

Executing javascript in java - Opening a URL and getting links

我是研究僧i 提交于 2019-11-28 05:16:35
问题 import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import java.io.FileReader; public class Main { public static void main(String[] args) { ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("js"); try { FileReader reader = new FileReader("C:/yourfile.js"); engine.put("urlfromjava", "http://www.something.com/?asvb"); engine.eval(reader); reader.close(); } catch (Exception e) { e.printStackTrace(); } } } Right now, the

Error with jQuery get of a CSV file

Deadly 提交于 2019-11-28 05:14:52
问题 Here is my relevant jQuery code: $.get('sampleData.csv', function(data) { var lines = data.split('\r\n'); The first few line of the sampleData.csv file look like this: 2009,0,2,29.0000 2009,0,6,655.6200 I get 2 errors. On the first line of csv file I get the error syntax error On the 2nd line of code I get the error data.split is not a function What am I doing wrong? ETA According to the firebug console, the responseText is the following: 2009,0,2,29.0000\r\n2009,...\r\n2011,10,30,494.3500\r

python dict: get vs setdefault

落花浮王杯 提交于 2019-11-28 05:14:35
The following two expressions seem equivalent to me. Which one is preferable? data = [('a', 1), ('b', 1), ('b', 2)] d1 = {} d2 = {} for key, val in data: # variant 1) d1[key] = d1.get(key, []) + [val] # variant 2) d2.setdefault(key, []).append(val) The results are the same but which version is better or rather more pythonic? Personally I find version 2 harder to understand, as to me setdefault is very tricky to grasp. If I understand correctly, it looks for the value of "key" in the dictionary, if not available, enters "[]" into the dict, returns a reference to either the value or "[]" and

HttpURLConnection GET request getting 400 Bad Request

℡╲_俬逩灬. 提交于 2019-11-28 05:10:48
问题 I am trying to do a GET request with some parameters in Java using HttpURLConnection. Everytime I do this however, I get a 400: Bad Request each time. What do I need to change to make it work? String url = "http://www.awebsite.com/apath?p1=v1&p2=v2&p3=v3"; HttpURLConnection conn = (HttpURLConnection)new URL(url).openConnection(); conn.setDoInput(true); conn.setDoOutput(false); conn.setUseCaches(false); conn.setRequestMethod("GET"); conn.setRequestProperty("Host", "www.awebsite.com"); conn

Http Requests POST vs GET

痴心易碎 提交于 2019-11-28 05:10:11
问题 I am using a lot of HTTP Requests in an application that I am writing which uses OAuth. Currently, I am sending my GET and POST requests the same way: HttpConnection connection = (HttpConnection) Connector.open(url + connectionParameters); connection.setRequestMethod(method); connection.setRequestProperty("WWW-Authenticate", "OAuth realm=api.netflix.com"); int responseCode = connection.getResponseCode(); And this is working fine. I am successfully POSTing and GETing. However, I am worried

How to make an HTTP GET request manually with netcat?

*爱你&永不变心* 提交于 2019-11-28 04:57:10
So, I have to retrieve temperature from any one of the cities from http://www.rssweather.com/dir/Asia/India . Let's assume I want to retrieve of Kanpur's. How to make an HTTP GET request with Netcat? I'm doing something like this. nc -v rssweather.com 80 GET http://www.rssweather.com/wx/in/kanpur/wx.php HTTP/1.1 I don't know exactly if I'm even in the right direction or not. I am not able to find any good tutorials on how to make an HTTP get request with netcat, so I'm posting it on here. Of course you could dig in standards searched for google, but actually if you want to get only a single

GET request for redirect initiated by browser but not successful

风流意气都作罢 提交于 2019-11-28 04:37:49
问题 While trying to redirect user to a URL, it works with GET requests but not with postback requests. Through firebug's Network window, I can see the redirect response received by browser after the postback request (that should cause redirect) completes. The browser seemingly initiates a GET request for the redirect URL but doesn't actually successfully redirect. It remains there on the same page. I use JSF server side. The initiated GET request is not received at all by the server. However

After HTTP GET request, the resulting string is cut-off - content has been consumed

拈花ヽ惹草 提交于 2019-11-28 04:35:30
问题 I'm making a http get request like this: try { HttpClient client = new DefaultHttpClient(); String getURL = "http://busspur02.aseag.de/bs.exe?SID=5FC39&ScreenX=1440&ScreenY=900&CMD=CR&Karten=true&DatumT="+day+"&DatumM="+month+"&DatumJ="+year+"&ZeitH="+hour+"&ZeitM="+min+"&Intervall=60&Suchen=(S)uchen&GT0=Aachen&T0=H&HT0="+start_from+"&GT1=Aachen&T0=H&HT1="+destination+""; HttpGet get = new HttpGet(getURL); HttpResponse responseGet = client.execute(get); HttpEntity resEntityGet = responseGet