Re: [PHP] ? in URLS.

2003-01-23 Thread Simon Angell
Ok, ill explain my self further. the URL in the script is
http://www.weatherzone.com.au/yourHomePage.jsp?ref=f2eeb571ed

The script uses the URL to see the page and store it locally, then another
script grabs selected data from that page. the stuff after the ? is
essential for the data i want to be displayed, with out that part, the
script only sees the base page without the data i need, so hence it doesn't
grab it. so how do i use the
$_GET['var1']
$_GET['var2']
$_GET['var3']

or urlencode() in the script
this is the script.
?php
//Writing of local file

 $rContents = implode( \r\n, file(
'http://www.weatherzone.com.au/yourHomePage.jsp?ref=f2eeb571ed' ) );

if( ($fp = fopen( 'wztest.txt', 'wb+' )) !== false )
{
fputs( $fp, $rContents );
fclose( $fp );
}
?


--

Cheers
-
Simon Angell
Canberra, ACT
www.canberra-wx.com
-
Proud member of the
Australian Severe Weather Association.
www.severeweather.asn.au
--
Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 use urlencode()

 Simon Angell wrote:

 Hi All.
 I am currently playing with sripts, and have come across a problem, that
i
 can't slove. (i am a novice - lol).
 The script requires a URL to grab data from. The URL has a ? in it, and
 testing the script it grabs the base data of the URL, but not the
essential
 data i need, which is only brought up with what comes after the ? in the
 URL. now i figure it has something to do with the ? in the URL but i
can't
 seem to fix it myself.
 
 Thanks
 
 --
 
 Cheers
 -----
 Simon Angell
 Canberra, ACT
 www.canberra-wx.com
 -
 Proud member of the
 Australian Severe Weather Association.
 www.severeweather.asn.au
 --
 
 
 
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] ? in URLS.

2003-01-22 Thread Simon Angell
Hi All.
I am currently playing with sripts, and have come across a problem, that i
can't slove. (i am a novice - lol).
The script requires a URL to grab data from. The URL has a ? in it, and
testing the script it grabs the base data of the URL, but not the essential
data i need, which is only brought up with what comes after the ? in the
URL. now i figure it has something to do with the ? in the URL but i can't
seem to fix it myself.

Thanks

--

Cheers
-
Simon Angell
Canberra, ACT
www.canberra-wx.com
-
Proud member of the
Australian Severe Weather Association.
www.severeweather.asn.au
--



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: access denied

2002-10-06 Thread Simon Angell

I don't know exactly what shell access is, but in my quest to do what i was
trying to do, i realised its not worth it due to the fact the file i was
copying was still being accessed everytime the php file was open, and my aim
was to get the particular file from the remote server, copy it onto my
server 2 times a day and then the php file that im working on would access
the local file instead of the remote file which its doing now,

Anyways, thanx for all your help

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Quick question.

2002-10-06 Thread Simon Angell

Hi, sorry about the delay, i have some computer problems in the last few
days, all fixed now i hope.

I don't know exactly what shell access is, or ssh for that matter, but in my
quest to do what i was trying to do, I realised its not worth it due to the
fact the file i was copying was still being accessed everytime the php file
was open, and my aim was to get the particular file from the remote server,
copy it onto my server 2 times a day and then the php file that im working
on would access the local file instead of the remote file which its doing
now,

Anyways, thanx for all your help

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] access denied

2002-10-02 Thread Simon Angell

The PHP script im using works on my computers server, but when after
uploading to my web server i get this...
Warning: fopen(wtest.txt, wb+) - Permission denied in
/home/canberra/public_html/bomonster/canberra.php on line 6

