Including a https .aspx form/response in a PHP page - Tricky?
| From: | Paul Fitz | Date: | Sun, 27 Jul 2003 23:04:34 +0000 |
| Subject: | Including a https .aspx form/response in a PHP page - Tricky? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157114@lists.php.net to get a copy of this message | ||
Hi All,
I have a dilemma where I have to include a form found in a .aspx page into a
php page -
The form is an ADSL phone check (checks to see if ADSL is available based
upon phone number).
I need to send the form some basic variables and get the response into my
PHP page
The form -
https://adsl-wholesale.datafast.net.au/EndUser/ADSLAvailability.aspx
I have tried the bellow with no success
(firstly I use a form in one of PHP pages gathering the same $_POST variable
names as the .aspx form, then send it to the below action page)-
I have also tried sending the variables as $_GET.
I have a feeling I may have to use the CURL library here? Any suggestions
are greatly appreciated.
Cheers,
Paul
<?php
// Post variables already collected, now do this action
$url =
"http://adsl-wholesale.datafast.net.au/EndUser/ADSLAvailability.aspx";
$file = fopen ($url, "r");
if (!$file) {
echo "<p>Unable to open remote file.\n";
exit;
}
while (!feof ($file)) {
$line = fgets ($file, 1024);
// This only works if the title and its tags are on one line
if (eregi ("<title>(.*)</title>", $line, $out)) {
$title = $out[1];
break;
}
}
fclose($file);
?>