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

Call an asp script from php

P: n/a
I have a 3rd party real-estate website written in php. I would like to
call an asp script on a separate webserver each time a new real-estate
item is added to the database on the php site.

The asp script updates a sql server database for another site and once
the page has been called, I do not need any return information from it.
I have searched the groups but cannot find a definitive way of making
the call to the asp script - I am a asp programmer, new to php so any
help would be much appreciated.

Jul 9 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 9 Jul 2006 12:36:38 -0700, lu***********@yahoo.co.uk wrote:
>I have a 3rd party real-estate website written in php. I would like to
call an asp script on a separate webserver each time a new real-estate
item is added to the database on the php site.

The asp script updates a sql server database for another site and once
the page has been called, I do not need any return information from it.
I have searched the groups but cannot find a definitive way of making
the call to the asp script - I am a asp programmer, new to php so any
help would be much appreciated.
fopen can (under the most common configuration, although it can be disabled)
open URLs as if they were files, so you can use that to make a GET request to
an ASP page. http://uk.php.net/fopen

For more complex cases (POST, cookies, finer control over timeouts etc.)
there's cURL: http://uk.php.net/manual/en/ref.curl.php

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 9 '06 #2

P: n/a
Many Thanks Andy,
That works fine!
Andy Hassall wrote:
On 9 Jul 2006 12:36:38 -0700, lu***********@yahoo.co.uk wrote:
I have a 3rd party real-estate website written in php. I would like to
call an asp script on a separate webserver each time a new real-estate
item is added to the database on the php site.

The asp script updates a sql server database for another site and once
the page has been called, I do not need any return information from it.
I have searched the groups but cannot find a definitive way of making
the call to the asp script - I am a asp programmer, new to php so any
help would be much appreciated.

fopen can (under the most common configuration, although it can be disabled)
open URLs as if they were files, so you can use that to make a GET request to
an ASP page. http://uk.php.net/fopen

For more complex cases (POST, cookies, finer control over timeouts etc.)
there's cURL: http://uk.php.net/manual/en/ref.curl.php

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 11 '06 #3

P: n/a
I am now trying to call my asp script but have having problems with the
parameters I am passing. My code is below:

$handle =
fopen("http://www.homeplots.co.uk/processhpdetails.asp?postcode={$this->zip}&city={$this->city}&price=$this->price&caption={$this->caption}&id=$this->property_id&type=$this->type",
"r");

I get the error:
Warning:
fopen('http://www.homeplots.co.uk/processhpdetails.asp?postcode=MK17
0SJ&city=Swanbourne&price=125000&caption=Building Plot in
Swanbourne&id=78&type=SF'): failed to open stream: No such file or
directory in
/home/fhlinux185/h/homeplots.eu/user/htdocs/property_class.php on line
486

The asp file definately exists but I cannot pass it the parameters. I
think the problem is to do with passing strings but do not know php
well enough to figure it out.

Again, any help much appreciated.
Lucy

lu***********@yahoo.co.uk wrote:
Many Thanks Andy,
That works fine!
Andy Hassall wrote:
On 9 Jul 2006 12:36:38 -0700, lu***********@yahoo.co.uk wrote:
>I have a 3rd party real-estate website written in php. I would like to
>call an asp script on a separate webserver each time a new real-estate
>item is added to the database on the php site.
>
>The asp script updates a sql server database for another site and once
>the page has been called, I do not need any return information from it.
I have searched the groups but cannot find a definitive way of making
>the call to the asp script - I am a asp programmer, new to php so any
>help would be much appreciated.
fopen can (under the most common configuration, although it can be disabled)
open URLs as if they were files, so you can use that to make a GET request to
an ASP page. http://uk.php.net/fopen

For more complex cases (POST, cookies, finer control over timeouts etc.)
there's cURL: http://uk.php.net/manual/en/ref.curl.php

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 11 '06 #4

P: n/a
Rik
lu***********@yahoo.co.uk wrote:
I am now trying to call my asp script but have having problems with
the
parameters I am passing. My code is below:

$handle =
fopen("http://www.homeplots.co.uk/processhpdetails.asp?postcode={$this->zip}
&city={$this->city}&price=$this->price&caption={$this->caption}&id=$this->pr
operty_id&type=$this->type",
"r");

I get the error:
Warning:
fopen('http://www.homeplots.co.uk/processhpdetails.asp?postcode=MK17
0SJ&city=Swanbourne&price=125000&caption=Building Plot in
Swanbourne&id=78&type=SF'): failed to open stream: No such file or
directory in
/home/fhlinux185/h/homeplots.eu/user/htdocs/property_class.php on line
486

The asp file definately exists but I cannot pass it the parameters. I
think the problem is to do with passing strings but do not know php
well enough to figure it out.

Again, any help much appreciated.
Lucy

First of all, rawurlencode() your parameters, 'Building Plot in Swanbourne'
should be 'Building%20Plot%20in%20Swanbourne'.

If that doesn't work, check allow_url_fopen:
http://www.php.net/manual/en/ref.fil...llow-url-fopen

Grtz,
--
Rik Wasmus
Jul 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.