Posting Data To A Remote Server?

Sep 28, 2009

Here is what I am trying to do. On my web page, I have three choices for the user to pick from. After the user selects one of the checkboxes and clicks a submit button, I need to send a http request to a remote server to record the user's choices (actually it is an https that I am sending),.. so I need to send something like this.

[URL]

The remote server responds with an xml response that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<sessionState>
<answer>True</answer>
</sessionState>

So, I want to post the request, read the response (answer) back from the other server and display it on my page. So, my dilemma is as follows:

1) my understanding is that I cannot do this with AJAX using an XMLHttp object because it is on a remote server and it would violate some sort of same-domain security. Is that correct? If in fact I can do it in AJAX, how do I read the response back from the other server?

2) if I am correct in my assumption in 1) then what is the best way to accomplish this task?

View 2 Replies


ADVERTISEMENT

JQuery :: Posting Canvas Data Url Along With Other Form Data?

Mar 25, 2011

Im trying to convert the contents of a canvas into a data url and then post it along with other inputs to the controller in order to save an image.

The PHP:

<
formmethod
=
"post"accept

[code]...

View 1 Replies View Related

Getting Script From Remote Server?

Jan 27, 2011

I am hosting my website in free server (freehostia.com) and i am using joomla1.5 . I want to parse RSS from my other websites. Joomla does it with its modules. But the server do not allow outbound HTTP request, hence i had use rss-to-javascript website to parse RSS feeds. It parses well but there is its advertisement below the feed (which i think is nonsense).

[Code]...

View 1 Replies View Related

Remote Post To Another Server Using Javascript

Nov 23, 2005

I want to populate my client's webpage (Remote Server) automatically
through my Server and Database by having him just paste a javascript
on his webpage.

I have read up about Microsoft Remote Scripting but the documentation
states the following : "The server which you make remote scripting
calls must be the same server from which you requested the client page
containing the requests."

In my case , the client and server pages are on two seperate servers
which means that I cannot use MS Remote Scripting.Is there an alternate
approach in any scripting language ???

Any suggestions, tutorials , websites , code snippets will be
appreciated while i continue to research on this...

View 4 Replies View Related

Make Sure Remote Server Is Up And Running?

Jul 11, 2011

I'm building a very simple app that relies on a remote server. I will use this app on many websites, so I decided to store it on one server (I have control of the remote server in question).

I need to make sure that this server is up and running, so in the case it's not I can use a fallback.

Would it be a client-side approach? A server-side approach? My guess is to use a js snippet to do the job. If I'm correct, I'll probably use jquery to perfom the task.

View 1 Replies View Related

Call Remote Server(script) Just Like CURL In PHP?

Aug 12, 2009

Is there any method/functionality in Javascript by which one can call remote server(script) , just like CURL in PHP?

View 12 Replies View Related

Upload Currently Displayed Html As A File To A Remote Web Server

Oct 16, 2010

I am developing extension which should upload currently displayed html as a file to a remote web server, unfortunatelly so far i haven't suceeded. I think this should be done through XMLHttpRequest(), but neither I know how to upload files through XMLHttpRequest nor how to convert string to file.

The HTML form that uploads a file:

But as I said i need my plugin to do it automatically and file must be made from html code.

View 5 Replies View Related

Response Is Null When Calling $.getJSON On A Remote Server?

Jun 24, 2010

I have a drop down menu with a change event that makes a JQuery JSON AJAX request, which I've simplified for this post:

