How to grab a page?

Reply

Join Date: Mar 2006
Posts: 3
Reputation: varuna1 is an unknown quantity at this point 
Solved Threads: 0
varuna1 varuna1 is offline Offline
Newbie Poster

How to grab a page?

 
0
  #1
Mar 2nd, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: How to grab a page?

 
0
  #2
Mar 3rd, 2006
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.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 3
Reputation: varuna1 is an unknown quantity at this point 
Solved Threads: 0
varuna1 varuna1 is offline Offline
Newbie Poster

Re: How to grab a page?

 
0
  #3
Mar 3rd, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: How to grab a page?

 
0
  #4
Mar 3rd, 2006
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]<?php
// make sure to verify your data

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

?>[/PHP]

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:

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

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

?>[/PHP]
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 354
Reputation: Troy is an unknown quantity at this point 
Solved Threads: 5
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: How to grab a page?

 
0
  #5
Mar 4th, 2006
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.)
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 3
Reputation: varuna1 is an unknown quantity at this point 
Solved Threads: 0
varuna1 varuna1 is offline Offline
Newbie Poster

Re: How to grab a page?

 
0
  #6
Mar 4th, 2006
Hi Troy
Thanks for your suggestion. Its really very helpful in my work.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 3206 | Replies: 5
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC