post

Creating an installer script

Hi all, I'm trying to create an installer, using a combination of fwrite and forms. Here's my code: <?php $myFile = "db_config.php"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, "$host = " . $_POST['host'] . ";\n $username = " . $_POST['username'] . ";\n $password = " . $_POST['password'] . ";\n $name = " . $_POS...

HTTP POST in javascript in Firefox Extension

Hi there, I'm a newbie trying to do a simple HTTP post in JS within a Firefox extension.. This isn't passing through the parameters: var params = "a=1&b=2&c=3" req.open('POST', 'http://www.mywebsite.com/'); req.send(params); Any ideas on what I'm doing wrong? Thanks. ...

POST Headers being sent, but not recieved on server

In C#, I am working on a project to automatically update a separate server with an image and other form data and such... However, the PHP server isn't getting any of the POST data, it's only getting the headers and I can't figure out why. Here is what I am sending to the server (all new lines have CRLF): POST /new_reply/1 HTTP/1.1 Host...

How to send multiple files with post request? (objective-c, iOS)

Hi, I want to sent post request, but i need to send multiple files, how to do this? tnx ...

jQuery - Ajax returning error 500 on some posts.

I have some Ajax that has been working on a live site, now it has stopped working. The Ajax should be returning a page but is returning a 500 error (internal server error). The strange thing is I can navigate and post to the page the Ajax is calling, so the page is only not working via an Ajax call ($.post). Another strange thing is it...

Post an array in input elements using jquery

Hi Basically I've got textboxes called dimension[0][scale], dimension[0]width etc. How do i pass the the elements 'dimension' as an array? I've tried $('input[name=dimension]').serialize() and doesnt seem to work. ...

Django modify POST and pass on to next view

In my Django webapp, I have a user submit data to Form1.html. The data is passed onto Form2.html where they submit more data. After they submit Form2 they are taken to Done.html. Form1 >> Form2 >> Done The problem is I need the data from Form1 in From2 and in the Done view. Getting the data from Form1 to the Form2 view is no problem, j...

what's the different between $.ajax(...type: "POST", dataType: "JSON"...) and $.post(..., "JSON")

I can get the return json string parse with $.post(), but not $.ajax(). {"result": "success", "id": "1"} ...

PHP: check if any posted vars are empty - form: all fields required

Is there a simpler function to something like this: if (isset($_POST['Submit'])) { if ($_POST['login'] == "" || $_POST['password'] == "" || $_POST['confirm'] == "" || $_POST['name'] == "" || $_POST['phone'] == "" || $_POST['email'] == "") { echo "error: all fields are required"; } else { echo "proceed..."; } ...

How to make Wordpress show only one post on the front page with comments, and comment form?

I did the following to display a single post in my home page: home.php: <?php get_header(); query_posts('posts_per_page=1'); //returns only the front page ?> <div id="content"> <?php /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-index.php and th...

how to pass array variables based on condition to php using post method

I have an array: $k[23]='something'; $k[44]='something more'; If a user enters 2,3 and presses 'go' in a virtual 10 digit keypad (will look like a calculator), I need to pass 'something' to browse.php. If the user press 4,4 and press go, then i have to pass 'something more' to browse.php. Any ideas? I am new to javascript/php ...

Apache2 and CGI - how to keep Apache from buffering the POST data?

I'm trying to provide live parsing of a file upload in CGI and show the data on screen as it's being uploaded. However, Apache2 seems to want to wait for the full POST to complete before sending the CGI application anything at all. How can I force Apache2 to stop buffering the POST to my CGI application? EDIT It appears that it's act...

ASP.NET submit post request with keys from code behind

I am working on a page where we have a form that the user is filling some information in. When the form is submitted I want to process the information and then redirect to an external server. The catch is that I need post data to go to the external server so a redirect will not work. Is there a way to programmatically submit a form requ...

passing php variable

I have a PHP array: foreach($xpath->query('//a') as $element) { $linklabel[] = $element->textContent; $link[] = $element->getAttribute("href"); $i=$i+1; } I also have an HTML form: <form name="keypad" id="form" onSubmit="return pass(this)"> <input type="text" size="100%" length="25" value="" name="lcd"> <input type="b...

Jquery POST with same request not work

i have next problem $("#btnsave").click(function(){ $.post('svld.php',{'fnd':$('#fnd').attr("value")},function(data){ alert(data); },'json'); } slvd.php header('Content-type: application/json'); var_dump(json_encode($_POST)); in request i see next fnd http://ya.ru and have great response string(24) "{"fnd...

Jersey Consumes XML post

I want to make a Post to Jersey Rest service. What is the standard way of doing this? @Post @Consumes(MediaType.Application_xml) public Response method(??){} ...

PHP post checkboxes help

I"m having trouble receiving a list of items that are checked in a field of checkboxes which are part of a form. I have an HTML table with a few checkboxes: HTML <input type="checkbox" name="carry[]" value="1" /> <input type="checkbox" name="carry[]" value="2" /> <input type="checkbox" name="carry[]" value="3" /> PHP - this is wh...

Why am I getting an empty response in my $.post() callback?

What's wrong with this code? I'm not able to validate 'data': $.post('http://localhost/do.php', function(data) { if (data == "success") { //do something... but this line never hit! } }); I also tried, alert(data); but got an empty alert box! the do.php on success, echo's "success" echo "success"; ok.. here is the co...

Dynamic multiple location form submit with javascript

Hey guys, I'm trying to write some JavaScript for my website that will select all the forms on a page, add an event listener for when they are submitted, and then route the values submitted to the main action page and an additional alternate page. Here's what I have so far: Send.php: <script type="text/javascript"> function po...

How to get the formatted POST data of a Django form?

I have a Django ModelForm but don't want the user to click on a reguar submit button. Instead, I made my own submit button and will post the form data using Ajax/jQuery. The data to post is a mix of the form data plus other information I gather on my UI. But... how do i get the formatted POST data the html form was supposed to submit? If...