Re: [PHP] Re: PHP textbook suggestions?

2007-04-11 Thread Chris Lott

You're missing the point-- it's not that there is a practical
difference in the examples, it's that there IS a difference, the
students see it, and it is an extra point of confusion that isn't
needed if one is being consistent.

I completely recognize that the practical effects of the differences
are small, but the learning effects of the inconsistencies is much
larger, particularly with a group of students that are not techies,
not geeks, not computer science or IT students...

c

On 4/10/07, LuKreme [EMAIL PROTECTED] wrote:

On 6-Apr-2007, at 08:13, Chris Lott wrote:
 echo substr(abcdef, 1);

 So they naturally want to know-- why the double quotes? And there's no
 good logical reason for double quotes in the example-- and there are
 languages where the function could take a variable to be interpolated
 that DOES need double quotes-- so it is very confusing to them.

But it's quite simple: it's a matter of preference, style, or just
the mood of the programmer.  Basically, there is NO difference between

echo substr(abcdef, 1);
echo substr('abcdef', 1);

Oh sure, there is some number of nanoseconds difference in evaluation
time, but that's meaningless as it is an insignificant amount of time
(and takes millions and millions of iterations to make any
perceivable difference).

Use whichever you want.  For me, I use  mostly, and usually only use
' when I am enclosing 's to save myself having to escape them.

On 5-Apr-2007, at 14:52, Chris Lott wrote:
 print 'The cost is ' . $cost;
 NOT
 print The cost is $cost;

But that is certainly a silly destination to make.  Both are
perfectly valid and, in fact, I would argue the latter is better as
it is clearer, cleaner, and shorter.

 echo substr('abcdef', 1);
 NOT
 echo substr(abcdef, 1);

Both are perfectly fine.  I'd use the latter myself as I tend to
reserve the single quotes for enclosing strings containing double
quotes, but that's just my preference.  I certainly wouldn't deign to
argue that my way was 'correct'.

--
A: You can never go too far. B: If I'm gonna get busted, it is *not*
gonna be by a guy like *that*.

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





--
Chris Lott

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



Re: [PHP] PHP textbook suggestions?

2007-04-11 Thread Chris Lott

On 4/10/07, Richard Lynch [EMAIL PROTECTED] wrote:

 print 'The cost is ' . $cost;
 NOT
 print The cost is $cost;
 AND CERTAINLY NOT
 print (The cost is $cost);

echo The cost is , $cost;

If you're going to be this picky, you'd better write your own textbook...

:-)

Perhaps instead of a textbook, just use http://php.net/manual


The manual is not nearly enough reference for a beginning students.
You illustrate the problem with quotes in your example above-- why
double quotes with no variable being interpolated?

The . is the documented string operator for concatenation... that's
one of the reasons I dislike the unneeded parentheses with the print
function-- then I have to explain-- before I want to-- arguments to
functions, which is necessary to explain the comma.

c

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



Re: [PHP] PHP textbook suggestions?

2007-04-06 Thread Chris Lott

I'd still like some actual recommendations for a good book for beginners.

I think this discussion is getting a little ridiculous... I have my
preferences for a textbook based on 5 years of experience in teaching
this class. Of course I teach my students about superfluous
parentheses as in:

print (me);

And the difference in quoting styles...

But these are COMPLETE beginners, even beyond beginners, many having
never even really thought about programming. I am lucky if 1/2 of them
have basic HTML. So they get easily confused by differences in sample
code... sure they learn, eventually, to deal with that, but if I can
avoid making it harder on them I will.

I prefer not having variables in double quotes for the most part--
syntax highlighters do a better job, and in the confusing (especially
for a beginners) jumble of quoted HTML attributes and PHP syntax,
etc... it is easier to spot and see the variables. And it reinforces
the difference between displaying a variable and its contents.

All that being said, I've yet to see two books that are consistent
with one another, much less with me, so I said it was a PREFERENCE.
All of your argument has resulted in-- as far as I can tell-- one
anti-recommendation.

So if anyone has any productive ideas for a good textbook for
beginners, my ears are open.

c
--
Chris Lott

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



Re: [PHP] PHP textbook suggestions?

2007-04-06 Thread Chris Lott

I see a couple of recommendations for textbooks now... thanks.

As to why I think one style is good or bad-- probably the same reasons
any of you prefer yours + in my experience, the style that I have
adopted is the easiest for the beginners to understand and not be
confused by. This list (naturally) underestimates how hard it is for
non-techie, non naturally tech-inclined newbies to approach language
syntax. The quotation thing is a good example-- they are taught about
interpolation and trying to learn about quotation marks and escaping
and when each is appropriate, then they are shown code like:

echo substr(abcdef, 1);

So they naturally want to know-- why the double quotes? And there's no
good logical reason for double quotes in the example-- and there are
languages where the function could take a variable to be interpolated
that DOES need double quotes-- so it is very confusing to them.

If I CAN, I would like to avoid that confusion so *I* Can teach them
about the differences.

Similarly my preference and teaching that they keep variables out of
quotes-- it's a style thing, something I consider good practice,
something I see most code examples I find use, so if I could find a
text that did it, that would be great. For that matter, even a text
that didn't do it but was CONSISTENT. It's amazing how many books are
totally inconsistent. These students aren't at a level where
inconsistency is the best approach to stimulating their learning. They
get there, but it takes a while.

c
--
Chris Lott

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



[PHP] PHP textbook suggestions?

2007-04-05 Thread Chris Lott

