get

php, jQuery, Lightbox, Ajax GET and POST issue

假如想象 提交于 2019-12-13 08:58:22
问题 I have a form in a lightbox (fancybox). I am trying to do an ajax get to run an update to the database. But I do not know why it does not work. The code below is what is in the lightbox: <div id="timezonelightbox"> <div class="lightboxtitle">Select Time Zone</div> <form method="get" action="" > <select name="timezones" id="timezones" class="selecttimezones"> <option value="Africa/Abidjan ">Africa/Abidjan </option> <option value="Africa/Accra ">Africa/Accra </option> <option value="Africa

Sessions and PHP classes

≯℡__Kan透↙ 提交于 2019-12-13 07:45:49
问题 I'm used to java, objective c and a little c++. Now i want to use PHP to create a website. I created several classes but to keep it simple: 3 classes. Account - DataMapper - DataManager This means that i can get an account from the database. In DataManager i keep track of all things. Like the userId of the user. The thing is, normally all setted variables stay 'set', but now i'm using php i apperently need to store them by using a session. DataManager: <? php class DataManager { // Hold an

Android Programming: HTTP GET REQUEST NOT WORKING

…衆ロ難τιáo~ 提交于 2019-12-13 07:42:44
问题 I require a GET reequest from my own server to be extracted from the web and then displayed on screen with a TextView. I have set up a GET Request. public class GetMethodEx { public String getInternetData() throws Exception{ BufferedReader in = null; String data = null; try { HttpClient client = new DefaultHttpClient(); URI website = new URI("http://www.mybringback.com"); HttpGet request = new HttpGet(); request.setURI(website); HttpResponse response = client.execute(request); in = new

How to get days and months number from a given days

这一生的挚爱 提交于 2019-12-13 06:46:13
问题 I'm going to write a function to print a number of days left between two dates. I would like it to tell the months and days left. For example: 45 days = 1month, 15 days 65 days = 2months, 5 days 10 days = 10 days So I tried: <? $days=50; if($days>"31"){ $time=$days/30; } echo $time;//1.67 month ?> According to the code above. I expect the result to be like: 1 month, 20 days Could you guys please suggest. 回答1: Try: $days = 50; if ($days > 31){ $month = floor($days/30); // return lowest whole

How to extract URL parameters on 404 Error in PHP

半腔热情 提交于 2019-12-13 06:36:03
问题 I have my htaccess redirecting to a error404.php but I want that PHP file to be able to extract the original url parameters. For example: http://mywebsite.com/unknownfile.php?param1=value1&param2=value2 I've tried $_GET['param1'] but that's empty. The $_SERVER['PHP_SELF'] just shows error404.php Many thanks in advance. 回答1: You can access original URL via $_SERVER["REQUEST_URI"] . For example: requesting URL /hihi/meow?key=rumba which does not exists. The $_SERVER["REQUEST_URI"] will have

$.get in a loop: why the function is performed after incrementing?

老子叫甜甜 提交于 2019-12-13 06:16:28
问题 I am a beginner in Javascript and I feel that there is something wrong with me about the $.get jQuery. Normally, you can assign it to a function that will execute after the data is retrieved correctly. But if I put my $.get in a loop, the loop continues to execute even if the data is not yet retrieved, and here is my problem. Here is my code (this is for GreaseMonkey): var1 = document.getElementsByClassName("some_class"); i = 0; while (i < var1.length) { url = var1[i].getElementsByTagName(

Sending an HTTP GET request xcode

可紊 提交于 2019-12-13 05:59:15
问题 I'm trying to send the content of a contact form to my webservice. My code is based on a StackOverFlow topic named : Sending get method in Xcode . I think i follow the rules but it still doesn't work. I don't want u to lose your time, but i'm starting to get mad. - (IBAction)send:(id)sender{ NSString *get = [[NSString alloc] initWithFormat:@"&Contact%%5BFirstName%%5D=%@+First&Contact%%5BLastName%%5D=%@+Last&Contact%%5BMail%%5D=%@&Contact%%5BPhone%%5D=%@&Contact%%5BMotivations%%5D=%@&Contact%

Java Get/Set method returns null

江枫思渺然 提交于 2019-12-13 05:58:20
问题 I want to get variable other class(jframe) but get method returns null.. But set method is running.. public class FrameGauges extends javax.swing.JFrame { Elm32x elma=null; private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) { FrameBaglanti a = new FrameBaglanti(); elma = a.GetElm(); System.out.println(elma); } } I added initialized case.. When I run getElm(), that returns null... What should i do ? public class FrameBaglanti extends javax.swing.JFrame { Elm32x elm;

How do I turn a POSTed JSON value into PHP?

可紊 提交于 2019-12-13 05:36:27
问题 As a test, this JSON data is being POSTed to my website: { "order": { "id": null, "created_at": null, "status": "new", "total_btc": { "cents": 100000000, "currency_iso": "BTC" }, "total_native": { "cents": 2263, "currency_iso": "USD" }, "custom": "123456789", "button": { "type": "buy_now", "name": "Test Item", "description": null, "id": null }, "transaction": { "hash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", "confirmations": 0 } } } Since it is being sent server-to

AS3 - How do you receive parameters in a swf from a GET request?

孤者浪人 提交于 2019-12-13 05:19:27
问题 I tried using var params: Object = ((this.stage.loaderInfo) as LoaderInfo).parameters; to get the parameters, but it returns an Object with no properties. That LoaderInfo will give me the correct URL without the parameters though if I use LoaderInfo.url. I'm using the request: http://localhost/foo.swf?start=foobar. params.hasOwnProperty("start") returns nothing, and using a for loop shows that "params" has no properties. How do I receive the start/foobar pair in my code? I would much prefer