http-post

How to POST form data from within a table to PHP

ぃ、小莉子 提交于 2019-12-13 02:07:21
问题 I currently have a Timesheet form I am creating for the employees at my work and I am stuck at getting the input values to post correctly. I have a database set up but right now, I can't even get the values to show in a .php page. Here is a sample from my current table: <html> <form method="POST" form action="result.php"> <table> <tr><td><b>Day of Week</td><td><b>Week 1 Hours</td><td><b>Week 2 Hours</td> <td> <tr><td>Monday</td><td> <input type="text" name="Monday" size="3" maxlength="4"

Codeigniter csrf token not in post array

∥☆過路亽.° 提交于 2019-12-13 01:28:56
问题 When posting a form with a csrf token, $this->input->post("csrf_token") is empty. I could post a duplicate csrf_token using another field name. But that looks a bit unnecessary. Is there (another) way to get it? __ All is done using AJAX. So first of all, a token must be requested, and is provided using a json template, populating it this way: $data["json"] = array( "csrf_token" => $this->security->get_csrf_hash() ); Using that token, a ajax POST request is done, sending user login, password.

Validate fields on html page with php

ε祈祈猫儿з 提交于 2019-12-13 01:17:38
问题 Please find code of index.html and submit.php file. With the help of loopo, both are working perfect. I am struggling where excatly to put the validation code (in index.html file or submit.php file). i am using html5 input types in html file and I dont know where exactly the validation has to happen in submit.php file. I have multiple forms and I made validations.php as suggested. I am also not understanding where will the error messages been shown? Can you suggest a location in the submit

Java vs C# HTTP request with JSON data

蓝咒 提交于 2019-12-13 00:49:39
问题 Im trying to convert Java program to C#. This programe sent JSON object to server using a HTTP POST. Java program works fine. return 200. But C# program return 400 (bad request). What can be the cause Java Code String base_url = "https://test-url.com"; String username = "test-user"; String password = "test-pass"; String client_id = "test-client"; String client_secret = "test-key"; String loginUrl = base_url + "session/login"; Charset utf8 = Charset.forName("UTF-8"); ContentType jason_content

Acquiring absolute image file path using iOS Swift

余生长醉 提交于 2019-12-13 00:35:05
问题 Does anyone know how to acquire the absolute path from an image using iOS Swift? I am trying to send the file path in a HTTP post request. I have tried the code below but it takes too long to process. I am trying to send the file path of an image to a PostgreSQL database. Any tips are greatly appreciated. Thank you! var paths: NSArray = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) var documentDirectory: NSString = paths.objectAtIndex(0) as NSString var

QPX Express API is returning 400 parse error

天大地大妈咪最大 提交于 2019-12-13 00:24:31
问题 I'd like to consume data from the Google QPX Express API and I'm trying to setting up a very basic request. On the demopage [1] I copied the generated JSON which looks as follows: { "request": { "slice": [ { "origin": "ZRH", "destination": "DUS", "date": "2014-12-02" } ], "passengers": { "adultCount": 1, "infantInLapCount": 0, "infantInSeatCount": 0, "childCount": 0, "seniorCount": 0 }, "solutions": 20, "refundable": false } } According to the Online Manual [2] a basic request has the

IOS > Open URL in Safari with POST

元气小坏坏 提交于 2019-12-12 22:13:33
问题 I'd like to launch a URL in Safari from UIView sending POST datas. This would allow me to load my Paypal page. Normally, in HTML we have to do this : <form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="text-align:center;" target="_blank"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="XXXXXXXXXXX"> <input type="submit" value="Faire un don" id="donpaypal"> </form> I know that I can open a new URL with this few lines

How to send image as base64 string in JSON using HTTP POST in Android?

老子叫甜甜 提交于 2019-12-12 22:10:46
问题 I need to send the json request to server using HttpPost. Here is my current code : public static String makeRequest(String uri, String json) { HttpURLConnection urlConnection; String data = json; String result = null; try { //Connect urlConnection = (HttpURLConnection) ((new URL(uri).openConnection())); urlConnection.setDoOutput(true); urlConnection.setRequestProperty("Content-Type", "application/json"); urlConnection.setRequestProperty("Accept", "application/json"); urlConnection

config CORS in Gorilla Mux: 403 error on POST request

独自空忆成欢 提交于 2019-12-12 20:42:13
问题 I have an API, currently am trying to consume one of its endpoints. The endpoint is for POST requests, the endpoint is working as expected. The API is running in the cloud, I tested it with curl and it was perfect, then from my react app I was trying to consume it but I get 403 status code . Watching in the console of the browser I see that I get that error on a OPTIONS request, and the POST never get done. Here is a screenshot of the result displayed in the console: Then, I made a simple

Uploading image with other parameters in SWIFT

穿精又带淫゛_ 提交于 2019-12-12 20:38:33
问题 I want to upload image to server with other parameters using SWIFT and the server side script is in PHP. I'm posting the request to http://www.23look.com/merchant/verify which accepts following parameters: mer_name - String mer_tel - String mer_address - string lng - string lat - string mer_licence - file type token - string mer_type - string Whenever I make HTTP post request, it always returns 0 value in response, which means "System Error". Maybe there's something wrong I'm doing, can