get

Using php and POST on a form, but request_method says it is a GET

我是研究僧i 提交于 2020-01-02 05:15:25
问题 So I have this form that I am submitting to a php script that echos $_SERVER['REQUEST_METHOD']. I do not know why, but even though I specify the POST method in the form, it always echoes GET. Why is this? What am I doing wrong? <form action="location.php" method="POST"> <table> <tr> <td>name</td> <td><input type="text" name="name"></td> </tr> <tr> <td>address</td> <td><input type="text" name="address"></td> </tr> <tr> <td>lat</td> <td><input type="text" name="lat"></td> </tr> <tr> <td>lng</td

Using php and POST on a form, but request_method says it is a GET

徘徊边缘 提交于 2020-01-02 05:15:12
问题 So I have this form that I am submitting to a php script that echos $_SERVER['REQUEST_METHOD']. I do not know why, but even though I specify the POST method in the form, it always echoes GET. Why is this? What am I doing wrong? <form action="location.php" method="POST"> <table> <tr> <td>name</td> <td><input type="text" name="name"></td> </tr> <tr> <td>address</td> <td><input type="text" name="address"></td> </tr> <tr> <td>lat</td> <td><input type="text" name="lat"></td> </tr> <tr> <td>lng</td

__get is not called if __set is not called, however code works?

守給你的承諾、 提交于 2020-01-02 04:01:26
问题 Here is my code: <?php class SampleClass { public function __get($name){ echo "get called"; echo $name; } public function __set($name, $value) { echo "set called"; } } ?> And my index file: $object = new SampleClass(); $object->color = "black"; echo $object->color; If I run this code as it is, here is the output: set calledget calledcolor However if I comment out public function __set($name, $value) { echo "set called"; } the part above (only this part), then the output will be: black So what

Can I put both Get and Post URL link in an email

丶灬走出姿态 提交于 2020-01-02 02:54:06
问题 I am building a new web application, and the boss had expressed a preference to have an email sent when something changes, and he wants to be able to click on a link in the email to approve or deny the changes (singly or en masse). My question: Is it possible to put a POST request in an email, and if so, how? We run exchange internally, and with some work the emails could stay entirely within that, but the normal course of events would send the emails into the wide blue yonder. My bonus

Get size of Bitmap Android [duplicate]

亡梦爱人 提交于 2020-01-02 01:03:23
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Bitmap byte-size after decoding? Is there anyway so I can get the size of this Bitmap?I've tried to use getByteCount() but I can't use it? Bitmap bitmap = BitmapFactory.decodeByteArray(decryptedData , 0, decryptedData .length); //decoding bytearrayoutputstream to bitmap Any suggestions? 回答1: As you can see from the API, you can use getWidth() getHeight() for the size of the Bitmap in pixels. And if it is an

django-rest-framework: independent GET and PUT in same URL but different generics view

て烟熏妆下的殇ゞ 提交于 2020-01-02 00:57:11
问题 I'm using django-rest-framework and I need to map in the URL file two generic views with the same url (iḿ already using URLs but not Routes): I need to allow GET, PUT and DELETE verbs in just one url (like /api/places/222) and allow everyone to get every field with the related Entity Place but just allow to update (PUT) one field using the same url. Place Entity: - id (not required in PUT) - name (required always) - date (not required in PUT but required in POST) URL url(r'^api/places/(?P<pk>

How to send multiple variable using xmlhttp.open?

寵の児 提交于 2020-01-01 21:51:47
问题 Ok i have this piece of code from which i took from W3schools:- <html> <head> <script type="text/javascript"> function showCustomer(str) { var xmlhttp; if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status=

How to programmatically add self signed certificate for making a HTTPS request from java code?

风格不统一 提交于 2020-01-01 16:58:10
问题 Following code snippet is to get JSon response from a HTTP URL: private static void getJson(String location) { try { try { createSSLSocket(); URL url = new URL( "https://abc.com/key/one"); HttpURLConnection conn = (HttpURLConnection) url .openConnection(); conn.setRequestMethod("GET"); conn.setRequestProperty("Accept", "application/json"); if (conn.getResponseCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); } BufferedReader br = new

Component returned failure code: 0x805e0006 error

随声附和 提交于 2020-01-01 16:53:32
问题 The following JQuery get call: var doc_root = document.location.hostname + ":8082"; var fw_script = doc_root + "/sites/MyScripts/fw2.php"; var langpref = "EN"; var ttype = "BEGIN"; var vvalue = $("#inp_begin").val(); $.get(fw_script, { type: ttype, value: vvalue, langpref: langpref }) .success(function(result) { $(fw_result).text(result); alert("Success"); }) .error(function(jqXHR, textStatus, errorThrown) { $(fw_result).text("Error: " + textStatus + " " + errorThrown); alert("Failure"); });

PHP: Shorter/obscured encoding for a URL embedded in another URL?

我们两清 提交于 2020-01-01 10:04:06
问题 I'm writing myself a script which basically lets me send a URL and two integer dimensions in the querystring of a single get request. I'm using base64 to encode it, but its pretty damn long and I'm concerned the URL may get too big. Does anyone know an alternative, shorter method of doing this? It needs to be decode-able when received in a get request, so md5/sha1 are not possible. Thanks for your time. Edit : Sorry - I should have explained better: Ok, on our site we display screenshots of