Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Version 3.0 beta:


Message #1 by "Nikolai Devereaux" <yomama@u...> on Mon, 28 Jan 2002 11:53:12 -0800
The binary operation using lazy evaluation doesn't work, it always prints
"Hello, 1".

Version 3.0 beta is up at sourceforge.

<?php

require_once("greetings.inc");
require_once("db.inc");
require_once("binary_ops.inc");

$username = binary_or($HTTP_GET_VARS['username'], "world");

$query = "SELECT greet_id FROM greetings WHERE username='$username'";
$ret = db_query($query);

while(list(, $greet_id) = db_fetch_assoc($ret))
{
    echo $greeting[$greet_id] . $separator[$greet_id]
       . $username . $punctuation[$greet_id] . "\n";
}

?>



> -----Original Message-----
> From: Nikolai Devereaux [mailto:yomama@u...]
> Sent: Monday, January 28, 2002 11:11 AM
> To: professional php
> Subject: [pro_php] RE: my greeting card application:
>
>
>
> OOo oooh oooh, Jake just found a bug.  There's an updated version
> committed
> to PHP_Greetings at sourceforge.net:
>
> <?php
>
> $username = ($HTTP_GET_VARS['username'] || "world");
> echo "Hello, $username!";
>
> ?>
>
> Nik
>
> > -----Original Message-----
> > From: Nikolai Devereaux [mailto:nikolai@u...]
> > Sent: Monday, January 28, 2002 11:03 AM
> > To: professional php
> > Subject: [pro_php] my greeting card application:
> >
> >
> >
> > <?php
> >
> > $username = isset($HTTP_GET_VARS['username'])?
> > $HTTP_GET_VARS['username'] :
> > "world";
> >
> > echo "Hello, $username!\n");
> >
> > ?>
> >
> >
>
>


  Return to Index