For my personal use I am accessing a railway timetable page, parsing its
contents and then sending brief relevant information as the subject line of
an email to be read on a mobile phone.
The problem comes when I try to parse a second page, the url of which, I
have derived from an initial page.
I cannot go directly to the second (target) page but from the initial page
derive the url and put it in a string called $strTarget
In one particular instance $strTarget reads thus:
If I hard code this string like this
$fp =
fopen("http://www.livedepartu reboards.co.uk/ldb/train.aspx?T=FR NCMB++&J=137062 6&R=0",
'r');
then the target page opens ok and conveys the timetable information.
However if, as I have to do, I code it using the variable $strTarget like
this
$fp = fopen($strTarge t, 'r');
then the page that opens is always the timetable site's default page for the
message,
"Details for the requested train are no longer available."
I have checked and double checked to make sure this is indeed what is
happening.
Can anyone explain what is going on here?
Thanks
Bill
contents and then sending brief relevant information as the subject line of
an email to be read on a mobile phone.
The problem comes when I try to parse a second page, the url of which, I
have derived from an initial page.
I cannot go directly to the second (target) page but from the initial page
derive the url and put it in a string called $strTarget
In one particular instance $strTarget reads thus:
If I hard code this string like this
$fp =
fopen("http://www.livedepartu reboards.co.uk/ldb/train.aspx?T=FR NCMB++&J=137062 6&R=0",
'r');
then the target page opens ok and conveys the timetable information.
However if, as I have to do, I code it using the variable $strTarget like
this
$fp = fopen($strTarge t, 'r');
then the page that opens is always the timetable site's default page for the
message,
"Details for the requested train are no longer available."
I have checked and double checked to make sure this is indeed what is
happening.
Can anyone explain what is going on here?
Thanks
Bill
Comment