Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Integrate an ASP form to a page

Status
Not open for further replies.

ScanX

Programmer
Oct 13, 2003
26
BE
Hello,

I'm working on a website in PHP but I have to integrate a form coming from another website into it...the problem is that the form is coded in ASP and I have no idea how to make the results of a query appear in a page on my website.

Here is the adress of the form I have to integrate :


If you click on "Recherche" on top right, you see that you are brought to a page containing all the results of the search and of course you can click on a document.

I would like to be able to manipulate the documents on my PHP webby (so the step just after the results of the query).

Anyone has an idea to help me ?

Thanx
 
I would say you can't integrate directly as .asp pages are processed differenty from .php pages. They make both be hosted on the same windows server but they are seprate.
If you have access to the .asp code you could get the variables sent from the form and construct a call into php from there probabbly via a response.addheader("location", "mypage.php?var=1&var=2"). But to be honest any thing would be a lash up.
What is to happen to the existing functionality of the .asp page ?
 
Thand for your answer ingresman

Actually the asp page wasnt written by me and I dont have any access to the code.

What I want to do is to offer on my website the same form as the one I posted before and be able to work on the results.

I can only access the code when I select view source on the page.

What I was thinking is :

If I put the ASP form in a frame on my website using the code of the view source and modifying this :

<form onSubmit=" return verify(this);" name="critdoc" method="POST" action="docList.asp" TARGET="mainFrame">

Is there a way to parse the results given in that frame so I can, for example, change the <a href="..."> to a link that keeps the user on my website using target again ?
 
You can use CURL functions or open a socket connection to the ASP page and get the results from there.
You can see the parameters that the ASP page collects in the form. Make a similar form and use the cURL or explicit HTTP communication to fetch the output from the ASP page. All that works while PHP is executing, so the user will not see anything what's going on behind the scenes and you still get the output.
This process is sometimes refered to as "screen scraping".
 
You can just call the page but you will have to simulate the POST action i.e. you will have to put some names pairs into the body of the message e.g. var=3&var56=13. You HTTP request would be like
POST doclist.asp /http1.1
host: lngth=15
var1=12&var3=45

You might get away with the frame method but frames are hard to control and XP serve pack 2 has some changes which will not allow a frame to access a different URL from the caller.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top