Looking for suggestions for a PHP textbook for an Intro to Web
Programming class that will be using PHP5 and MySQL. This is a
first-semester course, so no programming experience required.

It would be nice to have a text that adhered to (what I see as) good
practice using quotation marks... i.e.

print 'The cost is ' . $cost;
NOT
print The cost is $cost;
AND CERTAINLY NOT
print (The cost is $cost);

echo substr('abcdef', 1);
NOT
echo substr(abcdef, 1);


I will be teaching, so a book that a student can-- before the class--
work through and understand is good-- doesn't have to be a traditional
textbook! But it shouldn't be a reference manual either.

c
--
Chris Lott

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



Re: [PHP] Linux distributions and tools for Linux/Apache/PHP/MySQL dev

2006-03-01 Thread Chris Lott
Thanks for the advice-- I've run Linux without a GUI for a long time,
so I'm quite familiar with hand compilations--  but I always wondered
if I was just missing something with packaging systems that it seemed
to REQUIRE hand-compilation to get a workable development LAMP system.
Anytime I tried using packages some need seemed to force me back to
doing it by hand.

So I guess my more specific question would have been: Are there any
distributions that actually TARGET developers and I Was curious about
desktop tools. I own Zend but tend to use Homesite and Emacs in
regular doses. Guess I will probably stick with Emacs and use Zend
more. I know enough Vim to survive, but it just isn't me :)

c

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



[PHP] Linux distributions and tools for Linux/Apache/PHP/MySQL dev

2006-02-25 Thread Chris Lott
I'm making the switch from Windows to Linux for mydesktop and
development environment and would greatly appreciate suggestions for
development tools on this platform. Ubuntu seems to be getting all the
press, but suggestions about Linux distributions are welcome as well!

c

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



[PHP] Dynamic Array Index using Variable

2006-01-09 Thread Chris Lott
I want to do something like this to check if a variety of submitted
form fields (crn, instructor, etc) have any value in them:

$reqfields = array('crn', 'instructor');
$errorflag = 0;

foreach ($reqfields as $field) {
if ($_REQUEST[$field] == '') {
$errorflag = 1;
}
}

But I can't quite get the syntax right... help??

c

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



Re: [PHP] Dynamic Array Index using Variable

2006-01-09 Thread Chris Lott
What I have is a form with 45 data fields... if any of a selected 35
of those fields is empty, I want to have the user go back. So I can't
loop over the entire _POST array. So I thought I would put the names
of the fields I *do* want to check into an array and check.

So this won't work:
 foreach($array as $key=$value){
   if(empty($value)){
 $err_msg= $key is empty;
 break;

Because the array is the names of the fields, and I want to check each
variable in _POST that matches. So instead of writing

if (empty($_POST['forma'])
if (empty($_POST['formb'])
etc

I would do something like

$fieldstocheck = array('forma', 'formb');

foreach ($fields as $thisfield) {
if (empty($_POST[$thisfield])) {
  set the error flag;
}

But that doesn't seem to work.

Eventually I will use the array to associate error text:
$fieldstocheck = array('forma' = 'You must enter field A', 'formb' =
''Field B is your age in years and is required');

etc

c

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



Re: [PHP] sorting dates with php

2005-12-21 Thread Chris Lott
On 12/21/05, Ross [EMAIL PROTECTED] wrote:
 Hi,

 Have a load of dates in the format DD/MM/YY. Thet are stored as a VARCHAR on
 a mysql DB.

Couldn't you use cast() to cast the values first? Something like (untested):

SELECT CAST(doc_date AS DATE) FROM papers ORDER BY doc_date DESC

c

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



[PHP] PHPEclipse vs TruStudio

2005-12-14 Thread Chris Lott
Which of these are better Eclipse plugins for PHP Development? Or,
which advantages do each provide?

c
--
Chris Lott

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



[PHP] shortest possible check: field is set, integer or 0

2005-11-30 Thread Chris Lott
What is the shortest possible check to ensure that a field coming from
a form as a text type input is either a positive integer or 0, but
that also accepts/converts 1.0 or 5.00 as input?

c

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



Re: [PHP] PHP to read news

2005-10-22 Thread Chris Lott
On 10/19/05, Steve [EMAIL PROTECTED] wrote:

 I'm looking for some help with reading freely available news files like
 this:   news://newsclip.ap.org/[EMAIL PROTECTED]
 news://newsclip.ap.org/[EMAIL PROTECTED]/%3E%3C/media.
 I'm able to connect to the newsgroup with the IMAP functions just file,
 but this type of news url can be placed in a browser like mozilla and
 the message will be pulled, so i'm thinking it should be much easier
 than that.

When you use the browser to access using the news: protocol you are
actually invoking NNTP functions. That's whats the IMAP functions you
are using are also doing. So that is the proper way. I imagine if you
search for NNTP and PHP you will find some third party classes and
code that might help out too...

c
--
Chris Lott

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



[PHP] Overriding display errors and error reporting in php.ini

2004-11-24 Thread Chris Lott
I am running a system with PHP 5 and IIS 4. If I enable error display
in php.ini, errors get displayed. If I turn error display off, they go
away.

However, if I have them off in php.ini but I put this code on a page:

error_reporting(E_ALL);
ini_set('display_errors', TRUE);

I still get no error display. Shouldn't this override the php.ini
settings? Is there a way to set the server default to E_ALL ~ E_NOTICE
and No Error display but retain the ability to change these settings
within individual pages/apps?

c

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



Re: [PHP] Where to learn about these topics

2004-11-22 Thread Chris Lott
 In MySQL I would say... If you have data which has to be inserted in
 serveral tables, you must first check if all conditions are ok. So, do some
 selects to check if everythin in your database is ok, and after that,
 execute the query. But, when you really want to make complex database driven
 applications, choose PostgreSQL! This database is better build for
 complexity (and not only that ;) ), and supports transactions and
 references, and more stuff like that which can be really helpful to you...
 And when you compare MySQL against PostgreSQL... PostgreSQL is a heavy
 system compared with MySQL, also free, but when you look at the
 functionality: SUPERIOR 

But even with Postgresql I have the same situation. Let's say a user
wants to enter a new contact into the database. This contact lives in
a new city and has a new kind of relationship. To make that city and
relationship available, I need them in the related tables. Or I need
my form action to check for each one, insert if they are not there,
and then finally insert the new record. This last seems preferable
(one form), but no books seem to deal with the real world, only the
simplest, single-table cases...


  $query =  SELECT * FROM table1, table2 WHERE table1.id = table2.id AND
 table1.value = 'value' OR table2.value = '' ORDER BY table1.name ;
  
  is less readable than:
  
  $query =  SELECT * FROM table1, table2
   WHERE table1.id = table2.id
  AND table1.value = 'value'
  OR table.value = ''
   ORDER BY table1.name   ;

Right-- but my question isn't about the query, but about the results.
Again, look at my result set:

+-+--+--+---+---+
| first   | last | relation | city  | state |
+-+--+--+---+---+
| Chris   | Beks | business | Fairbanks | AK|
| Robert  | Hannon   | friend   | Fairbanks | AK|
| Cindy   | Lott | family   | Fresno| CA|
| Derryl  | Hartz| business | Seattle   | WA|
| Kirsten | O'Malley | friend   | Seattle   | WA|
+-+--+--+---+---+

I want an output routine that does this:

CITY
  person
  person

CITY
  person

CITY 
  person

There has to be a more elegant way than making a new query for each
city-- which is what the query I mentioned above fixes... but is the
kind of code I have put, with its ugly indexes and counters really the
best way? This is another area where books always stop at the simplest
cases...

$currentcity = '';
$counter = 1;

while ($thisrow = mysql_fetch_array($result))
   {
   if ($currentcity  $thisrow['city'])
   {
   if ($counter  1)
   {
   echo '/blockquote';
   }
   echo 'h1' . $thisrow['city'] . '/h1';
   echo 'blockquote';
   $currentcity = $thisrow['city'];
   }
   echo $thisrow['first'] . ' ' . $thisrow['last'] . 'br /';
   $counter++;
   }

c

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



[PHP] Where to learn about these topics

2004-11-20 Thread Chris Lott
Where can I learn topics such as:

1) Examples of complex PHP applications entering data into complex
related table structures. For instance, if I am writing an application
to create a class catalog that has 5 related tables, how do I handle
the workflow when the data in related tables doesn't yet exist? Do I
force a user to enter data into 5 different forms first? Do I have a
place to enter the new data on the main form? Do I create temporary
records as part of a step-by-step process?

2) Complex display with database results-- particularly when working
with many joined tables, displaying results effectively for reporting
(show me all departments, within that all classes, within that who is
teaching, sorted by department). The queries aren't hard, but if
optimized into one big query the constructs for displaying seem to get
ugly. For instance, given a query that gives me these results as
$result (joined together from three tables):

+-+--+--+---+---+
| first   | last | relation | city  | state |
+-+--+--+---+---+
| Chris   | Beks | business | Fairbanks | AK|
| Robert  | Hannon   | friend   | Fairbanks | AK|
| Cindy   | Lott | family   | Fresno| CA|
| Derryl  | Hartz| business | Seattle   | WA|
| Kirsten | O'Malley | friend   | Seattle   | WA|
+-+--+--+---+---+

It seems like there must be a more efficient way to get a listing of
each city and who lives there than:


$currentcity = '';
$counter = 1;

while ($thisrow = mysql_fetch_array($result))
{
if ($currentcity  $thisrow['city'])
{
if ($counter  1)
{
echo '/blockquote';
}
echo 'h1' . $thisrow['city'] . '/h1';
echo 'blockquote';
$currentcity = $thisrow['city'];
}
echo $thisrow['first'] . ' ' . $thisrow['last'] . 'br /';
$counter++;
}

Although this is preferable to running separate queries:

$query = 'select lid, city, state from locations order by city, state';

$result = mysql_query($query) or die('Couldn\'t perform the query: ' . $query); 

while ($thisrow = mysql_fetch_array($result))
{
echo 'h1' . $thisrow['city'] . ', ' . $thisrow['state'] . '/h1';
echo 'blockquote';
$pquery = select first, last from people where lid =
{$thisrow['lid']} order by last, first;
$presult = mysql_query($pquery) or die('Couldn\'t perform the query:
' . $query);
while ($prow = mysql_fetch_array($presult))
{
echo $prow['first'] . ' ' . $prow['last'] . 'br /';
}
echo '/blockquote';
}

c

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



Re: [PHP] displaying repetitive results

2004-11-13 Thread Chris Lott
On Sat, 13 Nov 2004 06:30:14 +, Curt Zirzow
[EMAIL PROTECTED] wrote:

  You might normalize the data a bit.
 
 agreed!
 
 Curt

My data IS Normalized! The results you are seeing below are from
joining together the books, subjects, and books_subjects xref table,
as I explained below. But my point is that because the data is
normalized, I end up with a result set that shows one row per subject,
making aggregate display of the subjects (so they appear as one set
for the user) painful...

Thus the tables and query I posted:

The query and tables are simple:

select books.id, books.title, subjects.subject
from books, subjects, books_subjects
where books_subjects.bid = books.id
and books_subjects.sid = subjects.id

BOOKS
1. collected poems of keats
2. spy high
3. sci-fi spies

SUBJECTS:
1. poetry
2. suspense
3. sci-fi
4. horror
5. mystery

BOOKS_SUBJECTS
bid  sid
11
22
32
33

c

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



[PHP] displaying repetitive results

2004-11-10 Thread Chris Lott
Given a database query thats returns results from a linking (or xref)
table which includes repetition because of the joins:

++--+--+
| id | title| subject  |
++--+--+
|  1 | Collected Poems of Keats | poetry   |
|  2 | Spy High | suspense |
|  3 | Sci Fi Spies | suspense |
|  3 | Sci Fi Spies | sci-fi   |
++--+--+

What is the best way to go about displaying this for the user so that
the record looks complete:

ID: 3
title: Sci Fi Spies
Subjects: suspense, scifi

or something similar? Or is there some better way to query? It's also
a problem in terms of limiting the query because if I limit the query
to 10 records I might be chopping off some subjects for the last book?

The query and tables are simple:

select books.id, books.title, subjects.subject
from books, subjects, books_subjects
where books_subjects.bid = books.id
and books_subjects.sid = subjects.id 

BOOKS
1. collected poems of keats
2. spy high
3. sci-fi spies

SUBJECTS:
1. poetry
2. suspense
3. sci-fi
4. horror
5. mystery

BOOKS_SUBJECTS
bid  sid
11
22
32
33 

c

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



[PHP] sorting multidimensional array by a second level value

2004-09-17 Thread Chris Lott
I have an array $links like this:

[1] = Array
(
[href] = http://www.poetrymagazine.org/epstein_sept_prose.html
[description] = Thank You, No
[time] = 2004-09-17T17:30:32Z
)

[2] = Array
(
[href] = http://110am.com/projects/manuscript/
[description] = Manuscript
[time] = 2004-09-16T19:25:14Z
)

I'd like to sort the array based on one of the values in the field
href, description, or time. Is there a canonical way of doing this?

c
-- 
Chris Lott

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



[PHP] Does this beginner's book exist?

2004-08-30 Thread Chris Lott
I am looking for a new text for my beginning PHP and MySQL programming
class. This class is for COMPLETE beginners who have never programmed
before. I have used, in the past, PHP4: A Beginner's Guide and PHP for
the World Wide Web (Visual Quicktart).  (I will be using PHP4, at
least until the Redhat Enterprise Server upgrades :)

However, both of these books, while being well pitched towards
beginners, also assume that register_globals is enabled, and while the
former is more like a textbook (it has exercises and mini-quizzes) it
doesn't do as good a job with the examples as the latter  (which has
no exercises). My students are distance education students, so little
things like variable scopes can be very time consuming to help them
with-- it would be nice if the text got it right :)

Does a book for complete beginners exist that also demonstrates basic
good programming practices, has decent examples, and perhaps
exercises/quizzes (not as important as the first two)?

c
--
Chris Lott

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



[PHP] Finding duplicates in arrays

2004-06-24 Thread Chris Lott
Given two arrays, I want to find the records which are duplicates.
What is the simplest approach? And should I use a different approach
to compare three or more arrays to find only duplicates that occur in
all of them?

c
-- 
Chris Lott

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



[PHP] PHP 4 and PHP 5 on same windows server

2004-06-17 Thread Chris Lott
Are there instructions available (or can anyone fill me in) on the
best way to set up PHP 5 to run on my Windows/Apache server
concurrently with my PHP4 install? I am currently running PHP4 as an
Apache module...

c
--
Chris Lott

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



[PHP] PHP based image database

2004-06-17 Thread Chris Lott
I'm looking for an open source, PHP-based image repository/database
application. There are numerous examples on the web of this kind of
application, but I am hoping to find something designed for (or more
suitable for) scientific images. In particular, something that uses
standard meta-data tagging and/or allows for a controlled vocabulary
of keywords, and a decent hierarchical system for organization.

Anyone know of such a beast-- or something close?

c
-- 
Chris Lott

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



Re: [PHP] Re: Recommend an IDE for Windows

2004-05-08 Thread Chris Lott
On Fri, 07 May 2004 23:58:47 +0200, Rainer Müller
[EMAIL PROTECTED] wrote:

  I've been looking at Zend Studio and Nusphere PHPEd as primary candidates.
  However, I have a short window to buy something (fiscal year issues) so any
  comments on these two editors (separately or in comparison to one another)
  or other tools I should be looking at would be greatly appreciated!

 http://www.phpedit.net - It's still free, but the license model will
 change soon AFAIK.

Hopefully they will get their next release out the door real soon.
Until then I have until Tuesday to purchase something so will keep
testing Zend, Maguma, and NuSphere.

The problem is that with such short time to evaluate I want to avoid
as many gotchas as possible.

c

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



[PHP] Recommend an IDE for Windows

2004-05-07 Thread Chris Lott
I already use and am happy with a variety of text editors (vim, emacs,
ultraedit, jedit, Homesite) depending on my needs, but I would like
recommendations for a PHP specific IDE that will run on Windows XP.

Specifically I am looking for something that can help with debugging,
provides efficient code browsing (functions, objects, etc) across multiple
files in a project, easy browsing through proper mappings to a development
server/local server, and hooks to PHP reference/help/website.

Needless to say, standard features like syntax highlighting, block
formatting, etc. are a requirement.

I've been looking at Zend Studio and Nusphere PHPEd as primary candidates.
However, I have a short window to buy something (fiscal year issues) so any
comments on these two editors (separately or in comparison to one another)
or other tools I should be looking at would be greatly appreciated!

c
--
Chris Lott chris.lott[AT]gmail.com

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



[PHP] default/optional parameters in function

2002-07-03 Thread Chris Lott

I have a function that writes meta tags... if a tag (or tags) is not
specified, then it gets a default value... is there a cleaner way to
do this?

function print_pmeta ($type)
{
  if ($type[description]) {
print 'meta name=description content=' . $type[description]
. ' /';
  }
  else {
print 'meta name=description content=generic description /';
  }

  if ($type[keywords]) {
print 'meta name=keywords content=' . $type[keywords] . '
/';
  }
  else {
print 'meta name=keywords content=generic keyword list /';
  }
}

print_meta2(array(
description = A Real Description
));

c



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




Re: [PHP] default/optional parameters in function

2002-07-03 Thread Chris Lott

On Wed, 3 Jul 2002, Analysis  Solutions wrote:

 On Wed, Jul 03, 2002 at 05:44:28PM -0800, Chris Lott wrote:
 
  I have a function that writes meta tags... if a tag (or tags) is not
  specified, then it gets a default value... is there a cleaner way to
  do this?

 Not that I can think of.  I do have some thoughts, though...

[...]

Good points. But I have a question about this:

 Note use of single quotes around the array key names, as well.

Why is this better-- I assume because PHP doesn't have to check for
variables to interpolate with single quotes?

Thanks!

c


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




[PHP] cool PHP sites

2002-02-26 Thread Chris Lott

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

It strikes me that my students really don't have a good grasp of what PHP
is capable of doing, since they are getting bogged down in learning the
minutiae of the language itself. So (quickly if possible-- I'd like to demo
some sites tonight) what are some examples of cool and publically
accessible sites that use PHP? I'm looking for sites that demonstrate what
PHP can do, examples of big name sites using PHP, etc. 

I can explain how the back end technology is working if I have some good
sites to use as a framework. I'd like to keep them excited about the
potential, you know?

c

-BEGIN PGP SIGNATURE-
Version: 6.5.8ckt - KeyID: 0x51046CFD - http://www.chrislott.org/geek/pgp/

iQA/AwUBPHvc/daLYehRBGz9EQI9KwCgu7SKkrKqmcQ7zf+lAZBwKgvAlWcAmwQ7
xCs+oCAo6Hn5UkHuDmR4ZzlT
=koDz
-END PGP SIGNATURE-



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




Re: [PHP] Re: Homesite

2002-02-19 Thread Chris Lott

 There is an expressions builder for php that works like the one that 
 come with Homesite. I don't use it but it used to be on the Allire site. 
 Since Macromedia owns hs now, No telling where to find it.

Try: http://www.wilk4.com/asp4hs/php4hs.htm

c
--
Chris Lott
http://www.chrislott.org/


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




Re: [PHP] Crashing a webserver

2002-02-19 Thread Chris Lott


 I have got the task to down our webserver, to see how stable she is, and
how
 easy/hard it is to get it on it's knees ;)

 Does anyone have some ideas how to do it?

There are various useful torture scripts floating around the web that you
can use to create heavy, somewhat radom loads on a server, as well as to
send large chunks of random data, etc... a few quick links that might help:


http://stein.cshl.org/~lstein/torture/torture.html
http://stein.cshl.org/~lstein/talks/perl_conference/cute_tricks/torture1.htm
l

http://www.hpl.hp.com/personal/David_Mosberger/httperf.html

http://www.softwareqatest.com/qatweb1.html#LOAD

c
--
Chris Lott
http://www.chrislott.org/


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




Re: [PHP] Text editor for linux

2002-02-18 Thread Chris Lott

 Anyone know of a good text editor for linux, WITH syntax highlighting for
 php/html + other languages?

emacs. There is no alternative. :)

c
--
Chris Lott
http://www.chrislott.org/


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




Re: [PHP] implement yourname.mysite.com redirection

2002-02-18 Thread Chris Lott


 You can also do this via a PHP script, which is what I do.  I have 5 URLs
 all going to the same site (500 megs disk space).  I parse the subdomain,
 and re-driect to the appropriate sub-directory.

So do you have this code running on every page or does it only redirect from
the index page or ??

c
--
Chris Lott
http://www.chrislott.org/



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




Re: [PHP] Php Enum Field

2002-02-18 Thread Chris Lott

 Sorry, my question was how can I retrieve the preset Enum values from
 AccessRight field property? Thanks.

Untested, but I think I remember:

$result = mysql_query(SHOW COLUMNS FROM main LIKE `colname`);

c
--
Chris Lott
http://www.chrislott.org/


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




Re: [PHP] zend studio 2.0

2002-02-17 Thread Chris Lott

I hope we aren't going to get another chest-pounding real coders type of
argument going here. Homesite *IS* a text editor. It provides an amazing
number of shortcuts to tasks, including mouse-based tasks, many of which I
guarantee you I can get done faster with a mouse than anyone can typing. It
also offers a lot of pseudo-time-saving features as well, for which one
would be better of learning to do it manually. But it isn't a GUI in any
real sense as, say, Dreamweaver is. TextPad is at least as much of a GUI as
Homesite in that respect.

I use both of these great tools a lot... none of them are the stigmata of
the under-developed programmer. People should use what they want, but don't
dump on everyone who realizes that clicking a button or using a keyboard
shortcut in something like Homesite or Textpad to create common HTML
structures or PHP control structures is always going to be faster than
typing them out by hand, no matter how craven a Notepad warrior one might
be.

Zend looks pretty good in terms of providing what I like in a development
environment, particularly real debugging... unfortunately it was definitely
not particularly stable when I last tried it in late December.

Integrated debugging, syntax coloring, function reference, keyboard
shortcuts-- these are all useful tools. TextPad has good PHP dictionaries,
Homesite handles PHP well. Homesite is STILL the only editor I have found
that enables an easy preview through the server mapping so that I can,
with one touch toggle between my editing and the live code through my local
development server, something that saves a lot of time vs jockeying between
windows with other tools.

Not all mouse use is just waving one's hands through the air, none of the
programs mentioned are particularly mouse-centric.

c
--
Chris Lott
http://www.chrislott.org/


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




Re: [PHP] zend studio 2.0

2002-02-17 Thread Chris Lott

 Well, as you said, no point in arguing.  Just that I think if someone
 really wants to develop they should learn some better tools than a
 GUI but it's a question of balance.

I think a definition of GUI might be in order. Homesite, for instance, is
just a big text editor. It has almost no GUI design features, drag  and drop
coding, that kind of thing. I think of a GUI as Dreamweaver, or something
where you are not using the code directly. Homesite and  the Zend Studio are
both code editors that provide the same kind of features as TextPad with PHP
libraries, clip books and syntax coloring files. Emacs, which I use a lot,
is in the same class (not GUI, I don't think).

I agree that with GUIs, by my definition at least, one should learn on tools
in which they are really working with the code. If they can insert the
skeleton of a control structure with one click or not doesn't impact their
development (either of themselves or their program) negatively.

c
--
Chris Lott
http://www.chrislott.org/


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




RE: [PHP] good practice

2002-02-15 Thread Chris Lott

Well, .inc seems to be so common as to be a standard practice. At the very
least, the real issue is education on the need to protect included files
anyway so that they can't be accessed directly.

c
--
Chris Lott
http://www.chrislott.org/

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




RE: [PHP] Books on PHP

2002-02-14 Thread Chris Lott

 I am new to PHP and was wondering if anyone can point me the right 
 direction
 with
 PHP urls and books

In the past few months I have received nearly all of the PHP books that have
been written (I wanted to evaluate possible books for some classes) and I
think all of the entry-level/beginner/learn the language kind of books. PHP
and MySQL Web Development is a great book, and provides a good resource for
both PHP and MySQL in one text. However, I think its sections on actually
learning PHP are a bit on the short side, assuming more knowledge and
self-motivation than a lot of people (ok, beginning students) might have. I
highly recommend it, but I would add to it the PHP Bible (which you already
have) and, if that isn't enough, the PHP books from Wrox. PHP4: A Beginner's
Guide is actually pretty good and might have been (had I received it in
time) the best choice for a class text, since it is structured and written
that way.

You really can't go wrong with any of those books, a good project to keep
yourself interested, and a local copy of the documentation.

c
--
Chris Lott
http://www.chrislott.org/

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




RE: [PHP] Mysql / PostgreSQL with PHP

2002-01-28 Thread Chris Lott

Both work well with PHP. Later versions of PostgreSQL are quite fast
(comparable to PHP). MySQL is still a little faster and there seems to be a
much larger base of users and support. You can't go wrong with either one...
if you need the features that PostgreSQL offers that MySQL currently lacks
(stored procedures and subselects, which I am waiting for in the new MySQL
almost with tears in my eyes :), I would go with pg. 

I don't believe pg has replication features. I've never used pg on Windows
if you are thinking of using it there.

c
--
Chris Lott
http://www.chrislott.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]




RE: [PHP] Re: PHP in the University and Corporation [was RE: [PHP] Computer Science and PHP]

2002-01-27 Thread Chris Lott

I agree about going to technical colleges and other areas. In fact, I made
that very point. There is no reason that these kinds of programs even NEED
to be four year degrees.

I don't want to get into a debate about certifications. As one who hires
programmers, I can say this for myself and many others: certification mreans
squat to myself and to most people I know. They have become as devalued as
Argentinian currency :)

On the other hand, the general truth is that certification WILL open doors
in some places, particularly those that are technologically clueless in the
first place. They may or may not be jobs worth having, it may or may not
happen for the job you are pursuing now or the job you might pursue in the
future. 

My real point in all of this is that establishing a LAMP certification, for
instance, or a PHP certification, is no panacea and is no guarantee of
opening any doors, not to mention the possibility of such certifications
becoming a joke as MCSE and other Microsoft Certs (for instance, and a cert
I can speak of with firsthand experience :) have become in many circles and
actually having as much negative impact as positive.

c
--
Chris Lott
http://www.chrislott.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] PHP in the University and Corporation [was RE: [PHP] Computer Science and PHP]

2002-01-26 Thread Chris Lott

Computer science is considered an engineering discipline in most
institutions. And I think that's good... we need people out there to develop
OS's, create database servers, etc. PHP can be effectively used in this
curriculum, but C seems a lot more to the point. 

The place where PHP could (and should) make inroads is in the web
development curriculum that is generally split off from the formal computer
science programs. I think that split is a good thing even if it is made for
the wrong reasons... and while one can quibble about real programmers and
such, these programs that encompass web design, web mastering, systems admin
and networking are the real ground for advancing PHP.

Many institutions, like the one I teach for, are entrenched in ASP and Java
because that is understood by administrators as a good thing to do and
because it is often easier to find instructors with these skills (or at
least the certifications). But there are inroads being made. I have
typically taught web design, internet and networking. Now I finally am
getting a chance to teach a PHP/MySQL class as part of the web development
curriculum (finally as in we finally found good instructors to take the
other courses so that I would have time).

Also, these programs are typically staffed by a cadre of aduncts. If you
have PHP skills and teaching skills and you  can basically donate your time
for the peanuts that are offered (and the fun of it), there is a place for
YOU to help promote PHP.

Someone else remarked that certifications would advance PHP. There is
something to that, particularly in the corporate marketplace to USE it. More
often, in my experience, PHP is slow to be adopted in the corporate
environment because MS is so entrenched, and because MS' firm establishment
on the desktop means hiring MS people, who naturally promote and hire other
MS people, and administrators often equate using other technologies with
abandoning their desktops.

Certification has an equally negative aspect, though, unless stringently and
particularly administered and granted, which would defeat the marketing
ends.

c
--
Chris Lott
http://www.chrislott.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]




RE: [PHP] Re: getting a LAMP job in this economy

2002-01-26 Thread Chris Lott

 It's hard, I think in part, because of the reputation PHP is 
 getting in 
 some circles.  Many of the people evangelizing it don't know anything 
 else, and simply extoll all the 'wonderful' virtues of it. 

YES! This poisoning of the well has happened and continues to happen. The
problem is that being an evangelist is a wonderful thing-- but you have to
be quite skilled at communication to be a successful one :) Otherwise the
person attempting to spread the gospel simply becomes looked at as an
annoyance or, worse, becomes marginalized.

