By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,718 Members | 1,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,718 IT Pros & Developers. It's quick & easy.

Inject data into a iframe loaded page ?

P: 3
Hi,

I am trying to do the following and would like to know if it's possible using Javascript/Ajax/and some DB

I have an Iframe hosted on one server that loads a page which is located on another server.

So mydomain.com is in the browser address bar and loads PageA (from Mydomain2.com). Page A contains a form and a submit button.

I need to Inject some data from the Db into one or several fields contained in the Form on PageA. And have an autoSubmit action done automatically .

Is it possible ? Without having to load a script or some element on mydomain2.com server where PageA is hosted. Or some code on PageA itself.

Thank you for your assistance

J
Nov 20 '08 #1
Share this Question
Share on Google+
5 Replies


gits
Expert Mod 5K+
P: 5,390
with javascript alone you cannot do any cross-site-scripting ... so: no you cannot do it ...

kind regards
Nov 20 '08 #2

P: 3
Any other method It can be done AJAX, PHP, SOAP whatever is clever ?
Nov 20 '08 #3

gits
Expert Mod 5K+
P: 5,390
you could do a serverside http request to retrieve the page from the other domain serverside (use whatever you want) then 'copy' it and process/add anything you need and send it from 'your' domain ... now you have 'proxyed' this page and it is no cross-site-issue anymore ;) ... but you should check whether the provider of this page has anything against this behaviour unless you not provide this page for yourself ...

kind regards
Nov 20 '08 #4

P: 3
Ok. With this method. If user 1 goes to mydomain.com and the script performs the action, the session info, IP etc.. submited will be from user 1 or would be the info of the server mydomain.com is hosted on. ?
Nov 20 '08 #5

gits
Expert Mod 5K+
P: 5,390
the 'other' page rely on session data? in this case i'm not sure whether your server (proxy) could handle this session data and how this could be done ... so i cannot help further in this case. but without a similar method (serverside proxy) you cannot add anything to the page in question ...

kind regards
Nov 20 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.