Code JavaScript:
$('#id_template').change( function() {
var data = {
action: 'change_template'

[Code]....

When I do change the drop menu's value, the request seems to be successfully sent with a successful reply received (inspected it in Firebug), as the content in the "status == success" is accessed. However, the problem is the response is null.

I don't have this problem when I'm testing on my local WAMP setup, and so have no idea why everything appears to be working fine here except the retrieval of the response array.

View 1 Replies View Related

JQuery :: Get Ajax Error Messages From Server Till It Is Implemented In Remote Method

Jun 14, 2009

I wanted to ask how it is possible to get error messages from the server till it is implemented in the remote method.What do you think is the less work intensive alternative.I also wanted to ask if i have two fields A and B, and the values of B depends on A. How do i make it with the plugin and the remote method ?I saw that there is a way of writing custom methods:URL...But how do i combine it with the ajax calls?

View 2 Replies View Related

Posting Form Data

Jul 20, 2005

What is the simplest way to gather data from a form enter it into a
server-side html page?

I'd like a new entry for each new post ...

.... effectively an a html data base

BTW, can this be done purely in html without the use of a scripting
language?

View 1 Replies View Related

Posting Data With Window.open?

Nov 8, 2011

I have an application with a button that opens up another website. That website requires credentials. I'm currently using window.open to get the url open and passing a variable to the end of the URL, but when I have searched for a good way to get the credentials passed by using post and can't seem to find a solution. I tried xmlhttprequest, but the limitation of cross-domains is huge because I will have external clients connecting to the database and don't think that asking them to lower the security settings in IE would be a good way to do it. All I need is the ability to click on the button, pass the username and password and have the url open to desired page. I posted the code of the application in another thread, but all I'm getting are just views.

View 4 Replies View Related

Posting Form Data Into New Window

May 3, 2009

I am trying to take user input and post it to a new page where I can format their input into a table. Here is the begin of my form:

<form action="resumeProcessor.html" method="post" name="resume" onsubmit="return validateSubmission()">
<p>
<input name="name" type="text" id="name" value="Full Name" size="75" />
</p>
<p>
<input name="address1" type="text" id="address1" value="Street Address" size="73" />
</p>

From the user input I want to be able to take each of the text fields and format them into a table on the resumeProcessor.html. I however am unable to figure out how to call the values into my code.

View 3 Replies View Related

Posting Data When The Page Is Loaded...

Nov 11, 2002

What coding would I use to post some data when the page is loaded rather than posting through clicking a button or link? I've searched around but I can't find it...

View 2 Replies View Related

JQuery :: Getting Data From Remote URL?

Mar 23, 2009

Basically i want to grab some data from the royal mail(UK) site, to use within a CMS, so the sales team can easily find the tracking info about a customers order.

Royal mail have recently allowed get requests which populates the track and trace form field and auto submits the page via a 302 redirect e.g.
royalmail.com/portal/rm/track?trackNumber=x

With X being the tracking number. Try: [URL]

(the links above should have www and http etc on but sitepoint won't allow to post them like this because of the spam filters)

So what i would like to do, if it is possible, is to use jquery to grab that page and possible grab a certain paragraph (in this case the first p of the class "track-right-box") so that the sales team don't have to go to the site every time they want to trace the order.

Now a figured i could use $.load or $.get in jquery to do this but firebug is throwing up the error: Access to restricted URI denied" code: "1012

Which i'm guessing is something to do with the security setting on firefox.

View 6 Replies View Related

Posting Hidden Form Data To A Popup Window

May 26, 2007

Need some working sample code to post hidden form data from a php page
to a new popup window. 540 x 500 centered. The popup that I'm calling
already is formatted and has a TITLE:web-2007.php so what I need to do
is to write the values from the PHP page to that popup in specific
places.

Some of the hidden values are also like this format;

<input type="hidden" name="handling" value="<?php echo $_POST["sub"];?>">

<input type="hidden" name="email" value="<?php echo $_POST["email"];?>">

Right now,the hidden input fields are on a PHP page, and I'm calling the
popup from the generated PHP page like so:

View 3 Replies View Related

JQuery :: $.post Is Delayed In Firefox When Posting Duplicate Data?

Feb 20, 2010

On my page I have a jQuery modal dialog. It contains a checkbox associated with a product being shown in the dialog. Checking the checkbox is supposed to post the product's title to the server (using $.post). During my tests, I opened the dialog for different products, checked the checkbox and quickly pressed Esc key to close the dialog and move on to another product. What I've noticed is that if current product title to be posted is different from one sent just prior to it, things get posted quickly and without a loss. However, if I am sending the same data as what was sent with a previous request, this data doesn't make it to the server if I do this quickly -- I consistently lose data. But if I allow a couple of seconds to pass before pressing Esc key, the data (duplicate data) gets delivered fine.This happens only in Firefox (I've tried this in v. 3.6). IE 8 and Chrome 4.0.249.89 beta (38071) (it was supposed to be 5.x, though) behave as expected -- post data without delay or concern with duplicate data.

View 1 Replies View Related

Posting FORM Data To A Cross-domain IFrame Call?

Apr 9, 2009

I'm writing a web page, which should interact with pages on another server using an iFrame. I want to use a form on the parent page to post to the URL on the iFrame and capture the response, without reloading the parent page.

Here are the details:I have a FORM on the parent JSP page, with some session data in hidden fields. The point to note is that the whole session data is on the client side, in encrypted form. This data should be posted to the server for each request, synchronous or asynchronous.Now, I need to call an application on a server on a different domain. For this purpose, I am using an iFrame. The session data in the parent page should also be passed to the application in the iFrame.

View 2 Replies View Related

JQuery :: Autocomplete Remote Data Race Condition

Apr 9, 2010

I've started working with the jQuery UI 1.8 Autcomplete recently with remote data. I was pleased with the ease of initial implementation, but before long I ran into a classic race condition.As I type, the search query gets more specific, so it takes less time for the server respond. As a consequence, it is possible for the old response to arrive after the most recent one. Obviously, this is producing undesirable effects.I'm a little frustrated that the plugin doesn't have a way to manage this. To me, it seems that it makes the "basic" remote data implementation unreliable in most real-world situations. It also seems as though this would be a common problem, but I've found very little literature on it.

I've found that autocomplete is a relatively new addtion to jQuery UI, so I've put the frustration aside and started my own widget which extends autocomplete to solve for three things: 1) race conditions; 2) animated open/close; 3) caching.The nature of this post is two-fold. Not only to share information I've gathered on the topic of race conditions with others who might be having the same trouble, but to (hopefully) gain some insight to how other people are solving for this.The first piece of this puzzle was that $.ajax() (and related methods) return an XMLHTTPRequest instance. As described at stackoverflow.com, this grants us the ability to use XMLHTTPRequest.abort() method. So I just keep a handle to the XMLHTTPRequest instance, and if it exists, call abort() before the next request is made.Using a firebug, I could see that the requests were being aborted as expected and the symptoms of the race-condition ceased. So far, so good... then I got to IE. Not so much.In IE, I was seeing run-time errors. The odd thing is that the run-time errors seemed to be coming from deep within jQuery UI, rather than my code yet commenting out the abort() avoided the run-times. After scratching my head for a while, I used the following simplified code to shed some light on the situation:[code]