I have dealt with a lot of folks in companies who have a negative view of
PHP, MySQL, Linux, BSD, etc. simply because they have had their intelligence
insulted, or been irritated, or been completely confused, or been preached
to one too many times by well-meaning proponents of Open Source solutions
who are either unable to communicate or simply victim to their own
enthusiasm.

There is probably nothing that doesn't have an Open Source solution in the
abstract sense-- but in the real world of existing systems, personnel, and
politics, the best solution may not be technically the fastest or even the
most stable. The right tool for the job is my motto, and that might mean SQL
Server, it might mean MySQL. It might mean a Linux server, it might mean
Win2K. There is no single panacea.

c
--
Chris Lott
http://www.chrislott.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]




RE: [PHP] quit me off the php list

2002-01-15 Thread Chris Lott

The bottom of EVERY MESSAGE has instructions for removing yourself from the
list. Please follow them.

c
--
Chris Lott -- http://www.chrislott.org/




-Original Message-
From: Thyago Consort [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 15, 2002 10:01 AM
To: Adam Baratz; PHP List
Subject: [PHP] quit me off the php list




-Original Message-
From: Adam Baratz [mailto:[EMAIL PROTECTED]]
Sent: sexta-feira, 11 de janeiro de 2002 01:40
To: PHP List
Subject: Re: [PHP] PHP Parsing Database Text


 Is it possible to have PHP parse text queried from
 a database (security issues notwithstanding)?
 If so, how?

Yes.  Pull out the text with your method of choice and then use the eval
function passing it the string of text to parse as its only parameter.

-Adam


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




[PHP] Setting title via included file

2001-11-20 Thread Chris Lott

I have a page that includes a file in the middle, but I wish to set the 
title of the page based on a variable set in the included file-- is this 
possible?

PHP processes the page sequentially, so if I have $foo = Title in the 
included file, it is too late to use it for the title of the main document. 

I thought output buffering might be the key, but it doesn't seem to work. 
Should it?

Basically, I was doing this for the output buffering:

***
function fixtitle($buffer) {
return (str_replace(XXX, $pagetitle, $buffer));
}

ob_start(fixtitle);

?
html
titleXXX/title

...

? include(file_that_sets_pagetitle.inc) ?

...


?php

ob_end_flush();

?


c

-- 
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] Books for PHP and MySQL Class