Dunno why either, the directory is not protected, can anyne help me with
this?
one?
The particular code in question...
//Writing of local file

 $rContents = implode( \r\n, file(
'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );

if( ($fp = fopen( 'wtest.txt', 'wb+' )) !== false )
{
fputs( $fp, $rContents );
fclose( $fp );
}
--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Quick question.

2002-10-02 Thread Simon Angell

I am the webmaster of the site, i pay for the server space, is that what you
mean?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.

Robert Cummings [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Simon Angell wrote:
 
  Thanks for that Robert *it works*, now i have 1 more problem, after
  uploading to my web server i get this...
  Warning: fopen(wtest.txt, wb+) - Permission denied in
  /home/canberra/public_html/bomonster/canberra.php on line 6
 
  Dunno why either, the directory is not protected, can you help me with
that
  one?

 What are the permissions and ownerships? Do these ownerships and
 permissions match up with the webserver versus your own ownership?

 Cheers,
 Rob.

 
  --
  Cheers
  -
  Simon Angell
  Canberra ACT
  www.canberra-wx.com
  -
  Member of:
  Australian Severe Weather Association.
  www.severeweather.asn.au
  -
  This email is virus free.
  Scanned before leaving my mailbox
  using Norton Antivirus 2002 for Win2k
  Scanned with the latest definition File.
 
  Robert Cummings [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Windows makes me cry... this will fix the problem...
  
   Change: $rContents = implode( \n, file(
  'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );
   To: $rContents = implode( \r\n, file(
  'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );
  
   If that doesn't work:
  
   To: $rContents = implode( \n\r, file(
  'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );
  
   I can never remember the order :)
  
   Cheers,
   Rob.
  
   Simon Angell wrote:
   
i removed a / and it worked :)
?php
$rContents = implode( \n, file(
'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );
   
if( ($fp = fopen( 'test/canberratest.txt', 'w+' )) !== false )
{
fputs( $fp, $rContents );
fclose( $fp );
}
?
   
Now the format of the content is no longer, can this be fixed?
This is how it is originally.
IDN10035
BUREAU OF METEOROLOGY
CANBERRA METEOROLOGICAL OFFICE
FORECAST FOR THE ACT
Issued at 3:34pm on Tuesday the 1st of October 2002
   
SITUATION:
   
AND this is how the text file writes
IDN10035BUREAU OF METEOROLOGYCANBERRA METEOROLOGICAL OFFICEFORECAST
FOR
  THE
ACTIssued at 3:34pm on Tuesday the 1st of October 2002SITUATION:
   
with  all through it where a new line is suppose to be.
   
Can this be fixed, or will i just need to work around it?
--
Cheers
-----
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.
   
Simon Angell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i tried that ine and got this...
 Warning: fopen(/test/canberra.txt, w+) - No such file or
directory
  in
 C:\Xitami\webpages\bomonster\test2.php on line 4

 code..
 ?php
 $rContents = implode( \n, file(
 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );

 if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false )
 {
 fputs( $fp, $rContents );
 fclose( $fp );
 }
 ?

 I think i know what the probelm is.
 .if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false )
 should be
  if( ($fp = fopen(
'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ,
 'w+' )) !== false )

 But, where do i put the file name and directory to write?

 --
 Cheers
 ---------
 Simon Angell
 Canberra ACT
 www.canberra-wx.com
 -
 Member of:
 Australian Severe Weather Association.
 www.severeweather.asn.au
 -
 This email is virus free.
 Scanned before leaving my mailbox
 using Norton Antivirus 2002 for Win2k
 Scanned with the latest definition File.

 Robert Cummings

Re: [PHP] Quick question.

2002-10-02 Thread Simon Angell

i am unsure what you mean, where exactly do it type in 'ls -al' ?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.

Robert Cummings [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 No i mean switch to the directory in which you have th file with the code
 and type 'ls -al' Then look at the permissions and ownerships. Don't
forget
 the web server runs with different permissions thatn you do at home.

 Cheers,
 Rob.

 Simon Angell wrote:
 
  I am the webmaster of the site, i pay for the server space, is that what
you
  mean?
 
  --
  Cheers
  -
  Simon Angell
  Canberra ACT
  www.canberra-wx.com
  -
  Member of:
  Australian Severe Weather Association.
  www.severeweather.asn.au
  -
  This email is virus free.
  Scanned before leaving my mailbox
  using Norton Antivirus 2002 for Win2k
  Scanned with the latest definition File.
 
  Robert Cummings [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Simon Angell wrote:
   
Thanks for that Robert *it works*, now i have 1 more problem, after
uploading to my web server i get this...
Warning: fopen(wtest.txt, wb+) - Permission denied in
/home/canberra/public_html/bomonster/canberra.php on line 6
   
Dunno why either, the directory is not protected, can you help me
with
  that
one?
  
   What are the permissions and ownerships? Do these ownerships and
   permissions match up with the webserver versus your own ownership?
  
   Cheers,
   Rob.

 --
 .-.
 | Robert Cummings |
 :-`.
 | Webdeployer - Chief PHP and Java Programmer  |
 :--:
 | Mail  : mailto:[EMAIL PROTECTED] |
 | Phone : (613) 731-4046 x.109 |
 :--:
 | Website : http://www.webmotion.com   |
 | Fax : (613) 260-9545 |
 `--'



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Quick question.

2002-10-01 Thread Simon Angell

Hi everyone.
I asked this a week or so ago but i am unsure if it got to the list, so here
we go again.

I am trying to get a remote file to be copied onto my own web server, I have
looked at fopen() and fread() and fwrite() and get the general idea of each,
but im wondering how to join the commandes to get the file i want from the
remote ftp server, copied and written onto my own server.


--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Quick question.

2002-10-01 Thread Simon Angell

i tried that ine and got this...
Warning: fopen(/test/canberra.txt, w+) - No such file or directory in
C:\Xitami\webpages\bomonster\test2.php on line 4

code..
?php
$rContents = implode( \n, file(
'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );

if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false )
{
fputs( $fp, $rContents );
fclose( $fp );
}
?

I think i know what the probelm is.
.if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false )
should be
 if( ($fp = fopen( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ,
'w+' )) !== false )

But, where do i put the file name and directory to write?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.

Robert Cummings [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Simon Angell wrote:
 
  Hi everyone.
  I asked this a week or so ago but i am unsure if it got to the list, so
here
  we go again.
 
  I am trying to get a remote file to be copied onto my own web server, I
have
  looked at fopen() and fread() and fwrite() and get the general idea of
each,
  but im wondering how to join the commandes to get the file i want from
the
  remote ftp server, copied and written onto my own server.

 Something like the following might work (not tested AT ALL):

 $rContents = implode( \n, file( 'ftp://www.foo.bar/me/my/data.txt' ) );

 if( ($fp = fopen( '/tmp/myFile.txt', 'w+' )) !== false )
 {
 fputs( $fp, $rContents );
 fclose( $fp );
 }

 --
 .-.
 | Robert Cummings |
 :-`.
 | Webdeployer - Chief PHP and Java Programmer  |
 :--:
 | Mail  : mailto:[EMAIL PROTECTED] |
 | Phone : (613) 731-4046 x.109 |
 :--:
 | Website : http://www.webmotion.com   |
 | Fax : (613) 260-9545 |
 `--'



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Quick question.

2002-10-01 Thread Simon Angell

i removed a / and it worked :)
?php
$rContents = implode( \n, file(
'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );

if( ($fp = fopen( 'test/canberratest.txt', 'w+' )) !== false )
{
fputs( $fp, $rContents );
fclose( $fp );
}
?

Now the format of the content is no longer, can this be fixed?
This is how it is originally.
IDN10035
BUREAU OF METEOROLOGY
CANBERRA METEOROLOGICAL OFFICE
FORECAST FOR THE ACT
Issued at 3:34pm on Tuesday the 1st of October 2002

SITUATION:

AND this is how the text file writes
IDN10035BUREAU OF METEOROLOGYCANBERRA METEOROLOGICAL OFFICEFORECAST FOR THE
ACTIssued at 3:34pm on Tuesday the 1st of October 2002SITUATION:

with  all through it where a new line is suppose to be.

Can this be fixed, or will i just need to work around it?
--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.

Simon Angell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i tried that ine and got this...
 Warning: fopen(/test/canberra.txt, w+) - No such file or directory in
 C:\Xitami\webpages\bomonster\test2.php on line 4

 code..
 ?php
 $rContents = implode( \n, file(
 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );

 if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false )
 {
 fputs( $fp, $rContents );
 fclose( $fp );
 }
 ?

 I think i know what the probelm is.
 .if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false )
 should be
  if( ($fp = fopen( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ,
 'w+' )) !== false )

 But, where do i put the file name and directory to write?

 --
 Cheers
 -----
 Simon Angell
 Canberra ACT
 www.canberra-wx.com
 -
 Member of:
 Australian Severe Weather Association.
 www.severeweather.asn.au
 -
 This email is virus free.
 Scanned before leaving my mailbox
 using Norton Antivirus 2002 for Win2k
 Scanned with the latest definition File.

 Robert Cummings [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Simon Angell wrote:
  
   Hi everyone.
   I asked this a week or so ago but i am unsure if it got to the list,
so
 here
   we go again.
  
   I am trying to get a remote file to be copied onto my own web server,
I
 have
   looked at fopen() and fread() and fwrite() and get the general idea of
 each,
   but im wondering how to join the commandes to get the file i want from
 the
   remote ftp server, copied and written onto my own server.
 
  Something like the following might work (not tested AT ALL):
 
  $rContents = implode( \n, file(
'ftp://www.foo.bar/me/my/data.txt' ) );
 
  if( ($fp = fopen( '/tmp/myFile.txt', 'w+' )) !== false )
  {
  fputs( $fp, $rContents );
  fclose( $fp );
  }
 
  --
  .-.
  | Robert Cummings |
  :-`.
  | Webdeployer - Chief PHP and Java Programmer  |
  :--:
  | Mail  : mailto:[EMAIL PROTECTED] |
  | Phone : (613) 731-4046 x.109 |
  :--:
  | Website : http://www.webmotion.com   |
  | Fax : (613) 260-9545 |
  `--'





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Quick question.

2002-10-01 Thread Simon Angell

Thanks for that Robert *it works*, now i have 1 more problem, after
uploading to my web server i get this...
Warning: fopen(wtest.txt, wb+) - Permission denied in
/home/canberra/public_html/bomonster/canberra.php on line 6

Dunno why either, the directory is not protected, can you help me with that
one?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.

Robert Cummings [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Windows makes me cry... this will fix the problem...

 Change: $rContents = implode( \n, file(
'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );
 To: $rContents = implode( \r\n, file(
'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );

 If that doesn't work:

 To: $rContents = implode( \n\r, file(
'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );

 I can never remember the order :)

 Cheers,
 Rob.

 Simon Angell wrote:
 
  i removed a / and it worked :)
  ?php
  $rContents = implode( \n, file(
  'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );
 
  if( ($fp = fopen( 'test/canberratest.txt', 'w+' )) !== false )
  {
  fputs( $fp, $rContents );
  fclose( $fp );
  }
  ?
 
  Now the format of the content is no longer, can this be fixed?
  This is how it is originally.
  IDN10035
  BUREAU OF METEOROLOGY
  CANBERRA METEOROLOGICAL OFFICE
  FORECAST FOR THE ACT
  Issued at 3:34pm on Tuesday the 1st of October 2002
 
  SITUATION:
 
  AND this is how the text file writes
  IDN10035BUREAU OF METEOROLOGYCANBERRA METEOROLOGICAL OFFICEFORECAST FOR
THE
  ACTIssued at 3:34pm on Tuesday the 1st of October 2002SITUATION:
 
  with  all through it where a new line is suppose to be.
 
  Can this be fixed, or will i just need to work around it?
  --
  Cheers
  -
  Simon Angell
  Canberra ACT
  www.canberra-wx.com
  -
  Member of:
  Australian Severe Weather Association.
  www.severeweather.asn.au
  -
  This email is virus free.
  Scanned before leaving my mailbox
  using Norton Antivirus 2002 for Win2k
  Scanned with the latest definition File.
 
  Simon Angell [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   i tried that ine and got this...
   Warning: fopen(/test/canberra.txt, w+) - No such file or directory
in
   C:\Xitami\webpages\bomonster\test2.php on line 4
  
   code..
   ?php
   $rContents = implode( \n, file(
   'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );
  
   if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false )
   {
   fputs( $fp, $rContents );
   fclose( $fp );
   }
   ?
  
   I think i know what the probelm is.
   .if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false )
   should be
if( ($fp = fopen( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ,
   'w+' )) !== false )
  
   But, where do i put the file name and directory to write?
  
   --
   Cheers
   -----
   Simon Angell
   Canberra ACT
   www.canberra-wx.com
   -
   Member of:
   Australian Severe Weather Association.
   www.severeweather.asn.au
   -
   This email is virus free.
   Scanned before leaving my mailbox
   using Norton Antivirus 2002 for Win2k
   Scanned with the latest definition File.
  
   Robert Cummings [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Simon Angell wrote:

 Hi everyone.
 I asked this a week or so ago but i am unsure if it got to the
list,
  so
   here
 we go again.

 I am trying to get a remote file to be copied onto my own web
server,
  I
   have
 looked at fopen() and fread() and fwrite() and get the general
idea of
   each,
 but im wondering how to join the commandes to get the file i want
from
   the
 remote ftp server, copied and written onto my own server.
   
Something like the following might work (not tested AT ALL):
   
$rContents = implode( \n, file(
  'ftp://www.foo.bar/me/my/data.txt' ) );
   
if( ($fp = fopen( '/tmp/myFile.txt', 'w+' )) !== false )
{
fputs( $fp, $rContents );
fclose( $fp );
}

 --
 .-.
 | Robert Cummings |
 :-`.
 | Webdeployer - Chief PHP and Java Programmer  |
 :--:
 | Mail  : mailto:[EMAIL PROTECTED

[PHP] Re: remote files to servers

2002-09-27 Thread Simon Angell

From: Brad Bonkoski [EMAIL PROTECTED]
Sure,
see fopen() and fread() and fwrite()
-Brad

I Have looked through the manual at these and have got the general idea of
it, but how do i join the commands to do the function i am after?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.


Simon Angell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all.
 i was wondering if it is possible to use PHP to retrieve a remote file and
 then write a copy to my own server for quicker access?

 --
 Cheers
 -----
 Simon Angell
 Canberra ACT
 www.canberra-wx.com
 -
 Member of:
 Australian Severe Weather Association.
 www.severeweather.asn.au
 -
 This email is virus free.
 Scanned before leaving my mailbox
 using Norton Antivirus 2002 for Win2k
 Scanned with the latest definition File.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] php-Re: Remote files to servers

2002-09-27 Thread Simon Angell

From: Brad Bonkoski [EMAIL PROTECTED]
Sure,
see fopen() and fread() and fwrite()
-Brad

I Have looked through the manual at these and have got the general idea of
it, but how do i join the commands to do the function i am after?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.


Simon Angell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all.
 i was wondering if it is possible to use PHP to retrieve a remote file and
 then write a copy to my own server for quicker access?

 --
 Cheers
 -----
 Simon Angell
 Canberra ACT
 www.canberra-wx.com
 -
 Member of:
 Australian Severe Weather Association.
 www.severeweather.asn.au
 -
 This email is virus free.
 Scanned before leaving my mailbox
 using Norton Antivirus 2002 for Win2k
 Scanned with the latest definition File.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] remote files to servers

2002-09-26 Thread Simon Angell

Hi all.
i was wondering if it is possible to use PHP to retrieve a remote file and
then write a copy to my own server for quicker access?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Need some help please.

2002-09-19 Thread Simon Angell

With my limited knowledge (i.e none, lol) i was wondering if you are able to
give me the code you use to do it. i will then play around with it t get
Canberra, is that ok? doesn't matter if not.

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.

David Freeman [EMAIL PROTECTED] wrote in message
009901c25fa1$ba8fb9f0$3f0a0a0a@skink">news:009901c25fa1$ba8fb9f0$3f0a0a0a@skink...

   Thats a Nice feaure you have, How do you do that?

 I have a cron event on my server that grabs the relevant page from the
 web site soon after it is updated (around 20 past each hour) using lynx
 -dump url which then pipes the resulting page dump through grep to grab
 just the line of data that includes my town and dumps that output to a
 file.

 The file contains a single line of data that includes all of the
 information I display plus some other stuff on the page that I don't
 use.

 Within my php page I open that small file and load it into an array for
 display on the page.

 Obviously there's some error checking in there for various fail
 conditions and some other stuff too but that's the basics of it.

 I've looked at doing something similar for forecasts but as I don't
 (yet) have a need to display them I haven't got around to it.

 The main advantage of this method is that you're not grabbing the data
 on every page load but, instead, only when the data on the source web
 site can reasonably be expected to have changed.

 delurkAs well as running a business with my wife I work for the BoM
 and have done for about 18 years now/delurk

 CYA, Dave






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Need some help please.

2002-09-18 Thread Simon Angell

Hi.

I am having trouble with a PHP script. I am not the one who made this and my
knowledge on php is very little.
I came across this php script www.canberra-wx.com/bomonster/bomonster01.php
which is weather forecasting for a place called Mildura.
The file that the PHP gets its info from is here...
http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV17001.txt and if you look down
the page you will see the Mildura forecast that the PHP draws its info
output from.

My Problem is that i want it to work for this file...
http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10035.txt and i cant work out
how to get it going.
i have got this far www.canberra-wx.com/bomonster/bomonster1.php (look at
the code, the actual outpot doesn't work..thats my problem). The part I want
the PHP to do its info output is from A.C.T FORECAST (like from the Mildura
in IDV17001.txt)

Any help on how to get it to work would be great.

Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Need some help please.

2002-09-18 Thread Simon Angell
($fp);

   //replace some strings
   $patterns = array(
  /(\%Name\[)(.*?)(\]\%)/se,
  /(\%Description\[)(.*?)(\]\%)/se,
  /(\%Min_Temp\[)(.*?)(\]\%)/se,
  /(\%Max_Temp\[)(.*?)(\]\%)/se,
  /(\%Precip\[)(.*?)(\]\%)/se,
  /(\%Image\[)(.*?)(\]\%)/se,
  /(\%Alt_Tag\[)(.*?)(\]\%)/se,
/(\%Short_Name\[)(.*?)(\]\%)/se
   );

   $replace = array(
  '$place_array[name][\\2]',
  '$place_array[description][\\2]',
'$place_array[min_temp][\\2]',
  '$place_array[max_temp][\\2]',
  '$place_array[precip][\\2]',
  '$place_array[image][\\2]',
  '$place_array[alt_tag][\\2]',

'$place_array[short_name][\\2]'
   );


   $template = preg_replace ($patterns, $replace, $template);

   print($template);
 }

}

?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Need some help please.

2002-09-18 Thread Simon Angell


I Have now got it kinda working, but not fully, i changed something i
shouldn't have, but fixed that..
 //create new string containing data for selected place
  preg_match(|$placename.*?\\n\\n.*?\\n\\n|s, $content, $temp); (i had it
//create new string containing data for selected place
  preg_match(|$canberra.*?\\n\\n.*?\\n\\n|s, $content, $temp); by
accident), but as you see it doesn't get all the forecast
Mildura (works)
http://www.canberra-wx.com/bomonster/bomonster01.php
Canberra (kinda works)
http://www.canberra-wx.com/bomonster/bomonster1.php

The Problem now is displaying the full description of the forecast and the
forecast temps for the next few days...also noticed that the Mildura
Forecast is not fully displayed, it is missing 1 work at the end of the
forecast description...

So How do i change the php to display the Whole description and the next few
days of temps.
Remember the layout of the source of the info is different
http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV17001.txt is the Mildura
forecast...
http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10035.txt is the Canberra/A.C.T
Forecast that i want to use.

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.

Simon Angell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi.

 I am having trouble with a PHP script. I am not the one who made this and
my
 knowledge on php is very little.
 I came across this php script
www.canberra-wx.com/bomonster/bomonster01.php
 which is weather forecasting for a place called Mildura.
 The file that the PHP gets its info from is here...
 http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV17001.txt and if you look
down
 the page you will see the Mildura forecast that the PHP draws its info
 output from.

 My Problem is that i want it to work for this file...
 http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10035.txt and i cant work out
 how to get it going.
 i have got this far www.canberra-wx.com/bomonster/bomonster1.php (look at
 the code, the actual outpot doesn't work..thats my problem). The part I
want
 the PHP to do its info output is from A.C.T FORECAST (like from the
Mildura
 in IDV17001.txt)

 Any help on how to get it to work would be great.

 Cheers
 -----
 Simon Angell
 Canberra ACT
 www.canberra-wx.com
 -
 Member of:
 Australian Severe Weather Association.
 www.severeweather.asn.au
 -
 This email is virus free.
 Scanned before leaving my mailbox
 using Norton Antivirus 2002 for Win2k
 Scanned with the latest definition File.






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Need some help please.

2002-09-18 Thread Simon Angell

Thats a Nice feaure you have, How do you do that?

I have spoken to guy who made the php file and he will look into the bugs
for me, also i will keep playing around with it.

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.

David Freeman [EMAIL PROTECTED] wrote in message
005101c25f70$4f197700$3f0a0a0a@skink">news:005101c25f70$4f197700$3f0a0a0a@skink...

   I am having trouble with a PHP script. I am not the one who
   made this and my knowledge on php is very little.
   I came across this php script
   www.canberra-wx.com/bomonster/bomonster01.php

 Tried loading this and had too many page errors to figure out what you
 are doing.

   www.canberra-wx.com/bomonster/bomonster1.php

 Ditto for this one.

   Any help on how to get it to work would be great.

 First comment is a conceptual one rather than a programming one.

 I presume you are doing this so that every time someone loads your page
 they get current information?  You do know that the BoM only updates
 forecasts around three to four times per day don't you?  In this case it
 means that every hit on your page is reloading what is, largely, static
 information.  You would be far better off caching the raw data on your
 own server and using it from there.

 Use cron and possibly lynx to grab the raw data that you need on an
 appropriate schedule (say every six hours or, alternately, around an
 hour after normal release time for each forecast) and either process it
 straight away to produce the display information you need or store it
 locally to be processed each time the page loads.  Ideally, you'd create
 a static version of the page each time you grab new forecast information
 and just display it.

 Once you have the data on your server you can process it accordingly
 which is where the php comes in.  The major hurdle is in pattern
 matching and the like to find the relevant bit.

 I am currently doing something moderately similar to this on
 www.outbackqld.net.au (current conditions in top right corner) and it is
 working just fine with an update every hour or so being cached locally.

 I'm happy to discuss the issues of doing this further but am not
 actually using php for anything but the last step - the rest of the
 solution is done using a combination of cron, lynx and grep.

 CYA, Dave






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php