In Firefox and Chrome, behavior is as expected - no alert box. However, in IE6 and IE8 (IE7 untested at this time), the success handler still fires! As it turns out, the run-time errors were because the response was undefined as it got passed through my success code path. My next thought was, "maybe I can just evaluate textStatus". Unfortunately, it turns out (as seen in the alert box) it contains the string "success".

View 3 Replies View Related

JQuery :: Pass Data From Remote File To .format?

Jun 8, 2009

I'd like to learn how data is passed form one file to another and then displaying at when an error occurs. I have this php script that checks if an domain really exist

[Code]...

View 1 Replies View Related

JQuery :: Remote Validation Validates, But Still Submits Wrong Data?

Jan 26, 2011

I made a shortened version of code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"></script>
<script src="http://www.ylakiudarzelis.lt/js/jquery.validate.js" type="text/javascript">

[code]....

View 2 Replies View Related

JQuery :: [validate] Validation By Remote: Passing In Data Alongside ElementName?

May 15, 2009

$("#Form").validate({
rules: {
storename_name: {

[code]....

View 1 Replies View Related

Get Ip Address Of The Remote User Or Remote Web Browser?

May 4, 2009

I am new to javascript, I have one question, how can I use javascript to get the IP address of the remote user or remote web browser?

View 9 Replies View Related

How To Get Data From Server

Jul 23, 2005

What i want to do is that this function post data to the server (ASP) and
the server will response with 'OK' My question is how can i send data clientside from Javascript to the server ? (navigate ? with url ?)

and check the returned data in the same function ?

function ShowData(TxtArt)
{
alert(TxtArt + ' : ' + parent.frames.Bottom.TxtUsrName.value + ' - ' +
parent.frames.Bottom.TxtRemarque.value); // testing purpose
// post the data to the server. ex .. myURL.asp?userID=1000&Art=ART1201
// fetch the data from the server. to verify if the 'OK' is recieved ->
the server will response with 'OK'
// if 'ok' -> i will update clientside an frame (ex. contents of
shoppingbasket)
}

Any idea's ?

View 3 Replies View Related

JQuery :: Data Not Getting From The Server?

May 18, 2011

TEST .js

// JavaScript Document
$.post('http://example.com/test.php?image_no='+no_image, function(data) {
$('#gallery').html(data);

[code]....

View 1 Replies View Related

Return Data To The Server On The Fly

Jan 4, 2006

Read the first reply below first/instead, it's probably more helpful than this one

There's a lot of talk about AJAX these days and it seems to me it's turning into a hammer for a lot of problems that aren't really nails. If you want your pages to call home but don't want to have to deal with XML parsing and extremely spotty browser support, here's a very simple way to effect communication from Javascript to the server. The server can only (easily) communicate back on the next page hit with this method, but as a one way conduit from client to server post page rendering it can hardly be beat.

I've set it up with a really simple case that keeps track of the total time each user spends looking at a page in ten second increments. I have, for clarity (I hope) stuck it all in one PHP file, but it'll work the same with any server side language:


<?php
// this block isn't really too well coded or useful, it's intended more as a simple proof of concept
if (isset($_GET['ip']) && ip2long($_GET['ip']) !== false)
{
// if there's a GET variable (this.php?ip=something) and it appears to be a valid ip...
$fname = sha1($_GET['ip']) . '.time'
if (file_exists($fname) && strpos(($pre = file_get_contents($fname)), '='))
{
// if we have a file and it looks like it might be in the right format, increment the value contained therein
list($ip, $time) = explode('=', $pre);
file_put_contents($fname, $ip . '=' . ($time + 10));
}
else
{
// else just write it in and hope for the best
file_put_contents($fname, $_GET['ip'] . '=10');
}
/*
//actually returning an image here can help get the loading message out of browser's status bars

header('Content-type: image/gif');
fpassthru('small.gif');
*/
}
else
{
?>
<html>
<body onload="javascript:setTimeout('serverTick();', 10000);">
<script language="javascript">
var ip = '<?php echo $_SERVER['REMOTE_ADDR']; ?>' // give the javascript an ip or a hash or something to pass back that will be reasonably unique

function serverTick()
{
setTimeout('serverTick();', 10000); // call this function again in 10 seconds
var notshown = new Image();
notshown.src = '<?php echo $_SERVER['PHP_SELF']; ?>?ip=' + ip; // calls this file in attempt to preload an image, instead triggering the above block of PHP
}
</script>
</body>
</html>
<?php
}
?>


This will work in far more browsers than AJAX will, and it's not subject to any domain restriction, it can post to another server without generating security exceptions. It may be possible to get data back in the body of the image and it's definitely possible to get data back coded as image dimensions, if you want to push this method a little further.

View 5 Replies View Related

How To Load Data From Other Server

Apr 13, 2010

how Google Analytics or Google Adsense lets you copy and paste javascript to your site and you can load data/track visitors/etc. Well, I want to do the same thing for my customers, on their domains, where they load dynamic prices on my server (long story). Is $getJSON the best solution in this day and age? I would prefer to not force them to use frames and I am not worried (nor are they, for reasons I wont' get into) about users who don't use javascript.

In short, our site processes payments for them and there is a unique feature that offers dynamic prices. So if they have javascript code with an order button image, I want them to hit my server and have their javascript code read my server, find the updated price, and display it to their user. note they will be using .html pages, not php, and they are not programmers and I want to simplify it.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved