Re: Stripping content from other sites using "socket" connections

by "Darrell King" <darrell(at)webctr.com>

 Date:  Mon, 30 Dec 2002 09:10:04 -0500
 To:  "'hwg-techniques@mail. hwg. org'" <hwg-techniques(at)mail.hwg.org>
 References:  michael
  todo: View Thread, Original

----- Original Message -----
From: Michael Kear


>I tried installing PHP.   I didn't get it done inside a couple of hours.
>And even then, I had trouble understanding the documentation because
>it's written by IT tech-heads for IT Techheads.

Aren't "tech-heads" what we are talking about, here? Web designers and
programmers? I have found the PHP help documentation to be very helpful,
even to including comments from previous users:

http://www.php.net/manual/en/


>And you pay down the track for languages that are more difficult to
>understand and use.  For example, can you connect to a datasource, make
>a query, and disconnect in this space?

><.cfquery name="getdata" datasource="mydata">
>SELECT * from Tbltablename where name like '%kear%'
><./cfquery>

In PHP, usually, you would only connect once per script:

$link  = mysql_pconnect("localhost",[USERNAME],[PASSWORD]);
mysql_select_db([DATABASE NAME],$link)

Then, make queries as needed throughout the script with this line:

$result=mysql_query("SELECT * from Tbltablename where name like '%kear%'");


>And can you make a table and display it all on the screen with something
>as small as this?

><.cfdump var="#getdata#">

There is a dump function in PHP, too, I believe - I've never had a need to
use it and I don't remember it offhand. Of course, one usually writes custom
display functions for Web use...


>It's the ease of use, the sheer power of the language and the fact that
>you can write your own tags doing anything you like that make it less
>expensive than other technologies in the long run.

>For example, can you create a drop down list of all the countries in the
>UN's list of countries with the country codes as the input variable and
>the name as the display with anything less than the following?:

><cf_countries base="usa">

>That's a function I wrote myself.  You can see it at work at
>http://www.buathletics.com/register/index.cfm    The function goes off
>and queries a database of country names and codes, and builds the drop
>down list and puts the country named as "base" as the default selection.
>It's something I use all the time on most of my forms.

Yeah, I wrote one in Perl, in PHP and in C.  The ability to write functions
(methods, subs, etc) is fundamental to any industrial-strength scripting or
programming language.

I do think your examples illustrate one thing that makes the language less
intimidating for newbies: the tag-style syntax.


>My point is this .... while you pay for the license to the server
>technology, either directly or indirectly, you save many more times the
>cost of that in the ease of use and rapid deployment of dynamic sites.
>This is why you find so many of the commercial sites using .asp and/or
>coldfusion.

Again, I have to contest your conclusions, Mike. I respect your stance, and
I agree that ASP or CF may seem marginally less intimidating to beginners
because of some familiar syntax, but I don't consider them to be
phenominally easier to learn for someone who is dedicated to learning.


>Other people can easily say the same thing about .asp and php because
>its what they know, but I know from my own experience that non-technical
>people who understand html can quickly learn ColdFusion but they can't
>learn .asp or PHP as easily.  I know because I've had to do it, and I
>have been running development teams where we have had exactly that
>problem.

I have also taught PHP and found the same results: very easy to learn.
Perl, of course, is a bit more work...I've found that Perl is considered
easy only by those with Unix and CX experience, although I don't have a
broad base of experience to support that statement.


>And lastly, regarding your accessibility question.  The fact that you're
>blind and the pages might or might not be easy to navigate is nothing
>whatever to do with the technology. It's to do with the design.  Flash
>now has all kinds of accessibility options inbuilt and available as
>plugins so there's no reason why a flash element should be unavailable
>to your software.  I know because my main client is very conscious about
>access for blind users.   We regularly have blind people come into the
>office and run our sites for us in usability labs so we can see where we
t>rip them up.

>We can make it easy or difficult for blind people depending on how we
>design it.  Nothing whatever to do with the technology.

I agree totally with this.  Nice work supporting it, Mike!


>You shouldn't go knocking something simply because it costs money to
>buy.  It's the overall cost of the site that counts, and as I said at
>the top of this post, the most significant cost of most sites is the
>cost of the developers' expertise, not the technology.   A simple site
>built by me using PERL took at least 20 times longer for me than
>building a far more complex dynamic site in ColdFusion.  And I'm talking
>about when I was a learner at ColdFusion.   Multiply that by any hourly
>rate you like and tell me that its cheaper to use the "free" PERL.

Agreed that the developer cost is critical.  However, as you stated above,
there are those who know these languages well enough to compete with your
speed.

Personally, I find that it is possible to move too fast in any of them, as
the result is not a well thought-out and efficient script, but rather a
quick hack that runs far more slowly than it needs to. Perhaps my biggest
pet peeve with the industry is waiting for dynamic pages that seem to take
forever to load some small amount of data because they were written by
someone with 10 hour's of scripting experience who did not take the time to
learn to optimize his code or queries.

My personal belief is that I can compete with you in the areas of cost and
support using PHP. I won't say that makes PHP a better choice, but I did
have to challenge your claims that it is a less viable one than CF, even for
a newbie.

I've seen some really nice work done with CF, and with ASP, but it seems to
me that I've also seen far more abuse done with those languages than with
PHP or Perl, probably because they are a touch easier to learn for many
people. I would caution those who take your advice to ensure that they are
hiring a skilled CF coder and not someone who is just trying fake it for a
few lines.

As others have said, I have no intention of entering into a useless war over
the superiority of one discipline or another.  My sole intention with this
note was to assert that PHP and Perl are not useless, esoteric "tech-head"
languages.  PHP, especially, is a very straightforward, simple and viable
scripting language suited for both new users and for experienced programmers
with heavy loads.

I'll now leave the field without awaiting the results of my charge...:).

D

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA