...

View Full Version : Resolved Get URL from another domain (Cross-domain)



rangana
10-29-2008, 01:47 PM
Good day!

I'm aware of the "Same Origin Policy" for JS, which I explained to my client about the "impossibility" of what he's asking.

I've read about AJAX cross domain: http://www.ajax-cross-domain.com/
...and haven't recieved any response about their service (yet).

Anyway, I was thinking of something like this:

1. Submit data on another domain (generate.php) via get method.
2. generate.php processes the form data and passed strings unto URL.
3. Can we get the url created from the no.1 scenario?

The main issue is this: I have a form, and when user submits data, it's send to a different domain via get method, and the page is redirected to that "action" field.

My client (being picky enough) wants to show a "Thank you" page, while the data is being submitted a different page.

Alternatively, if there's a way to get the URL of the "action" page without even directing to that page then I'll be fine.

Please guide. If you need further details, please let me know.

Best Regards,

A1ien51
10-29-2008, 05:36 PM
Create a proxy in your php which you post to your server and it gets redirected to the other.

Or submit the form to a hidden iframe and chaneg the content of the current page.

Eric

rangana
10-30-2008, 09:58 AM
Thank you for taking time, I'm uncertain what you meant by the first option provided. Please continue guiding.

rangana
10-31-2008, 07:50 AM
I'll just mark this as Resolved since I'm trying to isolate the problem in a simplier manner, and that is by 2nd option you've provided.

...but no cigar as of now. :(

rnd me
10-31-2008, 09:55 AM
you can submit (GET) to any domain using an image ping.
no need for proxying or server-side code for that...

you could also use a remote script adder script, there's lot of them floating about.

generate the querystring by looping through the form elements and building it manually by name and value.

replace the submit button with a <button> that sends the query, and transfers the user after a short delay.

rangana
10-31-2008, 10:49 AM
Hi rnd me, thank you for the response. It's much appreciated.

I don't think I understand you about the image ping and remote script adder script. Could you by change provide a link for me.



generate the querystring by looping through the form elements and building it manually by name and value.

replace the submit button with a <button> that sends the query, and transfers the user after a short delay.


I could not do that. I'm bound to submit the form on another domain, and the only thing that's important is the generated URL.

barkermn01
10-31-2008, 11:13 AM
Why so long winded Cross Domain is easy with php and AJAX
Have a page called get.php


SUDO CODE
Use a $_GET['Address'];
fopen it read it all in with while note feof()
then echo it out


Then get your AJAX to Read get.php?Address='The page you want to read'
Its that easy to get AJAX Cross Domain
You could even do post data via it if you wanted to but i am working on a full solution
For this

rangana
10-31-2008, 11:22 AM
Hi barkermn01,

Thank you, but I don't think I find ACD simple as you do.

I tried to get the URL via (AJAX) open method of the httprequest object, but it won't, since it's under another domain.

Do you have a link to show?

barkermn01
10-31-2008, 12:11 PM
I can build it for you give me 10/20 mins

Sorry i don't use ACD i hate it for these Reasons
1. Its far to big
2. Its a waste of time when a little php or ASP or any other language can do it in a few lines Look Below for php
3. Takes to long to load a web page using it
4. Can't use with Tab'ed browser as it fill allotted memory in no time
5. is Massive

barkermn01
10-31-2008, 12:24 PM
get.php


<?php
$address = $_GET['address'];
$fh = fopen($address,'rb');
$output = '';
while(!feof($fh)){
$output .= fread($fh,4068);
}
echo $output;
?>

Then just get your AJAXGHandle.open("GET",'get.php?address='+address,true);
where var address is == your remote IP

This is the Script working http://barkersmedia.co.uk/get.php?address=http://www.google.co.uk

So then you can use the AJAX to use the get.php

rangana
11-01-2008, 03:25 AM
That's quiet interesting, but that's all serverside and does'nt check for the generated URL on form's submission.

You can test out my dilemma here at: yourcashforgold.com/1

Sign on the form and you'll be redirected on another domain. What's important is the trackID generated by that domain. Do you have any other insight on how could I be able to get the URL generated?

barkermn01
11-03-2008, 10:19 AM
Hay, add me to MSN, i will pm u with email address

And we can talk about what you want todo and how you want it to work im sure there will be away to send data to, like i said i am building a class for this.

So i could help you



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum