RE: [PHP] SSH file transfers

2001-01-11 Thread Sam Leibowitz


To my knowledge, there's no way to make a browser do SCP without coming up
with a custom plugin, which isn't likely to be within the scope of stuff
you're willing to take on.  Fortunately, someone else has done it for you.

F-Secure SSH is an SSH terminal client that includes tunneling and file
transfer tools (SFTP and SCP). Unfortunately, it's US$150. Bleah.
http://www.f-secure.com

PuTTY and PSCP are free tools developed by the same author. PuTTY is also
fun to say if you're a Seinfeld fan.
http://www.chiark.greenend.org.uk/~sgtatham/putty/

There are a couple of other SCP tools out there for Windows (some of which
are even free!), but you can search for the links yourself at the usual
suspects' sites (download.com, zdnet.com, etc).

If you're actually trying to make PHP handle file uploads and downloads
securely, you're basically looking at HTTPS/SSL.

HTH,Sam

>
> Yeek!  Not quite what I meant.  I don't think that web servers have any
> business being on windows boxes.  I was wondering if there were a way to
> upload using something like scp from a windows (or other) browser to a
> unix server.
>


-- 
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] Search Engines and PHP

2001-01-22 Thread Sam Leibowitz

Just a quick addendum - search enginies tend to be picky about indexing
pages that have short expire times. So, if you're using header() to prevent
pages from being cached (or at least, cached for very long), you should
expect search engines to turn their noses up at them.

Sam

-Original Message-
From: Sander Pilon [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 9:51 AM
To: Jamie; [EMAIL PROTECTED]
Subject: RE: [PHP] Search Engines and PHP


>
> I was wondering if anyone can enlighten me about the ability of search
> engines to read and list PHP pages.  I have been told that because PHP
> produces a dynamic html page (i.e. one that possibly outputs
> different HTML
> for each hit or request) that they are not easily added to search engines
> (if this is true though what would be the point of having any
> html pages if
> you can't update or change them at anytime?).  Another point was
> made to me
> was that many PHP pages require additional commands to be passed
> through the
> URL eg www.domain.com.au/writestufft.php?variable=foobar which search
> engines find hard to deal with also.
> If any of these are true or if there are such problems which
> could result in
> the page not getting listed then what are the options.
> My only idea has come from the [PHP]url hide thread in which a index.html
> single 'wrapper frame' could be applied to the entire site.
> Any Ideas
>

Search-engines read HTML, what drives that HTML is entirely irrelevant.

... however, some searchengines do not index pages that have variables on
the url, so those pages will never be indexed by that particular
searchengine.

But other searchengines will spider about everything (I think google spiders
a lot, including dynamic pages) - but realize that the searchengine always
contains a snapshot of your page, most likely one taken weeks ago.

If you want to be totally searchengine-safe, do not use variables on the
url, do not rely on cookies and do not rely on POST variables for the pages
you want to have the searchengine spider.

Also, you could make a robots.txt file and instruct the searchengines to
spider only particular pages on your site.

-Sander



-- 
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] Re: Managing Multiple Conditions in a MySQL Query

2001-05-02 Thread Sam Leibowitz


Well, first of all, you can start by getting friendly with "print
mysql_error();", which will tell you if you have any syntax errors in your
SQL statement. =D

And I think you do. That should be:
  ...WHERE Public='yes' AND Verified='yes'...

As opposed to:
  ...WHERE Public='yes',Verified='yes'...

Additionally, you're passing your results directly to a while loop, which
is a something of a no-no.  Even if your SQL statement is perfectly
formatted, you'll generate a warning if the number of rows returned is
zero.


   Sam Leibowitz ([EMAIL PROTECTED])
   Project Manager
   Business Technology Center (http://www.btcwcu.org)


On Wed, 2 May 2001, Mike Gifford wrote:

> Hello,
> 
> I'd like to verify two conditions are true in the results that I pull out of my 
> MySQL database.  In this case I wanted Verified and Public both to be listed as 
> 'yes' in the DB before they were displayed. The code I tried to use is as follows:
> 
>  echo "Recent Signatures\n";
> $individuals_query = mysql_query("SELECT FirstName,LastName,CityState FROM 
> phPetition WHERE Public='yes',Verified='yes' ORDER BY ID DESC LIMIT 0,5");
> while ($individuals_array = mysql_fetch_array($individuals_query)) {
>   echo "" . stripslashes($individuals_array["FirstName"]) . " " . 
> stripslashes($individuals_array["LastName"]) . " from " . 
> stripslashes($individuals_array["CityState"]);
> }
> 
> However, it gave me the following error:
> 
> Warning: Supplied argument is not a valid MySQL result resource in 
> /usr/local/rabble/petition/index.php3 on line 89
> 
> How do I get around this?
> 
> Mike
> -- 
> Mike Gifford, OpenConcept Consulting, http://openconcept.ca
> Offering everything your organization needs for an effective web site.
> Featured Client: http://rabble.ca - News For the Rest of Us!
> Courage my friends, 'tis not too late to make a better world - T. Douglas
> 
> 


-- 
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] Session handling and SSL

2001-03-26 Thread Sam Leibowitz

Apologies if this has been addressed earlier.

I'm using session.auto_start under an apache-ssl driven site, and it seems
that the sesion ID cookies aren't being sent with the "secure" flag
set. As a result, the browser is effectively ignoring the cookie.

Is this an obvious configuration problem that I'm too dumb to figure out,
or should I actually be worried?

Thanks,

Sam Leibowitz ([EMAIL PROTECTED])
Project Manager
Business Technology Center (http://www.btcwcu.org)


-- 
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] RE: Your Opinion?! PHP4 coding style - Comment and Splitting source code

2001-02-13 Thread Sam Leibowitz
My personal opinions:

The effect of comments in code parsing speed is negligable. Never hesitate
to put in a comment because you think it's going to slow down the procedure.
If your speed requirements were that down to the wire, you should have gone
with a compiled app anyway. Or a faster server.  Or anything other than not
putting in comments.

That said, it's rare that I've written 2 lines of comments for every 1 line
of code, and I tend to be fairly rigorous (on good days, anyway) about
commenting completely.  You may want to consider putting some of those
comments in seperate design documentation.

Finally, I tend to break up my source code into several files, usually
around the class definitions (I like object orientation).  I usually wind up
with one file for the database interface, a few files containing class
definitions corresponding to the business logic, and an included fragment
for each block of HTML which needs to interact heavily with the PHP (for
example, pre-populated form fields).  This is purely for
ease-of-maintenance.

Where you can, you should replace calls to include() with calls to
require(), because require() is a bit faster.  The catch is that you can't
place require() calls in conditional blocks, so:

 if ($something) include($foo); // this is okay
 if ($something) require($bar); // this is not.

Hope this helps,
Sam

> -Original Message-
> From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 13, 2001 5:40 AM
> To: [EMAIL PROTECTED]
> Subject: Your Opinion?! PHP4 coding style - Comment and Splitting
> source code
>
>
> Hello all.
>
> I'm running PHP4 as Apache module under Linux. I would like to know good
> script coding style.
>
> I should not write long comments in code or not? With Zend Cache, comments
> should not matter. How about w/o Zend Cache? If I want to write long
> comments, should I get Zend Cache? Or can I ignore the overheads? For
> example, 50KB of comments for 25KB code - total 75KB script size.  (Not
> considering disk access/load overhead. I would like to know PHP4's
> overheads)
>
> Whether I should split source code so that PHP4 can parse/compile
> as little
> code as possible or not. What is the best coding style you suggest? For
> example, 200KB script containing  all
> code vs. split into several source files and load 100KB on average when it
> executed.
>
> What is your opinion?
>
> Thanks in advance.
>
> --
> Yasuo Ohgaki
>
>


-- 
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] RE: Would Like to know

2001-02-13 Thread Sam Leibowitz

> Can PHP direct the output to a file
> eg send the HTTP_USER_AGENT information to a file ??


Sure. Read the documentation for fopen(), flock(), and fwrite(). Then
fwrite() out $HTTP_SERVER_VARS["HTTP_USER_AGENT"].

Sam


-- 
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] what's the difference between include and require??

2001-02-20 Thread Sam Leibowitz

>   An unsuccessful include will give you an error.
>
>   An unsuccessful require will kill the program.

Also: require() statements cannot be embedded inside conditionals. For
example:



The reason: require() is taken care of on an initial pass of the parser,
which makes it faster than include().  Unfortunately, that means that the
parser doesn't check to see if it's embedded in a conditional statement.

Finally, unless you're using these functions to pull in actual HTML, as
opposed to code, think hard about using include_once() or require_once(),
which spares you those obnoxious "Cannot redefine function blah() in blah
blah blah" errors.

-
Sam Leibowitz ([EMAIL PROTECTED])
Project Manager
Business Technology Center



-- 
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]