php-general Digest 5 Oct 2002 06:16:07 -0000 Issue 1625

Topics (messages 118900 through 118942):

Need help with fsockopen()
        118900 by: Cliff Small
        118901 by: bbonkosk.tampabay.rr.com

PHP debugger
        118902 by: Anna Gyor

Modifying the size of a jpg.
        118903 by: nicos.php.net

Re: Distance Script Available?
        118904 by: Edward Marczak

Uploading Files
        118905 by: Jason
        118906 by: eriol
        118907 by: Jason
        118914 by: eriol

Re: Incrementing the value
        118908 by: Jason D

Execution Time
        118909 by: Pong-TC
        118911 by: Mark Olton

Problem uploading PDF files
        118910 by: Wilmar Perez

elseifs and ereg
        118912 by: Bryan Koschmann - GKT
        118913 by: Nick Eby
        118915 by: Bryan Koschmann - GKT
        118919 by: John W. Holmes

Copying array segments
        118916 by: Lon Lentz
        118917 by: Rasmus Lerdorf
        118918 by: Robert Cummings

Re: Stuck at PHP4 installation( with Apache2 )
        118920 by: kramer

unexpected t varable
        118921 by: Gary
        118922 by: John W. Holmes
        118923 by: Gary
        118924 by: John W. Holmes
        118925 by: Gary

One Session ID, Multiple Domains
        118926 by: SpamSucks86
        118928 by: John W. Holmes

Re: recent encrpyt decrypt code... (problems)
        118927 by: Tom Rogers

Re: access denied
        118929 by: Chen Shuang
        118930 by: Timothy J Hitchens

Findng a pattern
        118931 by: Henry
        118932 by: Rasmus Lerdorf
        118933 by: Timothy J Hitchens
        118934 by: Henry
        118935 by: Henry
        118936 by: Timothy J Hitchens
        118937 by: Henry
        118938 by: Rasmus Lerdorf
        118939 by: Timothy J Hitchens
        118940 by: Henry
        118941 by: Henry

sending post without a form
        118942 by: Pablo Oliva

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I have a script that downloads html pages from many different sites.  The
script executes as expected but is sloooooooow.  I would like to replace
fopen() with fsockopen() so that I can set a time limit for the page
downloads.  Here is an example of how I'm using fopen():

$OpenFile = fopen("$site_url", 80);  //$site_url =
www.domainname.com/complete/path/to/the/page.htm
$getFile = fread($OpenFile, 50000);

Simply put, how do I do the exact same thing as above with fsockopen().

Thanks,
Cliff





--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/function.fsockopen.php

Seems to be A LOT of useful information there?  Did you check it out?
-Brad

> I have a script that downloads html pages from many different sites.  The
> script executes as expected but is sloooooooow.  I would like to replace
> fopen() with fsockopen() so that I can set a time limit for the page
> downloads.  Here is an example of how I'm using fopen():
> 
> $OpenFile = fopen("$site_url", 80);  //$site_url =
> www.domainname.com/complete/path/to/the/page.htm
> $getFile = fread($OpenFile, 50000);
> 
> Simply put, how do I do the exact same thing as above with fsockopen().
> 
> Thanks,
> Cliff
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 




--- End Message ---
--- Begin Message ---
Hello,

is there any application with I can test my php-based web site? I know Zend
Studio and PHPEdit but I can't use them if any variable comes from an other
html site.

(For example in logging there are loginname and password as html variable
and the debugger don't see them and the script doesn't works.)

Thanks!


--- End Message ---
--- Begin Message ---
Hello,

    I'm trying to modify the size of jpgs so they can be less big, so easily
downloadable. If anyone has worked on it, contact me please.

    Thanks.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet



--- End Message ---
--- Begin Message ---
On 10/4/02 8:21 AM, "RoyW" <[EMAIL PROTECTED]> tapped the keys:

> There has to be somewhere you can pick up a script or function that will
> calculate distance?

