RE: [PHP] Getting PHP to submit a form to google

2002-08-15 Thread David Piasecki

Use the google API...
http://www.google.com/apis/


- David


-Original Message-
From: Henry [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 12:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting PHP to submit a form to google

Hi all

I would like to be able to get the result of a search from google.
Namely I
would like to write a PHP script that will generate and submit a form
(internally i.e. on the server) using the GET method to
http://www.google.com/search setting the field q to the search words.
It
should then parse the results so that I can feed them back to the user
in a
form that I choose.

How should/can I go about 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




RE: [PHP] Sessions and Load Balancing

2002-04-25 Thread David Piasecki

We use sessions on one of our extremely large (read: may load balanced
servers). Our solution is to store session data in the database. See the
following:

http://www.php.net/session-set-save-handler


David Piasecki


-Original Message-
From: Uijlenbroek, Maurice
[mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 25, 2002 5:43 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Sessions and Load Balancing

Dear group,


My hosting provider is using Load Balancing (4 servers, Apache 1.13.20 /
PHP
4.1.2).

I started the developing of a site with the idea of using sessions.
Can I continue using sessions when I point the session_save_path to a
directory on my domein? Or do I run into problems? I thought that the
SID
returned to every browser (client), so when I store the session on my
domein, every server can find the ID, right?

Please respond to my emailaddress directly
([EMAIL PROTECTED]).

Thanks in advance!


Maurice Uijlenbroek


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




RE: [PHP] Searching a string or similar

2001-12-28 Thread David Piasecki

This should be a better alternative:

http://www.php.net/manual/en/function.strip-tags.php



-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 28, 2001 11:14 AM
To: Ash
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Searching a string or similar

if (strpos(SCRIPT LANGUAGE = Javascript,$input_string)===false) {
  echo(Yeah, right!);
  exit;
}

You'll have a lot of problems, though, because
1. You also need to check for script type=text/javascript;
2. You have to strtolower() both strings in order to eliminate
capitalization
differences;
3. and the tougher: how do you check for this one:
script language  ='javascript' \t, where
\t
is a tab character? And obviously all the possible combinations...

Bogdan

Ash wrote:

 Hi i've taken a look throught he manual and i can't find a function to
do
 this

 Basically i want to take in a string and check that the string doesn't
 contain a certain word or something

 ie check that it doesn't contain SCRIPT LANGUAGE = Javascript to
prevent
 hackers/crackers on my guestbook

 Thanks

 Ash

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] crack lib

2001-12-27 Thread David Piasecki

This could easily and quickly lead to a philosophical argument about the
merits of such software/libraries/etc. Is the best way to secure
software and hardware to take away the resources to try to break them?
This only leads to more and more poor programming. As long as these
tools are out there, it should keep all of us on our toes, and
programming with security constantly on our minds.

Removing those functions give the gates/Microsoft/.net community an
excuse to keep programming the way they have always been.


-Original Message-
From: Billy Harvey [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 27, 2001 4:29 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] crack lib

On Thu, 2001-12-27 at 19:12, Dennis Gearon wrote:
 If the crack lib functions are for cracking passwords or other non
 commerce/offensive/hacker efforts, I strongly object to their
inclusion in the
 functions of PHP. The PHP/Apache community does not need to give the
 gates/microsoft/.net community any ammunition for bad publicity.

Object away.  They exist because they exist and are useful.  The
concepts have been around for years and are easily implemntable in any
programming language.

That's the value and risk of freedom - it cuts both ways.

Billy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: Remote image

2001-12-19 Thread David Piasecki

Is anyone familiar with the overhead that this type of system might
create, as compared to a standard request/response to apache? That is,
to have PHP intercept the request for an image, check HTTP_REFERER - if
it is null or from the local server, open the file, redirect to browser,
close file, if not serve a default error image.

Also, would there be any danger (to the files in particular, but also
with runaway processes or files left open) in using this method if a
user cancels the request mid-stream?

David


-Original Message-
From: Chris Lee [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 18, 2001 9:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Remote image

how those remote servers destinguish where the images are coming from is
from the Referr header.

play around with getting the data manually using
fopen()/fwrite()/fread()
and your done. not so easy eh, well it works.

--

  Chris Lee
  [EMAIL PROTECTED]



Martin Kampherbeek [EMAIL PROTECTED] wrote in message
001201c18290$60da3820$328078d9@cc16349a">news:001201c18290$60da3820$328078d9@cc16349a...
Hi,

I have a problem with a remote image. I hope someone can help me.

People can post their link of their webpage at my site.
I check if the file excists, fopen().
After that I scan the page for links.
And the links for images.
Then I would like to see the sizes of all those images.

The problem is that there are servers that don't allow to brow straight
to
the images, it can only from the page self.
So I look for something in php that surfs the the page en from that page
to
the links.

I hope someone can help me.

Cheers,
Martin.






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Help creating an image repository/library.

2001-12-12 Thread David Piasecki

You don't want to store the files in the root public directory. Create a
subdirectory for uploads, 'public-html/uploads' for example. Make sure
it's permissions are 755. From the command line, 'chown nobody,nobody
uploads' would do it. The syntax for chown is 'chown user,group
file/directory'.

David Piasecki
Software Engineer
Netvolution.com, Inc.
http://www.netvolution.com
548 South Spring Street, Suite 814, Los Angeles CA 90013
Phone: 213-593-1090 x107
Fax: 213-593-1091


-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, December 12, 2001 11:24 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Help creating an image repository/library.

That would be an ideal solution.  But one of my problems is that I'm not
very familiar with permission settings.  All I know about is CHMOD.
What
exactly is CHOWN and how would I set it to allow the script upload to a
public directory without risking the security of the web site?  Thanks!

-Kevin

 Can you chown the directory to the same user as the web server runs as
 (ie. nobody)? At that point, you will be able to upload into that
 directory while retaining the directory permission of 755.



 -Original Message-
 From: Kevin Stone [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 11, 2001 2:50 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Help creating an image repository/library.


 Yes, I do reference the image filename in the database.. regardless of
 where
 I save it.  That is not the issue.

 The problem is that I can not save the image in a location where I can
 access it via a URL (ie. http://www.mydom.com/images/myimage.jpg).  If
I
 could then there would be no problem.  But I am advised to keep the
 directory permissions of the public HTML directory set to 755 which
 means
 that any script excecuting within that directory inherits the user
 permissions (can read, can't write, can execute).  Can't write is
the
 clincher.

 I can save the images outside the public html directory but then I can
 not
 grab the image via a URL.  The only way to access the image is to
fopen
 and
 fread it to the client browser which means that I must set the header
 (Content-type image/jpeg), which means that I can not display HTML
on
 the
 same page.

 It's a catch22..  I can't display an uploaded image along with HTML on
 the
 same page unless it is uploaded to a public directory.  I can not
upload
 toa
 public directory unless I CHMOD it to 777.  I am not allowed to CHMOD
 the
 directory so I have to save the images outside the public html
 directory.  I
 can not display an uploaded image along with HTML when I have to
fread()
 the
 file to the screen.

 **pant pant**

 There will be thousands of images (4000 - 5000 when complete) and it
has
 been advised to me not to save them in a MySQL database as it can
 significantly reduce search times.  Is this true?

 -Kevin Stone

  Presumably, each item in the catalog has a unique id of some sort in
  the database. When you upload the images, you can rename the image
  file to image_(unique_id).jpg. Then when you load a page, you can
  reference the item next to the image.
 
  This is only one way to do it, of course. You could also store the
  image names in another database and link the tables when calling the
  data for the jewelry.
 
  jim
 
 
  I have written a simple image uploading system to go along with a
 simple
  database.  This will be a part of a publiclay accessable search
 engine
 for a
  jewelry companie's web site.  Almost every entry has a
corresponding
 image.
  But that was the easy part...  The problem now is that I need to
 display
 the
  images next to the corresponding info on the same page.
  
  I do not know much about UNIX permissions but I am strongly advised
 to
 keep
  the permission settings on the public-html directory set to 0755 at
 the
 very
  least.  Since the PHP script inhereits user permissions (and not
the
 Owner's
  permission)  this means that I can not upload the files to the
 Public-html
  directory where I could easily grab them with a URL.  The only
place
 I
 have
  access is outside the public html directory.  Of couse I can open
any
 number
  of images I like and read them to the browser screen... but they
can
 not
  mingle with HTML becuase I have to set the header(Content-type:
  image/jpeg) in order to display the image in the first place.
 ARRGGH!
  
  It is forcing me to use frames or a floating window to display the
 images..
  which is absoutely totaly unacceptable.  Aside from being a hack
 solution
  there is no way I can align the images with the corresponding
 database
 info.
  And inline frames are not supported by all browsers.
  
  *sigh*
  
  I am being blocked on all ends and I need a solution fast.  Any
help
 will
 be
  **GREATLY** appreciated.
  
  -Kevin Stone
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL

RE: [PHP] Help creating an image repository/library.

2001-12-11 Thread David Piasecki

Can you chown the directory to the same user as the web server runs as
(ie. nobody)? At that point, you will be able to upload into that
directory while retaining the directory permission of 755.



-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 11, 2001 2:50 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Help creating an image repository/library.


Yes, I do reference the image filename in the database.. regardless of
where
I save it.  That is not the issue.

The problem is that I can not save the image in a location where I can
access it via a URL (ie. http://www.mydom.com/images/myimage.jpg).  If I
could then there would be no problem.  But I am advised to keep the
directory permissions of the public HTML directory set to 755 which
means
that any script excecuting within that directory inherits the user
permissions (can read, can't write, can execute).  Can't write is the
clincher.

I can save the images outside the public html directory but then I can
not
grab the image via a URL.  The only way to access the image is to fopen
and
fread it to the client browser which means that I must set the header
(Content-type image/jpeg), which means that I can not display HTML on
the
same page.

It's a catch22..  I can't display an uploaded image along with HTML on
the
same page unless it is uploaded to a public directory.  I can not upload
toa
public directory unless I CHMOD it to 777.  I am not allowed to CHMOD
the
directory so I have to save the images outside the public html
directory.  I
can not display an uploaded image along with HTML when I have to fread()
the
file to the screen.

**pant pant**

There will be thousands of images (4000 - 5000 when complete) and it has
been advised to me not to save them in a MySQL database as it can
significantly reduce search times.  Is this true?

-Kevin Stone

 Presumably, each item in the catalog has a unique id of some sort in
 the database. When you upload the images, you can rename the image
 file to image_(unique_id).jpg. Then when you load a page, you can
 reference the item next to the image.

 This is only one way to do it, of course. You could also store the
 image names in another database and link the tables when calling the
 data for the jewelry.

 jim


 I have written a simple image uploading system to go along with a
simple
 database.  This will be a part of a publiclay accessable search
engine
for a
 jewelry companie's web site.  Almost every entry has a corresponding
image.
 But that was the easy part...  The problem now is that I need to
display
the
 images next to the corresponding info on the same page.
 
 I do not know much about UNIX permissions but I am strongly advised
to
keep
 the permission settings on the public-html directory set to 0755 at
the
very
 least.  Since the PHP script inhereits user permissions (and not the
Owner's
 permission)  this means that I can not upload the files to the
Public-html
 directory where I could easily grab them with a URL.  The only place
I
have
 access is outside the public html directory.  Of couse I can open any
number
 of images I like and read them to the browser screen... but they can
not
 mingle with HTML becuase I have to set the header(Content-type:
 image/jpeg) in order to display the image in the first place.
ARRGGH!
 
 It is forcing me to use frames or a floating window to display the
images..
 which is absoutely totaly unacceptable.  Aside from being a hack
solution
 there is no way I can align the images with the corresponding
database
info.
 And inline frames are not supported by all browsers.
 
 *sigh*
 
 I am being blocked on all ends and I need a solution fast.  Any help
will
be
 **GREATLY** appreciated.
 
 -Kevin Stone
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]


 --
 Jim Musil
 -
 Multimedia Programmer
 Nettmedia
 -
 212-629-0004
 [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] sorting for thinkers:)

2001-12-11 Thread David Piasecki

Put the email addresses in an array:
$email[] = [EMAIL PROTECTED];
$email[] = [EMAIL PROTECTED];
$email[] = [EMAIL PROTECTED];


Then sort like so:

function cmp ($a, $b) {
return strcmp(stristr ($a, @), stristr ($b, @));
} 

usort($email, cmp);


You now have a properly sorted $email array.


-Original Message-
From: Rambo Amadeus [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 11, 2001 3:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP] sorting for thinkers:)

Hi,
let say that i have 3 e-mail adresses in mysql.
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

How can i sort them alphabeticaly but by domain name. That all abc.com
domains go first, then bcd.com, then cde.com etc.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]