Hi Everyone,

I am having two sites.

I am presently using a registration form at my new site to register a user at my second site(old one). For this i am passing all the required form values to old site at the submit of form via post method (like username,password etc.).

I want to catch the page of the second site(old one) (where i am registering the new user) after the form is submited and checking of database (like the redirected page which shows "your account is created" or "this account already exists").

Please if any one could help me in catching the html page which is redirected after the submission of data as i dont want to redirect the user from my new site to the old site after the submission of the data.

Thanks in advance.

Varun

Your best bet would be to use an XMLHTTP request to POST the data to the old site, and capture the response from that site. For this you would need to send an additional value through the POST to identify the submission as a remote submission. You will need to modify the POST handling script on the old site so that any submissions with the remote submission identifier will not redirect the user to another page, but return a response to the form page.

A quick Google for XMLHTTP should give you several good introductory scripts and tutorials to get you going.

Hi,

Thanks for replying.
But presently i dont want to make any changes in my old site(as old site is also functional). so i want if without making any changes to the old site and its functionality (if possible); some how using sockets or something else which i could use on new site form only to catch the response from old site's page redirection page.
If you can suggest me something for this.
Thanks.

The page the form is submitted to is on the old site correct? At any rate you need to edit the page the form is submitted to and add a header using PHP

<?php
// make sure to verify your data

header("Location: http://oldsites_name/oldsite_page");

?>

Make sure when using the header function that you don't send any output to the browser before the header call, for example this won't work:

<html>
<?php
// make sure to verify your data

header("Location: http://oldsites_name/oldsite_page");

?>

Varuna1, I think my screen-scraping PHP class (class_http.php) may help you. Check it out at:
http://www.troywolf.com/articles/php/class_http/

At first glance, you may think "screen-scraping" is not what you need, but if you look closely at my class, you'll see it supports POSTING form variables to the remote page. With my PHP class, you can post your form variables to your old page and get back the result--ALL SERVER-SIDE in your PHP. You can then decide what you want to send back to your user's browser.

By the way, Microsoft's XMLHTTP COM object is something you'd use in ASP/VBScript--not PHP. I suppose you could use a client-side XMLHTTP Javascript call to create a solution. ("AJAX" uses client-side XMLHTTP.)

Hi Troy
Thanks for your suggestion. Its really very helpful in my work.

This article has been dead for over six months. Start a new discussion instead.