If you can search by US Zip Code or lat/long, search the archives of this
list for 'proximity'.  You'll find this comes up quite often.  Also, I
believe PHP Classes
(http://www.phpclasses.org/mirrors.html?page=%2Findex.html) has some scripts
that do this (based on zip).
-- 
Ed Marczak
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
I would like to be able to upload files from the client computer to the
server via a form.  I know how to build the form, but am not sure of the
best way to process this.  I know there are certain ftp functions that can
do this, which I'm not sure how to use.  Are there any others?

Jason D. Williard


--- End Message ---
--- Begin Message ---

"Jason" <[EMAIL PROTECTED]> disgorged: 

: I would like to be able to upload files from the client computer to the
: server via a form.  I know how to build the form, but am not sure of the
: best way to process this.  I know there are certain ftp functions that can
: do this, which I'm not sure how to use.  Are there any others?

====

http://www.php.net/manual/en/features.file-upload.php

More specifically, move_uploaded_file() and is_uploaded_file()

HTH..

Take care.. peace..
eriol

--- End Message ---
--- Begin Message ---
Okay, I checked out the link listed below, and tried using what is given
there, but I get the following error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in
d:\www_root\locutus\phpman\admin\test.php on line 16

Here's the code that I am using:

<form enctype="multipart/form-data" action="test.php" method="post">
    <input type="hidden" name="MAX_FILE_SIZE" value="100000">
    Send this file: <input name="userfile" type="file">
    <input type="submit" value="Send File">
</form>

<?php
move_uploaded_file($_FILES['userfile']['tmp_name'],
"../images/$_FILES['userfile']['name']");
?>

I am able to get rid of this error, but changing the line to:
move_uploaded_file($_FILES['userfile']['tmp_name'],
"../images/$_FILES[userfile][name]");

However, the file is then uploaded as Array[name]

How do I get past this?

Jason Williard

"Eriol" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> "Jason" <[EMAIL PROTECTED]> disgorged:
>
> : I would like to be able to upload files from the client computer to the
> : server via a form.  I know how to build the form, but am not sure of the
> : best way to process this.  I know there are certain ftp functions that
can
> : do this, which I'm not sure how to use.  Are there any others?
>
> ====
>
> http://www.php.net/manual/en/features.file-upload.php
>
> More specifically, move_uploaded_file() and is_uploaded_file()
>
> HTH..
>
> Take care.. peace..
> eriol
>


--- End Message ---
--- Begin Message ---
"Jason" <[EMAIL PROTECTED]> disgorged:

: <?php
: move_uploaded_file($_FILES['userfile']['tmp_name'],
: "../images/$_FILES['userfile']['name']");
: ?>
:
: I am able to get rid of this error, but changing the line to:
: move_uploaded_file($_FILES['userfile']['tmp_name'],
: "../images/$_FILES[userfile][name]");
:
: However, the file is then uploaded as Array[name]
:
: How do I get past this?

====

I'm not 100% sure this will work, but try this:

<?php
$savetopath = "/path/to/your/upload/area" . $userfile;
mode_uploaded_file($_FILES['userfile']['tmp_name'], $savetopath);
?>

If you're using $_FILES, I assume you have Register_Globals = on?  If not, use
$HTTP_POST_FILES instead.. From 4.2.0 on register globals is off in the
php.ini by default..  Also, you might try hotscripts.com for file upload
scripts that allow one or multiple files at a time.. There may be a script
there that's already created that'll serve your purpose..

http://www.hotscripts.com/PHP/Scripts_and_Programs/File_Manipulation/Upload_Sy
stems/

HTH..

Take care.. peace..
eriol


--- End Message ---
--- Begin Message ---
It's not very clear what you want but the following could be it:

<?if(!isset($_GET['hid']))
{$h=1;}
else
{$h=$_GET['hid'];}?>

<a href="Delay.php?hid=<?php echo $h+1; ?>">
<img src="Gif/nextque.gif" border="0"></a>




> i have written code such that initially it will display the value 
> correspond to the value 1..after every click it will increment the value 
> 2,3...so on..but now it is displaying the value 1 and for after each click 
> again it is displaying 1 and 2...so on

> I have intiallised the value for the variable as 

> if(!$_GET['hid'])
> $hid=1;

> like that..Can anyone please tell me how to avoid displaying the value 1 
> again..??




____________________________________________________________
Watch a championship game with Elway or McGwire.
Enter Now at http://champions.lycos.com 
--- End Message ---
--- Begin Message ---
Hello All

I have a problem with the execution time.  I use PHP to update database,
but it could not perform well due to the limited execution time.  How
could I extend the execution time?  Here is my error:

Fatal error: Maximum execution time of 30 seconds exceeded in
d:\inetpub\wwwroot\cgi-bin\finaid\upfinwhole.php on line 468

I am using PHP on IIS5 as a cgi.

Thank you.
Pong

--- End Message ---
--- Begin Message ---

Edit your php.ini, change "max_execution_time" to something greater than
30.

Mark


> -----Original Message-----
> From: Pong-TC [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, October 04, 2002 2:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Execution Time
> 
> 
> Hello All
> 
> I have a problem with the execution time.  I use PHP to 
> update database,
> but it could not perform well due to the limited execution time.  How
> could I extend the execution time?  Here is my error:
> 
> Fatal error: Maximum execution time of 30 seconds exceeded in
> d:\inetpub\wwwroot\cgi-bin\finaid\upfinwhole.php on line 468
> 
> I am using PHP on IIS5 as a cgi.
> 
> Thank you.
> Pong
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


--- End Message ---
--- Begin Message ---
Hello guys

I do have a problem uploading PDF files.  Whenever I try to upload a PDF 
file, the enviromental variable of the file field in the form gets set 
to "none", otherwise it goes fine.

Any idea?

*******************************************************
                         Wilmar Pérez
                     Network Administrator
                       Library System
                      Tel: ++57(4)2105145
                    University of Antioquia
                       Medellín - Colombia
                              2002    
*******************************************************                
 
         
--- End Message ---
--- Begin Message ---
Okay, I think I'm just being stupid here. Can someone please tell me why
this is wrong? Yeah I know it looks lame, but I'm just testing something.

This always returns "no matches"

Thanks,

        Bryan

<?

$now = strtotime("now");
$out = "never set";
if ($now == ereg("[2200-2230]"))
        $out = "special";
elseif ($now == ereg("[0600-1159]"))
        $out = "morning";
elseif ($now == ereg("[1200-1659]"))
        $out = "afternoon";
elseif ($now == ereg("[1700-1959]"))
        $out = "evening";
elseif ($now == ereg("[2000-0000]"))
        $out = "night";
elseif ($now == ereg("[0001-0559]"))
        $out = "too late";
else
        $out = "no matches";

print(date("Hi", $now));
print "\n$out\n";


?>


--- End Message ---
--- Begin Message ---
check the manual page for ereg... you'll find that it takes 2 parameters
minimum, and the return value is not what your code expects it to be.
http://www.php.net/ereg

"Bryan Koschmann - Gkt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Okay, I think I'm just being stupid here. Can someone please tell me why
> this is wrong? Yeah I know it looks lame, but I'm just testing something.
>
> This always returns "no matches"
>
> Thanks,
>
> Bryan
>
> <?
>
> $now = strtotime("now");
> $out = "never set";
> if ($now == ereg("[2200-2230]"))
>         $out = "special";
> elseif ($now == ereg("[0600-1159]"))
>         $out = "morning";
> elseif ($now == ereg("[1200-1659]"))
>         $out = "afternoon";
> elseif ($now == ereg("[1700-1959]"))
>         $out = "evening";
> elseif ($now == ereg("[2000-0000]"))
>         $out = "night";
> elseif ($now == ereg("[0001-0559]"))
>         $out = "too late";
> else
>         $out = "no matches";
>
> print(date("Hi", $now));
> print "\n$out\n";
>
>
> ?>
>
>


--- End Message ---
--- Begin Message ---
Err, yeah, I just figured that out. So now I have this, but it always
matches the first. I even tried setting $now = "2221"

Thanks for the help!

        Bryan

<?

$now = date("Hi", strtotime("now"));
$out = "not set";

if (ereg("[2200-2230]", $now))
        $out = "special";
elseif (ereg("[0600-1159]", $now))
        $out = "morning";
elseif (ereg("[1200-1659]", $now))
        $out = "afternoon";
elseif (ereg("[1700-1959]", $now))
        $out = "evening";
elseif (ereg("[2000-0000]", $now))
        $out = "night";
elseif (ereg("[0001-0559]", $now))
        $out = "too late";
else
        $out = "no matches";

echo "$now\n";
echo "$out\n";



?>



--- End Message ---
--- Begin Message ---
> Err, yeah, I just figured that out. So now I have this, but it always
> matches the first. I even tried setting $now = "2221"
> 
> Thanks for the help!
> 
>       Bryan
> 
> <?
> 
> $now = date("Hi", strtotime("now"));
> $out = "not set";

Hey...you've got that right now...kind of.
 
> if (ereg("[2200-2230]", $now))
>         $out = "special";

Go back to the manual, please. Your ereg string is only matching (or
looking to match) one character. You are looking for a single character
in your string that is a 2 or 2 or 0 to 2 or 2 or 3 or 0. That'll match
"2221" every time...

Why are you using ereg when a less than / greater than will work faster
and easier?

---John Holmes...

> elseif (ereg("[0600-1159]", $now))
>         $out = "morning";
> elseif (ereg("[1200-1659]", $now))
>         $out = "afternoon";
> elseif (ereg("[1700-1959]", $now))
>         $out = "evening";
> elseif (ereg("[2000-0000]", $now))
>         $out = "night";
> elseif (ereg("[0001-0559]", $now))
>         $out = "too late";
> else
>         $out = "no matches";


--- End Message ---
--- Begin Message ---

  I've got an array that is 5 arrays deep, and I want to copy the array
three levels down of one index into a new array.

  Example: $output['recommendernames'][0]['recommendername'][0]['com'];

  This is what I want to do:

         $newoutput = $output['recommendernames'][0]['recommendername'];

  So that newoutput is an array that is two arrays deep:
$newoutput[0]['com']

  Is there a special function for this?



__________________________
Lon Lentz
Applications Developer
EXImpact.com


--- End Message ---
--- Begin Message ---
>   I've got an array that is 5 arrays deep, and I want to copy the array
> three levels down of one index into a new array.
>
>   Example: $output['recommendernames'][0]['recommendername'][0]['com'];
>
>   This is what I want to do:
>
>        $newoutput = $output['recommendernames'][0]['recommendername'];
>
>   So that newoutput is an array that is two arrays deep:
> $newoutput[0]['com']
>
>   Is there a special function for this?

None needed.  You just did it.

-Rasmus

--- End Message ---
--- Begin Message ---
Rasmus Lerdorf wrote:
> 
> >   I've got an array that is 5 arrays deep, and I want to copy the array
> > three levels down of one index into a new array.
> >
> >   Example: $output['recommendernames'][0]['recommendername'][0]['com'];
> >
> >   This is what I want to do:
> >
> >        $newoutput = $output['recommendernames'][0]['recommendername'];
> >
> >   So that newoutput is an array that is two arrays deep:
> > $newoutput[0]['com']
> >
> >   Is there a special function for this?
> 
> None needed.  You just did it.

*giggle* That's +1 for having a zen for the obvious ;)

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                     |
`----------------------------------------------'
--- End Message ---
--- Begin Message ---
Thanks Erwin. Unfortunately it doesn't work, even after I copied php4ts.dll.

How would I specify the drive:\Program Files, which has a space in-between.
Should I include single or double quote ?

I tried all these combinations...

LoadModule php4_module F:/Progra~1/php-4.2.3-Win32/php4ts.dll
LoadModule php4_module 'F:/Program Files/php-4.2.3-Win32/php4ts.dll'
LoadModule php4_module "F:/Program Files/php-4.2.3-Win32/php4ts.dll"
LoadModule php4_module "F:/Progra~1/php-4.2.3-Win32/sapi/php4apache2.dll"

LoadModule php4_module D:/WINNT/system32/php4ts.dll
LoadModule php4_module 'D:/WINNT/system32/php4ts.dll'
LoadModule php4_module 'D:/WINNT/system32/php4ts.dll'


"Erwin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Kramer wrote:
> > hi,
> >
> > I've Apache 2 running fine in my Windows 2000 machine. I installed PHP
> > 4.2.3( from the zip-file method ).
> > I copied php4apache.dll and php4apache2.dll to /WINNT/system32 and
> > /WINNT as well( to be safe ).
> >
> > In my httpd.conf, either of the following startments are causing the
> > Apache to not start...
> > LoadModule php4_module F:/Progra~1/php-4.2.3-
> > Win32/sapi/php4apache2.dll LoadModule php4_module
> > "D:/WINNT/system32/php4apache2.dll"
>
> Don't copy php4apache2.dll to the \winnt\system32 or \winnt directory,
> because it's not required, but copy php4ts.dll to the system32 directory
> instead. If you're using any extensions that require external libraries
> (take a look in your php installation directory, subdirectory dlls), then
> they should be copied to.
>
> HTH
> Erwin
>


--- End Message ---
--- Begin Message ---
Can someone tell where I messed up on this code snippit?

if ($res->numRows() > 0){
                                list($id, $question, $responce1, $responce2, 
$responce3) =  $res->fetchRows()
                       $id = $row[0];
                        $question = $row[1];
                        $responce1 = $row[2];
                        $responce2 = $row[3];
                        $responce3 = $row[4];
                }

TIA
Gary

--- End Message ---
--- Begin Message ---
> Can someone tell where I messed up on this code snippit?

Your first mistake is not giving us the full error and the line
number...
 
> if ($res->numRows() > 0){
>                               list($id, $question, $responce1,
$responce2,
> $responce3) =  $res->fetchRows()

and you're missing a ; here... ^^

>                      $id = $row[0];
>                       $question = $row[1];
>                       $responce1 = $row[2];
>                       $responce2 = $row[3];
>                       $responce3 = $row[4];
>               }

---John Holmes...


--- End Message ---
--- Begin Message ---
John W. Holmes wrote:
>>Can someone tell where I messed up on this code snippit?
> 
> 
> Your first mistake is not giving us the full error and the line
> number...
>  
> 
>>if ($res->numRows() > 0){
>>                              list($id, $question, $responce1,
> 
> $responce2,
> 
>>$responce3) =  $res->fetchRows()
> 
> 
> and you're missing a ; here... ^^
> 
> 
>>                     $id = $row[0];
>>                      $question = $row[1];
>>                      $responce1 = $row[2];
>>                      $responce2 = $row[3];
>>                      $responce3 = $row[4];
>>              }
> 
> 
> ---John Holmes...
> 
> 

that fixed the unexpected t_variable but now it is Fatal error: Call to 
undefined function: fetchrows()

list($id, $question, $responce1, $responce2,$responce3) =  $res->fetchRows()

gary

--- End Message ---
--- Begin Message ---
> John W. Holmes wrote:
> >>Can someone tell where I messed up on this code snippit?
> >
> >
> > Your first mistake is not giving us the full error and the line
> > number...
> >
> >
> >>if ($res->numRows() > 0){
> >>                            list($id, $question, $responce1,
> >
> > $responce2,
> >
> >>$responce3) =  $res->fetchRows()
> >
> >
> > and you're missing a ; here... ^^
> >
> >
> >>                   $id = $row[0];
> >>                    $question = $row[1];
> >>                    $responce1 = $row[2];
> >>                    $responce2 = $row[3];
> >>                    $responce3 = $row[4];
> >>            }
> >
> >
> > ---John Holmes...
> >
> >
> 
> that fixed the unexpected t_variable but now it is Fatal error: Call
to
> undefined function: fetchrows()
> 
> list($id, $question, $responce1, $responce2,$responce3) =  $res-
> >fetchRows()

That means there is no function fetchrows() associated with whatever
class $res comes from...

---John Holmes...


--- End Message ---
--- Begin Message ---
John W. Holmes wrote:

>>John W. Holmes wrote:
>>    
>>
>>>>Can someone tell where I messed up on this code snippit?
>>>>        
>>>>
>>>Your first mistake is not giving us the full error and the line
>>>number...
>>>
>>>
>>>      
>>>
>>>>if ($res->numRows() > 0){
>>>>                            list($id, $question, $responce1,
>>>>        
>>>>
>>>$responce2,
>>>
>>>      
>>>
>>>>$responce3) =  $res->fetchRows()
>>>>        
>>>>
>>>and you're missing a ; here... ^^
>>>
>>>
>>>      
>>>
>>>>                   $id = $row[0];
>>>>                    $question = $row[1];
>>>>                    $responce1 = $row[2];
>>>>                    $responce2 = $row[3];
>>>>                    $responce3 = $row[4];
>>>>            }
>>>>        
>>>>
>>>---John Holmes...
>>>
>>>
>>>      
>>>
>>that fixed the unexpected t_variable but now it is Fatal error: Call
>>    
>>
>to
>  
>
>>undefined function: fetchrows()
>>
>>list($id, $question, $responce1, $responce2,$responce3) =  $res-
>>    
>>
>>>fetchRows()
>>>      
>>>
>
>That means there is no function fetchrows() associated with whatever
>class $res comes from...
>  
>

I think it is time to call it a day. It is 11pm and I am getting so 
punchy from this long day, I forgot to say it is a db call using pearDB. 
If I remove the code and replace it with  while ($row  = 
$res->fetchRows()) along the row array it work but then I can't check 
for > 0


Sorry
Gary

>
>
>
>  
>



--- End Message ---
--- Begin Message ---
Is it possible to have one session ID and access it from two domains?

 

Here's the situation: I have an online store. I use sessions to track
the shopping cart. When I go to checkout and switch to SSL, it's on
another domain (but still on the same machine). I need to access the
session data from the non-SSL domain for checkout. How can I go about
doing this? Passing the session ID through POST and GET didn't work, PHP
just ignored it. Any help is greatly appreciated!

--- End Message ---
--- Begin Message ---
> Here's the situation: I have an online store. I use sessions to track
> the shopping cart. When I go to checkout and switch to SSL, it's on
> another domain (but still on the same machine). I need to access the
> session data from the non-SSL domain for checkout. How can I go about
> doing this? Passing the session ID through POST and GET didn't work,
PHP
> just ignored it. Any help is greatly appreciated!

How did you pass it and how did you start the new session with it? 

I can't get to the manual, but I think you have to use session_name() to
set the name before you call session_start(). You use the session id
passed in GET or POST in the session_name call. 

As long as it's on the same box, it should work fine, as PHP will look
in the same place for the session file to load. 

---John Holmes...


--- End Message ---
--- Begin Message ---
Hi,

Saturday, October 5, 2002, 4:10:03 AM, you wrote:
JB> I had not downloaded mcrypt, but I download it (which required a later
JB> version of mhash so I downloaded, and installed it too).  I compiled
JB> everything with the instrucitons you listed, and I am still getttng the same
JB> error messages.

I just recompiled using the latest versions of libmcrypt - mcrypt -
mhash and it still works ok. I don't use dynamic loading of php it is
built into apache statically.....
What version of PHP/apache are you using? .. I use 4.2.3

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
try CHMODing your files and your directory to 777, since i believe you are
using a Linux Server.

"Simon Angell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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.
>
>


--- End Message ---
--- Begin Message ---
Please don't 777 anything... do you have shell access (if
platform/access supports it)
login and and see what the perms are and work on the problem don't
hammer it with a fix all.


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Chen Shuang [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, 3 October 2002 7:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: access denied


try CHMODing your files and your directory to 777, since i believe you
are using a Linux Server.

"Simon Angell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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


--- End Message ---
--- Begin Message ---
Dear All,

Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.

$str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search took
<b>0.04</b> seconds."

I would like to look for the string above in a buffer of text. However I
would like to find it even if the numeric are different. Furthermore I would
like to know what the values are. Is there a simple way to do this?

TIA

Henry





--- End Message ---
--- Begin Message ---
Google has a SOAP interface for this.

On Sat, 5 Oct 2002, Henry wrote:

> Dear All,
>
> Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.
>
> $str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search took
> <b>0.04</b> seconds."
>
> I would like to look for the string above in a buffer of text. However I
> would like to find it even if the numeric are different. Furthermore I would
> like to know what the values are. Is there a simple way to do this?
>
> TIA
>
> Henry
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Are you saying you want to be able to extract the numbers etc?


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]

HiTCHO has Spoken!






-----Original Message-----
From: Henry [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, 5 October 2002 2:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Findng a pattern


Dear All,

Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.

$str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search took
<b>0.04</b> seconds."

I would like to look for the string above in a buffer of text. However I
would like to find it even if the numeric are different. Furthermore I
would like to know what the values are. Is there a simple way to do
this?

TIA

Henry






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


--- End Message ---
--- Begin Message ---
Thanks, but I don't want to uses google's SOAP interface, is there a preg
type solution.


"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Google has a SOAP interface for this.
>
> On Sat, 5 Oct 2002, Henry wrote:
>
> > Dear All,
> >
> > Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.
> >
> > $str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search took
> > <b>0.04</b> seconds."
> >
> > I would like to look for the string above in a buffer of text. However I
> > would like to find it even if the numeric are different. Furthermore I
would
> > like to know what the values are. Is there a simple way to do this?
> >
> > TIA
> >
> > Henry
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>


--- End Message ---
--- Begin Message ---
Yes

But that the string is contained within a much bigger string as well

I want to search for the follwong string but with wild cards for the numeric
values and I would like to know the values as well.

"Results <b>$1</b> - <b>$2</b> of about <b>$3</b>.   Search took <b>$4</b>
seconds."

Where all the $'s are numeric values

Henry

"Timothy J Hitchens" <[EMAIL PROTECTED]> wrote in message
001001c26c2a$927a9ad0$0500a8c0@BAMBINO">news:001001c26c2a$927a9ad0$0500a8c0@BAMBINO...
> Are you saying you want to be able to extract the numbers etc?
>
>
> Timothy Hitchens (HiTCHO)
> [EMAIL PROTECTED]
>
> HiTCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Henry [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, 5 October 2002 2:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Findng a pattern
>
>
> Dear All,
>
> Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.
>
> $str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search took
> <b>0.04</b> seconds."
>
> I would like to look for the string above in a buffer of text. However I
> would like to find it even if the numeric are different. Furthermore I
> would like to know what the values are. Is there a simple way to do
> this?
>
> TIA
>
> Henry
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Are the value in the same order each time?


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Henry [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, 5 October 2002 2:44 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Findng a pattern


Thanks, but I don't want to uses google's SOAP interface, is there a
preg type solution.


"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Google has a SOAP interface for this.
>
> On Sat, 5 Oct 2002, Henry wrote:
>
> > Dear All,
> >
> > Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.
> >
> > $str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search took
> > <b>0.04</b> seconds."
> >
> > I would like to look for the string above in a buffer of text. 
> > However I would like to find it even if the numeric are different. 
> > Furthermore I
would
> > like to know what the values are. Is there a simple way to do this?
> >
> > TIA
> >
> > Henry
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>



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


--- End Message ---
--- Begin Message ---
Yes

The string will always be the same and the repective values will always have
the same meaning.

"Timothy J Hitchens" <[EMAIL PROTECTED]> wrote in message
001101c26c2b$55adc400$0500a8c0@BAMBINO">news:001101c26c2b$55adc400$0500a8c0@BAMBINO...
> Are the value in the same order each time?
>
>
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Henry [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, 5 October 2002 2:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Findng a pattern
>
>
> Thanks, but I don't want to uses google's SOAP interface, is there a
> preg type solution.
>
>
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Google has a SOAP interface for this.
> >
> > On Sat, 5 Oct 2002, Henry wrote:
> >
> > > Dear All,
> > >
> > > Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.
> > >
> > > $str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search took
> > > <b>0.04</b> seconds."
> > >
> > > I would like to look for the string above in a buffer of text.
> > > However I would like to find it even if the numeric are different.
> > > Furthermore I
> would
> > > like to know what the values are. Is there a simple way to do this?
> > >
> > > TIA
> > >
> > > Henry
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
You realize that you are asking us to help you violate the terms of
service of Google?

A direct quote from their terms of service:

  "You may not take the results from a Google search and reformat and
   display them, or mirror the Google home page or results pages on your
   Web site."

-Rasmus

On Sat, 5 Oct 2002, Henry wrote:

> Thanks, but I don't want to uses google's SOAP interface, is there a preg
> type solution.
>
>
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Google has a SOAP interface for this.
> >
> > On Sat, 5 Oct 2002, Henry wrote:
> >
> > > Dear All,
> > >
> > > Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.
> > >
> > > $str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search took
> > > <b>0.04</b> seconds."
> > >
> > > I would like to look for the string above in a buffer of text. However I
> > > would like to find it even if the numeric are different. Furthermore I
> would
> > > like to know what the values are. Is there a simple way to do this?
> > >
> > > TIA
> > >
> > > Henry
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---



Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Henry [mailto:[EMAIL PROTECTED]] 
Try this.. but take what Rasmus says if you are talking about Google:

<?php

$string = "Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search
took <b>0.14</b>seconds.";

preg_match_all("/[0-9]+[.]*[0-9]*/", $string, $result);

print_r($result);

?>


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






Sent: Saturday, 5 October 2002 2:50 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Findng a pattern


Yes

The string will always be the same and the repective values will always
have the same meaning.

"Timothy J Hitchens" <[EMAIL PROTECTED]> wrote in message
001101c26c2b$55adc400$0500a8c0@BAMBINO">news:001101c26c2b$55adc400$0500a8c0@BAMBINO...
> Are the value in the same order each time?
>
>
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Henry [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, 5 October 2002 2:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Findng a pattern
>
>
> Thanks, but I don't want to uses google's SOAP interface, is there a 
> preg type solution.
>
>
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message 
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Google has a SOAP interface for this.
> >
> > On Sat, 5 Oct 2002, Henry wrote:
> >
> > > Dear All,
> > >
> > > Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.
> > >
> > > $str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search
took
> > > <b>0.04</b> seconds."
> > >
> > > I would like to look for the string above in a buffer of text. 
> > > However I would like to find it even if the numeric are different.

> > > Furthermore I
> would
> > > like to know what the values are. Is there a simple way to do 
> > > this?
> > >
> > > TIA
> > >
> > > Henry
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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


--- End Message ---
--- Begin Message ---
Dear Rasmus et.al.

I am not wishing to reformat or display or mirror anything from google.

This is for my own internal statistics.

I hope that puts your mind at rest.

Henry

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You realize that you are asking us to help you violate the terms of
> service of Google?
>
> A direct quote from their terms of service:
>
>   "You may not take the results from a Google search and reformat and
>    display them, or mirror the Google home page or results pages on your
>    Web site."
>
> -Rasmus
>
> On Sat, 5 Oct 2002, Henry wrote:
>
> > Thanks, but I don't want to uses google's SOAP interface, is there a
preg
> > type solution.
> >
> >
> > "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Google has a SOAP interface for this.
> > >
> > > On Sat, 5 Oct 2002, Henry wrote:
> > >
> > > > Dear All,
> > > >
> > > > Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.
> > > >
> > > > $str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search took
> > > > <b>0.04</b> seconds."
> > > >
> > > > I would like to look for the string above in a buffer of text.
However I
> > > > would like to find it even if the numeric are different. Furthermore
I
> > would
> > > > like to know what the values are. Is there a simple way to do this?
> > > >
> > > > TIA
> > > >
> > > > Henry
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>


--- End Message ---
--- Begin Message ---
Thanks

"Timothy J Hitchens" <[EMAIL PROTECTED]> wrote in message
001201c26c2c$5b7091a0$0500a8c0@BAMBINO">news:001201c26c2c$5b7091a0$0500a8c0@BAMBINO...
>
>
>
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Henry [mailto:[EMAIL PROTECTED]]
> Try this.. but take what Rasmus says if you are talking about Google:
>
> <?php
>
> $string = "Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search
> took <b>0.14</b>seconds.";
>
> preg_match_all("/[0-9]+[.]*[0-9]*/", $string, $result);
>
> print_r($result);
>
> ?>
>
>
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
>
> HITCHO has Spoken!
>
>
>
>
>
>
> Sent: Saturday, 5 October 2002 2:50 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Findng a pattern
>
>
> Yes
>
> The string will always be the same and the repective values will always
> have the same meaning.
>
> "Timothy J Hitchens" <[EMAIL PROTECTED]> wrote in message
> 001101c26c2b$55adc400$0500a8c0@BAMBINO">news:001101c26c2b$55adc400$0500a8c0@BAMBINO...
> > Are the value in the same order each time?
> >
> >
> > Timothy Hitchens (HITCHO)
> > [EMAIL PROTECTED]
> >
> > HITCHO has Spoken!
> >
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Henry [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, 5 October 2002 2:44 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Findng a pattern
> >
> >
> > Thanks, but I don't want to uses google's SOAP interface, is there a
> > preg type solution.
> >
> >
> > "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Google has a SOAP interface for this.
> > >
> > > On Sat, 5 Oct 2002, Henry wrote:
> > >
> > > > Dear All,
> > > >
> > > > Excuse my ignorance but I'm STILL a newbie to this aspect of PHP.
> > > >
> > > > $str="Results <b>1</b> - <b>10</b> of about <b>14</b>.   Search
> took
> > > > <b>0.04</b> seconds."
> > > >
> > > > I would like to look for the string above in a buffer of text.
> > > > However I would like to find it even if the numeric are different.
>
> > > > Furthermore I
> > would
> > > > like to know what the values are. Is there a simple way to do
> > > > this?
> > > >
> > > > TIA
> > > >
> > > > Henry
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Did the individual trying to send post(ed) data without the use of a
form succeed?  I tried doing this before and didn't have any luck with
it... And I eventually gave up.

Has anybody had any luck in doing it?

--- End Message ---

Reply via email to