2001-11-15 Thread Chris Lott

I'll be teaching a web development class in the Spring in which I plan to 
focus on PHP and MySQL as primary tools. These will be students who have 
experience with HTML And web design, but most will have no experience with 
programming at all. 

I need recommendations for book(s) that will serve as decent primers... I 
expect that the PHP book will have enough of the fundamentals of programming 
to set them on the right path...

Any suggestions for a MySQL book would be great. If both were in one book, 
even better!

--
Chris Lott [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] Books for PHP and MySQL Class

2001-11-15 Thread Chris Lott

On 15 Nov 2001, [EMAIL PROTECTED] (The Big Roach) spake
thusly: 

I think a better strategy would be to introduce them to the basics of
databases in general as opposed to trying to teach MySQL to them. A
good primer on DB's would be Databases for mere mortals by ... ? some
guy! But the cover is orange/brown and not very thick. Can't find it
here... where did I put it.

I get what you are saying here. Since I am leaning towards the single 
MySQL/PHP book, I might add the Mere Mortals book as well. I want them to 
have a reference that will serve them later for PHP and MySQL though I am 
developing a lot of the Database and SQL basics myself, just as I am 
developing a lot of the intro programming material-- but I do want them to 
have something to hold in their hands and take with them as well...

Thanks!

chris

-- 
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] a good PHP editor

2001-07-19 Thread Chris Lott

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

 I wonder if Emacs runs on win2k it ran on win95 great...

Emacs/Windows runs fine on win2k. 


-BEGIN PGP SIGNATURE-
Version: PGP 7.0.3- signed for information authentication and security
Comment: Key ID: 0x51046CFD

iQA/AwUBO1cb6daLYehRBGz9EQKthwCg9gbFE2rQwzsVuwYe2P6e0ZY+aAAAnA8r
qeqqp7tiWClBmfRx4G/492rv
=ScVo
-END PGP SIGNATURE-

-- 
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] PHP vs Perl question

2001-07-18 Thread Chris Lott

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'd go for it. Perl can be messy, but it is also quite powerful and
doesn't HAVE to be messy. It is EVERYWHERE both in terms of availability
and use. But most of all, it is a fun language to play with... and if you
do any system admin it is an indispensable tool.

I recommend _Beginning Perl_ from Wrox over _Learning Perl_ by O'Reilly,
but only by a hair. Both are good.

c

-BEGIN PGP SIGNATURE-
Version: PGP 7.0.3- signed for information authentication and security
Comment: Key ID: 0x51046CFD

iQA/AwUBO1YhadaLYehRBGz9EQJcIACgw3pQ3O4fhIbIQUOA84JLclcTOq0AoN5f
Q9Em4S5fJ/h7eS6cpYigOLtZ
=VYmH
-END PGP SIGNATURE-

-- 
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] a good PHP editor

2001-07-18 Thread Chris Lott

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Emacs on windows is great, and php-mode (there are a few. One that I have
a link close to hand for is at: http://sourceforge.net/projects/php-mode/
) is cool. I don't usually recommend it because it can be a pain to get
setup optimally, but once it is you can do everything within it: edit
documents, edit code and compile/test, use news, check mail, you name it.

c

-BEGIN PGP SIGNATURE-
Version: PGP 7.0.3- signed for information authentication and security
Comment: Key ID: 0x51046CFD

iQA/AwUBO1YiENaLYehRBGz9EQJnqgCg2FVY0EoHWgat8b5BSycAdNa9kf8AoL80
yQtjZOcK+MYAC6VKrl+cFIbE
=X7QV
-END PGP SIGNATURE-

-- 
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] Manual building/snapshot

2001-07-14 Thread Chris Lott

Since nothing seems to be available at snaps.php.net/manual I grabbed the
phpdoc cvs tree. Could anyone who is building their own manual tell me what
I need to build it? I'm running RedHat Linux 7.1

c
--
Chris Lott

-- 
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] Select IN array?

2001-07-14 Thread Chris Lott

I have an array of id numbers ($catids). I would like to select from the
mysql database all records where cid is in that array.

This syntax fails:
select * from categories
where cid in $catids

