/    Sign up×
Community /Pin to ProfileBookmark

AJAX over SSL with two domains

Hello.

I am trying to make data submitted from a form be saved into a database. The problem is that the server can not run any scripting languages (such as PHP or ASP) and that the connection between the client and the server is over SSL.

My idea is to allow the user to submit the form via Ajax to another server (not necessarily over SSL) which can run PHP.

The scripts all work fine using my local machine, however, when I upload the HTML file to the secure server, I get an error when I try and submit the form:

Permission denied to call method XMLHttpRequest.open

I guess this is a security feature of the browser to prevent cross site scripting, is there any way round it?

Thanks in advance for any help on this.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@cassioblazJan 15.2007 — Hi,

Instead of using AJAX, you can submit your form to an iframe that has your PHP.

Here`s an example:

<form target="youriframe">

...

</form>

<iframe name="youriframe" src="yourphp.php"></iframe>

This way, you can put your script and save data in your yourphp.php file.

PS.: The form and the iframe have others parameters you may need.

Cássio Blaz,

http://www.krieser.com.br
Copy linkTweet thisAlerts:
@A1ien51Jan 15.2007 — Only way around it using Ajax is to post back to the same server the code is on and have that server make a submission to the other server.

Eric
Copy linkTweet thisAlerts:
@SlappyTheFishauthorJan 15.2007 — Thanks for the replies, the only problem is that I cannot use IFRAMEs. I also don't see how the server could make the submission as I cannot run server side scripts.
×

Success!

Help @SlappyTheFish spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...