What is the correct way to do this? It can be done outside of a loop, can't
it?

c

-- 
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] Select IN array?

2001-07-14 Thread Chris Lott

 I have an array of id numbers ($catids). 

 This syntax fails:
 select * from categories
 where cid in $catids

Never mind. I was being stupid. For the record, one needs to implode(,,
$catids) and then use that in the WHERE statement, i.e. where cid in
($catids)

c

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

2001-07-09 Thread Chris Lott

The Library of Congress web site is good for that sort of thing. You can
search for an ISBN and have returned a formatted MARC record/etc which is
fairly easy to parse. I don't have code anymore, but I did exactly this at
one time.

c

 -Original Message-
 From: Reuben D Budiardja [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 09, 2001 10:55 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Book Database
 
 
 
 Hi,
 I'm doing project using php that will allow me to enter an 
 ISBN number of a 
 book, and put that book info into my database. 
 
 Is there any free book database out there that I can query 
 using ISBN, and 
 will return me the info such as the title, author, publisher? 
 If I can just 
 get the title and author, that would be great.
 
 Thanks.
 Reuben D. Budiardja
 
 -- 
 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] Next Book

2001-07-08 Thread Chris Lott

Finished with Beginning PHP from Wrox. Am eyeing Advanced PHP from Wrox.
Other good books I should think about? Recommendations? Reviews? I know the
PHP FAQ has pointers to books, but I am looking for recommendations on what
I SHOULD get as I transition from a Cold Fusion person to a PHP devotee :)

Also looking for a good book on MySQL. The MySQL/MSQL book from O'Reilly is
pretty dated.

c

-- 
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] Storing multi-page texts

2001-07-08 Thread Chris Lott

What kind of methods have any of you used for storing text that needs to be
displayed as both multi-page (for reading) and single-page (for printing)?
My plan is to store the articles with basic HTML formatting that will render
based on the site stylesheet(s).

I'm using MySQL.

My main question is how to deal with the multiple pages. Higher-ups would
prefer that article authors not have to split the file into various fields
when composing. My idea is to have the authors insert a code/comment that
indicates a page break in the text (something like, cryptically,
PAGEBREAK) and then when pulling the article from the DB, create a menu
for selecting pages (there has to be a small menu at the bottom of each
article with a link to each article page and an indication where the user
is), display the proper page, etc. 

I've still not got my head completely around how I am going to do this, so I
am looking for suggestions on how other sites manage this need.

c

-- 
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] Performance: functions vs includes?

2001-07-06 Thread Chris Lott

Is there a performance benefit or other reason to prefer including files or
using functions that write the same contents? For instance, on my pages I
have an number of includes for header, main nav, footer, random quote. If I
need to pass variables to one of them I just set the variable right before
the include.

I could of course do the same thing with an include file of functions that
output the data... 

Which one is better? Why?

c
--
Chris

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