php-general Digest 6 Dec 2007 21:59:38 -0000 Issue 5167

Topics (messages 265497 through 265530):

Re: Professional inquiry for you freelancers
        265497 by: Jochem Maas
        265502 by: Steve Finkelstein
        265504 by: Daniel Brown
        265506 by: Daniel Brown

Re: Calendar
        265498 by: Richard Heyes

Re: zip codes and lat/longs
        265499 by: Daniel Brown
        265500 by: Jason Pruim
        265501 by: Daniel Brown
        265503 by: mike
        265507 by: Daniel Brown
        265508 by: Jay Blanchard
        265509 by: mike
        265510 by: Daniel Brown
        265511 by: Richard Lynch
        265514 by: Daniel Brown
        265518 by: Robert Cummings

Re: shared memory access - shmod_open
        265505 by: Daniel Brown
        265516 by: Richard Lynch

Re: Maps
        265512 by: Richard Lynch
        265513 by: David Giragosian

Re: // ?>
        265515 by: Richard Lynch

Re: Another form handling posting question
        265517 by: Richard Lynch
        265522 by: tedd
        265523 by: tedd

Re: References to a variable and scope
        265519 by: Richard Lynch

Re: howto get .tar.gz content's filenames
        265520 by: Richard Lynch

Re: calculate a varchar
        265521 by: Richard Lynch

how to recognize ENUM column in table?
        265524 by: Afan Pasalic
        265528 by: Andrew Ballard
        265529 by: Afan Pasalic

How Much Time to do First PHP BB Setup
        265525 by: Stephen
        265526 by: Daniel Brown
        265527 by: Børge Holen

Seeking overlap algorithm
        265530 by: tedd

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Steve Finkelstein wrote:
> Hi all,

...

> 
> Basically what I'm asking is, am I going to be end up being a jack of
> all trades, master of none, if I continue pursuing design AND
> development? 

leonardo da vinci - i.e. there is nothing to say you can't be a master of
all trades. but realistically you may wish to focus more energy on the
development side of things :-) any design skills you choose to aquire
are going to be a bonus.

> Is there plenty of work out there for folks who just
> stick to development?

yes.

> 
> Thanks for your humble opinions.  Appreciate the feedback!

humble?

--- End Message ---
--- Begin Message ---
Wow, I fire off an e-mail before I hit the sack and wake up with
several great feedback!

No worries on the quality of humbleness, Daniel. ;-)

Overall, I do enjoy design. Heck, I wish I had more of a creative mind
and the logical programming mind at times. I just want to make sure
I'm not cutting myself short in the long run by limiting my coding
capabilities because of time I'm investing hours on end into a copy of
Photoshop that my company has picked up for me.

I really do appreciate the feedback. I'm going to run with it and see
how it goes.

Cheers all,

- sf

On 12/6/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Dec 6, 2007 3:23 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> > Steve Finkelstein wrote:
> > > Thanks for your humble opinions.  Appreciate the feedback!
> >
> > humble?
>
>     People on this list are anything BUT humble, Steve.
>
>     Now, as for my own petty opinion....
>
>     I always tell new clients that people are either expertly creative
> or technical, and that I'm very much the latter, but not the former.
> I can't design to save my ass.  I can put the HTML code together, but
> I may as well be colorblind when it comes to a good combination.  I'm
> just not good at coming up with a nice, clean layout.... so I
> generally have a friend, my pre-wife (who does some design work), or
> someone I know from online do the design part, if even only in
> PhotoShop, then I integrate it with my code.  Less hassle for me,
> overall, so I can focus on providing excellent code (see, no one here
> is humble!), without having it look like chewed-up and spit-out food
> that someone realized they didn't like just a bit too late.
>
> --
> Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>

--- End Message ---
--- Begin Message ---
On Dec 6, 2007 3:23 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Steve Finkelstein wrote:
> > Thanks for your humble opinions.  Appreciate the feedback!
>
> humble?

    People on this list are anything BUT humble, Steve.

    Now, as for my own petty opinion....

    I always tell new clients that people are either expertly creative
or technical, and that I'm very much the latter, but not the former.
I can't design to save my ass.  I can put the HTML code together, but
I may as well be colorblind when it comes to a good combination.  I'm
just not good at coming up with a nice, clean layout.... so I
generally have a friend, my pre-wife (who does some design work), or
someone I know from online do the design part, if even only in
PhotoShop, then I integrate it with my code.  Less hassle for me,
overall, so I can focus on providing excellent code (see, no one here
is humble!), without having it look like chewed-up and spit-out food
that someone realized they didn't like just a bit too late.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
On Dec 6, 2007 11:00 AM, Steve Finkelstein <[EMAIL PROTECTED]> wrote:
> Wow, I fire off an e-mail before I hit the sack and wake up with
> several great feedback!
>
> No worries on the quality of humbleness, Daniel. ;-)
>
> Overall, I do enjoy design. Heck, I wish I had more of a creative mind
> and the logical programming mind at times. I just want to make sure
> I'm not cutting myself short in the long run by limiting my coding
> capabilities because of time I'm investing hours on end into a copy of
> Photoshop that my company has picked up for me.
>
> I really do appreciate the feedback. I'm going to run with it and see
> how it goes.
>
> Cheers all,
>
> - sf

    And good luck with it!

    Dude, as long as you're enjoying what you're doing, you're going
to do a better job of it.  So don't limit yourself for any reason.

    [A shooting star flashes over my head, music plays, and the words
"The More You Know!" appear in front of me]

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
On Dec 5, 2007 6:09 AM, Richard Heyes <[EMAIL PROTECTED]> wrote:
There is not much "simple" about a calendar, especially when you start
dealing with recurring events. How far into the future your calendar
allow events to recur will depend at least in part on how you intend
to store them. For instance, you can store them in a database where
you create a separate event row for each occurrence (though still be
linked by a common ID as you said), but you'll probably set your
limits based on storage to prevent adding a daily event for the next
10 years.
Stipulating an event to be daily could be as simple as a 0 or 1 flag. So
where's the storage concern?

The storage concern comes if you opt to store one copy of the event
for every day for as long as the event recurs. Why? Perhaps you want
to provide the ability to alter the time of a specific instance of a
recurring event (or delete one instance altogether) without changing
the other instances.

So you could have a table which contains events, and a table which contains exceptions. Simple and minimal storage requirements. Since exceptions will be, as their name suggests, exceptional, storage requirements will be small.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

--- End Message ---
--- Begin Message ---
On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> Hi gang:
>
> I'm entertaining how to determine what zip codes fall within a 50
> mile radius of another zip code.
>
> Anyone done this before?
>
> Also, does anyone have any sources for zip codes and lat/long databases?

    Tedd,

    I have all of this in a MySQL database already, with census
information, water table info, and more.  If you want to take a look,
let me know and I'll give you a peek via phpMyAdmin to see if it'll
match your needs.

    For you, it's free.  All else must PAY!!!!  ;-P

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---

On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:

On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
Hi gang:

I'm entertaining how to determine what zip codes fall within a 50
mile radius of another zip code.

Anyone done this before?

Also, does anyone have any sources for zip codes and lat/long databases?

   Tedd,

   I have all of this in a MySQL database already, with census
information, water table info, and more.  If you want to take a look,
let me know and I'll give you a peek via phpMyAdmin to see if it'll
match your needs.

   For you, it's free.  All else must PAY!!!!  ;-P

You know...

in the mailing industry people pay $1,000 a year for that kind of info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak a peak at it? Maybe I need to look into writing my own geo mapping software...

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
On Dec 6, 2007 10:49 AM, Jason Pruim <[EMAIL PROTECTED]> wrote:
>
> On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:
>
> > On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> >> Hi gang:
> >>
> >> I'm entertaining how to determine what zip codes fall within a 50
> >> mile radius of another zip code.
> >>
> >> Anyone done this before?
> >>
> >> Also, does anyone have any sources for zip codes and lat/long
> >> databases?
> >
> >    Tedd,
> >
> >    I have all of this in a MySQL database already, with census
> > information, water table info, and more.  If you want to take a look,
> > let me know and I'll give you a peek via phpMyAdmin to see if it'll
> > match your needs.
> >
> >    For you, it's free.  All else must PAY!!!!  ;-P
>
> You know...
>
> in the mailing industry people pay $1,000 a year for that kind of
> info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak
> a peak at it? Maybe I need to look into writing my own geo mapping
> software...
>

    You sell it, you can have 50% of whatever revenue it generates,
without having to do a bit of code.

    It took me over a year to compile all of the information.  I know
I probably could've found it somewhere else for a few hundred dollars,
but I wanted to do it as a project for myself.... so I did.  ;-P

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
After reading this I decided to figure out what the issue was.

It was the MySQL result set. Somehow the columns changed and messed up
the float values. So I just whipped this up quick to reload the data
(and possibly update it too)

Here's the quick-and-dirty:

1) download ZCTA (the text version) from
http://www.census.gov/geo/www/gazetteer/places2k.html
2) run this

db_query("TRUNCATE TABLE data_zips");

$fp = fopen('zcta5.txt', 'r');
while(!feof($fp)) {
        $line = fgets($fp, 2048);
        $line = chop($line);
        $zip = substr($line, 2, 5);
        $lat = substr($line, 137, 9);
        $long = substr($line, 146, 12);
        db_query("INSERT INTO data_zips(zip, latitude, longitude)
VALUES('$zip', '$lat', '$long')");
}
fclose($fp);

schema:

CREATE TABLE `data_zips` (
  `zip` mediumint(5) unsigned zerofill NOT NULL default '00000',
  `latitude` float(9,6) NOT NULL default '0.000000',
  `longitude` float(9,6) NOT NULL default '0.000000',
  PRIMARY KEY  (`zip`),
  KEY `latitude` (`latitude`),
  KEY `longitude` (`longitude`));

I believe now you have everything you need :)


On 12/6/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> > Hi gang:
> >
> > I'm entertaining how to determine what zip codes fall within a 50
> > mile radius of another zip code.
> >
> > Anyone done this before?
> >
> > Also, does anyone have any sources for zip codes and lat/long databases?
>
>    Tedd,
>
>    I have all of this in a MySQL database already, with census
> information, water table info, and more.  If you want to take a look,
> let me know and I'll give you a peek via phpMyAdmin to see if it'll
> match your needs.
>
>    For you, it's free.  All else must PAY!!!!  ;-P
>
> --
> Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Dec 6, 2007 11:02 AM, mike <[EMAIL PROTECTED]> wrote:
[snip!]
> 1) download ZCTA (the text version) from
> http://www.census.gov/geo/www/gazetteer/places2k.html
[snip!]

    How you say?  Son of the bitch.

    Well, my database still has more information, including nearby ZIP
codes, et cetera.  It's about 38MB, total.

    Still.... son of the son of the son of the bitch.  Great-grandson
of the bitch.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
[snip]
I'm entertaining how to determine what zip codes fall within a 50 
mile radius of another zip code.

Anyone done this before?

Also, does anyone have any sources for zip codes and lat/long databases?

TIA for any help/suggestions.
[/snip]

Here is a code snip that I use to determine things within a certain
radius (5 miles) of a zip code;

/* calcs for distance */
function distance($lat1, $lon1, $lat2, $lon2) { 
        $theta = $lon1 - $lon2; 
        $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +
cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); 
        $dist = acos($dist); 
        $dist = rad2deg($dist); 
        $miles = $dist * 60 * 1.1515;

--- End Message ---
--- Begin Message ---
You can use the formula to figure out how many zip codes are within the radius

Here's a snippet of old code that did that:

$radius = 50; // in miles

        $uchk = db_query("SELECT uz.zip FROM user_zip WHERE uid=$visitor[uid]");
        if(db_numrows($uchk) == 1) {
                list($vz) = db_rows($uchk);
                        $zchk = db_query("SELECT latitude,longitude
FROM z_data_zips WHERE zip=$vz");
                        list($vlat,$vlong) = db_rows($zchk);
                        db_free($zchk);
                        $zips = db_query("SELECT z.zip FROM data_zips
z WHERE CEIL(69*DEGREES(ACOS(SIN(RADIANS(z.latitude)) *
SIN(RADIANS($vlat)) + COS(RADIANS(z.latitude)) * COS(RADIANS($vlat)) *
COS(RADIANS(z.longitude - $vlong))))) < $radius");
                        $ziplist = "";
                        if(db_numrows($zips) > 0) {
                                while(list($zip) = db_rows($zips)) {
                                        $ziplist .= "'$zip',";
                                }
                                db_free($zips);
                                $ziplist =
substr($ziplist,0,strlen($ziplist)-1);
                                $query .= " user_zips IN($ziplist)";
                        }
        }
        db_free($uchk);



On 12/6/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Dec 6, 2007 11:02 AM, mike <[EMAIL PROTECTED]> wrote:
> [snip!]
> > 1) download ZCTA (the text version) from
> > http://www.census.gov/geo/www/gazetteer/places2k.html
> [snip!]
>
>    How you say?  Son of the bitch.
>
>    Well, my database still has more information, including nearby ZIP
> codes, et cetera.  It's about 38MB, total.
>
>    Still.... son of the son of the son of the bitch.  Great-grandson
> of the bitch.
>
> --
> Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>

--- End Message ---
--- Begin Message ---
On Dec 6, 2007 11:12 AM, mike <[EMAIL PROTECTED]> wrote:
> You can use the formula to figure out how many zip codes are within the radius

    Or you can stop shooting me in the ass by showing me things that
make me wonder why I wasted all that time!  ;-P

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
On Thu, December 6, 2007 9:49 am, Jason Pruim wrote:
>
> On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:
>
>> On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
>>> Hi gang:
>>>
>>> I'm entertaining how to determine what zip codes fall within a 50
>>> mile radius of another zip code.
>>>
>>> Anyone done this before?
>>>
>>> Also, does anyone have any sources for zip codes and lat/long
>>> databases?
>>
>>    Tedd,
>>
>>    I have all of this in a MySQL database already, with census
>> information, water table info, and more.  If you want to take a
>> look,
>> let me know and I'll give you a peek via phpMyAdmin to see if it'll
>> match your needs.
>>
>>    For you, it's free.  All else must PAY!!!!  ;-P
>
> You know...
>
> in the mailing industry people pay $1,000 a year for that kind of
> info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak
> a peak at it? Maybe I need to look into writing my own geo mapping
> software...

The free one is from an OLD US census, paid for by taxpayers, and
therefore Public Domain.

$1,000 ones (should) include new zips (lots) and up-to-date population
info etc.

YMMV

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Dec 6, 2007 11:43 AM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> The free one is from an OLD US census, paid for by taxpayers, and
> therefore Public Domain.
>
> $1,000 ones (should) include new zips (lots) and up-to-date population
> info etc.

    Yeah, mine actually does.  It's from 2006 and 2007 data, actually.
 I was just whining to read myself whine.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
Welcome back Richard :)

Cheers,
Rob.


On Thu, 2007-12-06 at 10:43 -0600, Richard Lynch wrote:
> On Thu, December 6, 2007 9:49 am, Jason Pruim wrote:
> >
> > On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:
> >
> >> On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> >>> Hi gang:
> >>>
> >>> I'm entertaining how to determine what zip codes fall within a 50
> >>> mile radius of another zip code.
> >>>
> >>> Anyone done this before?
> >>>
> >>> Also, does anyone have any sources for zip codes and lat/long
> >>> databases?
> >>
> >>    Tedd,
> >>
> >>    I have all of this in a MySQL database already, with census
> >> information, water table info, and more.  If you want to take a
> >> look,
> >> let me know and I'll give you a peek via phpMyAdmin to see if it'll
> >> match your needs.
> >>
> >>    For you, it's free.  All else must PAY!!!!  ;-P
> >
> > You know...
> >
> > in the mailing industry people pay $1,000 a year for that kind of
> > info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak
> > a peak at it? Maybe I need to look into writing my own geo mapping
> > software...
> 
> The free one is from an OLD US census, paid for by taxpayers, and
> therefore Public Domain.
> 
> $1,000 ones (should) include new zips (lots) and up-to-date population
> info etc.
> 
> YMMV
> 
> -- 
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
> 
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

--- End Message ---
--- Begin Message ---
On Dec 6, 2007 3:44 AM, Rolf_ <[EMAIL PROTECTED]> wrote:
>
> Dear List,
>
> I have a problem working with shmop_open() in a Solaris environment. The
> following cli-script works fine, except shmod_open returns a warning 'unable
> to attach or create shared memory segment':
[snip!]

    Rolf,

    I don't know if it will help you in your exact situation, but
here's a link to someone who had a similar problem, found in the
archives:
        http://archives.neohapsis.com/archives/php/2005-11/0028.html

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
On Thu, December 6, 2007 2:44 am, Rolf_ wrote:
> I have a problem working with shmop_open() in a Solaris environment.
> The
> following cli-script works fine, except shmod_open returns a warning
> 'unable
> to attach or create shared memory segment':
>
> <?php
> $sem = "/tmp/" . rand() . ".sem";
> touch ($sem);
> echo "sem $sem \n";
>
> $sem_key = ftok($sem, 'w');
> echo "sem_key $sem_key \n";
>
> if ($sem_key == -1) { die ("ftok error"); }
>
> $shm_id = shmop_open($sem_key, "w", 0644, 1);
> echo "shm_id $shm_id\n";
> ?>
>
> I checked the $sem_key with the Solaris ipcs command. The file exists
> and
> the read/write rights are correct. I tried explictly to call
> shmop_open with
> the right key - the error message remains the same.
>
> Checking out different access mode like "r" does not succeed too. In
> the
> Xdebug output, php changes the value 0644 to 420, i.e.
> shmop_open(1258300033, 'w', 420, 1). Of course, I compiled php with
> --enable-shmop.
>
> Does anyone has an idea what I might also check?

Perhaps the 0644 needs to be expressed in some other way?

I know it works fine that way for chmod and friends, so I wouldn't
expect it, but...

Or maybe 420 *IS* the right value, and you're on a red herring.

Try Googling for the error message and Solaris if you haven't done
that yet.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
Yes, you can do that, and look at Yahoo! maps as an alternative.

Same smell. :-)

On Wed, December 5, 2007 12:27 pm, Robert Fitzpatrick wrote:
> Well, I have two clients that both want mapping for their sales
> people.
> I have been looking at the Google API and Phoogle
> (www.systemsevendesigns.com/phoogle). I assume with these examples I
> will be able to produce what they need? Which is to select several
> addresses and produce a fastest route map with directions to those
> addresses from a start address. Not clear from my reading yet, but can
> someone with some experience tell me if this is possible with the
> Google
> API or some hints that might speed up my process of the best way to go
> for this...
>
> Thanks in advance!
>
> --
> Robert
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On 12/6/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> Yes, you can do that, and look at Yahoo! maps as an alternative.
>
> Same smell. :-)
>
> On Wed, December 5, 2007 12:27 pm, Robert Fitzpatrick wrote:
> > Well, I have two clients that both want mapping for their sales
> > people.
> > I have been looking at the Google API and Phoogle
> > (www.systemsevendesigns.com/phoogle). I assume with these examples I
> > will be able to produce what they need? Which is to select several
> > addresses and produce a fastest route map with directions to those
> > addresses from a start address. Not clear from my reading yet, but can
> > someone with some experience tell me if this is possible with the
> > Google
> > API or some hints that might speed up my process of the best way to go
> > for this...
> >
> > Thanks in advance!
> >
> > --
> > Robert
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Welcome back, Richard.

David

--- End Message ---
--- Begin Message ---
On Tue, December 4, 2007 7:41 pm, Kevin Schmeichel wrote:
> Here's some unexpected behavior:
>
> <?php
> // ?> what?
> ?>
>
> This will output "what?" - I expected no output, as is the case if the
> inline comment was a /* */ comment.  Is this a bug?

The <?php and ?> are parsed first, and the // only applies to
everything up TO the ?> bit.

Don't do that. :-)


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
EVERY HTTP request is completely independent of the previous/following
ones, unless you specifically tie them together with YOUR code.

If you want to accumulate data from $_POST, start a session
http://php.net/session_start and cram the data you need to keep into
$_SESSION as you go.

On Wed, December 5, 2007 11:36 pm, Mike Smith wrote:
> I am trying to recursively send data to the same form.  Based on the
> data, I
> want to determine which "action" is to be processed.  It appears that
> the
> $_POST is not being cleared out or cached once it is sent to the
> server.
> Here is my code that I'm trying to test with.  It doesn't seem to
> consistently send me to the correct page each time.
>
> <?php
>
>  $process = $_POST['process'];
>
>  if ($process == "Pass")
>   {
>   echo "<form method='POST' action=success.php>";
>   }
>  else
>   {
>   echo "<form method='POST' action=recursive.php>";
>   }
> ?>
>
>  <table border="0" id="table1" width="58">
>   <tr>
>    <td align="center">
>    <input type="radio" checked name="process" value="Pass"
> tabindex="1"></td>
>    <td align="left">Pass</td>
>   </tr>
>   <tr>
>    <td align="center" width="20">
>    <input type="radio" name="process" value="Fail" tabindex="2"></td>
>    <td align="left" width="28">
>    Fail</td>
>   </tr>
>  </table>
>  <input type="submit" value="Submit" name="B1"> <input type="reset"
> value="Reset" name="B2">
> </form>
>
> I want to use a single submit button that will send the "action" to
> the
> right page.
>
> What is the best practice for doing this?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
At 10:30 PM -0700 12/5/07, Mike Smith wrote:
I'm trying to

Me too -- just as my friends.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
At 10:36 PM -0700 12/5/07, Mike Smith wrote:
I am trying to recursively send data to the same form.

-snip-

What is the best practice for doing this?


I don't know what the "best" practice is, but this is the way I do it.

In the form I have a hidden field called step that controls flow via POST..

Based upon that value, I use a switch to direct the flow to different forms -- all the forms have the same submit button.

So, it looks like this (pseudo-code):

$step = isset($_POST['step']) ? $_POST['step'] : 1;

<form action=self method=post>

switch $step
  {
  case 1:
  // present the form for step 1
  <input hidden step=2>

  case 2:
  // present the form for step 2
  <input hidden step=3>

  case 3:
  // present the form for step 3
  }

<input type=submit name=submit type=submit>

That way, it's simple to recursively change a form to gather information.

If you want to keep/store data in each gather, then either save it to a dB or do sessions.

It works for me.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Tue, December 4, 2007 2:58 pm, Cesar D. Rodas wrote:
> I know that PHP doesn't support pointers to a variable, instead of
> that
> there is references to a variable which are similar to pointers,
> right?
>
> BTW, what I want to do is to save a references to a variable and read
> the
> content when I need, similar to PDO "bindParam". I will try to explain
> better in the following pseudo php code.
>
> function foo($a) {
>        $GLOBALS['references']['a'] = /*references to $a */
> }
>
> function bar() {
>       echo $GLOBALS['references']['a'];
> }
>
> $var="hello"
> foo($var);
> $var = "hi";
> bar(); /* it should print "hi" instead of "hello" */

If you are making things this complicated, you will probably regret it
someday...

That said, I think if you just did:
foo('var');
and changed the 'a' in foo/bar to $a
then you would get what you want...

It won't be a reference nor a pointer, but just a global variable,
disguised by using $GLOBALS instead of:
global $var;
as you should do for clarity.

YMMV

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Mon, December 3, 2007 9:05 pm, Shelley Shyan wrote:
> It may not be a php question, but I want to get the filename lists
> that a .tar.gz file contains and give it to an array.
> How can I manage that?

I thought there was a 'tar' PHP extension, but don't see it now...

There is a 'gzip' you can use to unzip it...

If all else fails, punt to the OS:

<?php
  exec('/full/path/to/your/binary/tar -tzvf
/full/path/to/file.tar.gz', $output, $error);
  var_dump($output);
  if ($error){
    echo "OS Error: $error\n";
  }
?>

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
I won't say you CAN'T do it (you can with eval) but you'd be WAY
better off to use some kind of exchange rate field that you can change
frequently instead of cramming formulas into the field.

"If eval is the answer, you are probably doing something wrong."

You may also want to store everything as cents (or pence) and only
insert the decimal on display to avoid rounding errors.

On Mon, December 3, 2007 9:56 am, John Taylor-Johnston wrote:
> Is there a calculation function?
>
> I'm using an e-commerce shopping cart. I want to tweak the code. The
> author is using a varchar(100) field to store prices.
>
> Taking advantage of there being a varchar, instead of entering a
> price,
> I would like to enter a calculation.
>
> (24*2.2)+(24*2.2*.1) 24 is my unit price in British pounds. 2.2 is the
> exchange rate into Canadian dollars. etc.
>
> The exchange rate changes frequently. Instead of recalculating and
> entering a new price every few days, it would be useful to enter a
> calculation in any price field.
>
> I had a look at: http://ca3.php.net/manual-lookup.php?pattern=calc
> http://ca3.php.net/manual-lookup.php?pattern=calculate
> http://ca3.php.net/manual-lookup.php?pattern=calculation
> but I see no function, although I'm sure there is one.
>
> So how could I do this?
>
> $price = (24*2.2)+(24*2.2*.1);
>
> if $price is not an integer, verify if it is a calculation. If so,
> give
> me an integer and round it off to two decimal points:
>
> $price = 58.08;
>
> Do-able?
>
> John
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
hi,
I use the code from
http://www.php.net/manual/en/function.mysql-fetch-field
(example #1)
I'm getting everything I need but can't recognize if the column is ENUM() type?

e.g. column "status" is ENUM('0','1') or ENUM('live','hidden','archive') or something like that. I want to recognize this column and then create a form with radio buttons
o 0   o 1 or
o live   o hidden   o archive

is it possible?

thanks.

-afan

--- End Message ---
--- Begin Message ---
On Dec 6, 2007 1:38 PM, Afan Pasalic <[EMAIL PROTECTED]> wrote:
> hi,
> I use the code from
> http://www.php.net/manual/en/function.mysql-fetch-field
> (example #1)
> I'm getting everything I need but can't recognize if the column is
> ENUM() type?
>
> e.g. column "status" is ENUM('0','1') or ENUM('live','hidden','archive')
> or something like that. I want to recognize this column and then create
> a form with radio buttons
> o 0   o 1 or
> o live   o hidden   o archive
>
> is it possible?
>
> thanks.
>
> -afan

The only way I've seen to do this is to first execute the query
DESCRIBE `my_table` and then examine the value of the `Type` column
that is returned for the row that represents the column you are
examining in your regular query. You just have to strip the 'ENUM('
and ')' from the beginning and end and then split the remaining
string.

Andrew

--- End Message ---
--- Begin Message ---
sounds like a solution!
:)

thanks andrew.

-afan




Andrew Ballard wrote:
On Dec 6, 2007 1:38 PM, Afan Pasalic <[EMAIL PROTECTED]> wrote:
hi,
I use the code from
http://www.php.net/manual/en/function.mysql-fetch-field
(example #1)
I'm getting everything I need but can't recognize if the column is
ENUM() type?

e.g. column "status" is ENUM('0','1') or ENUM('live','hidden','archive')
or something like that. I want to recognize this column and then create
a form with radio buttons
o 0   o 1 or
o live   o hidden   o archive

is it possible?

thanks.

-afan

The only way I've seen to do this is to first execute the query
DESCRIBE `my_table` and then examine the value of the `Type` column
that is returned for the row that represents the column you are
examining in your regular query. You just have to strip the 'ENUM('
and ')' from the beginning and end and then split the remaining
string.

Andrew

--- End Message ---
--- Begin Message ---
Hi

I am considering taking on a project, part of which is setting up PHP BB.

I have not done this before but have done Linux/PHP/MySQL web sites.

What would be a realistic time estimate for me to get this running, including going through the documentation and learning basic administration?

Thanks!
Stephen

--- End Message ---
--- Begin Message ---
On Dec 6, 2007 2:16 PM, Stephen <[EMAIL PROTECTED]> wrote:
> Hi
>
> I am considering taking on a project, part of which is setting up PHP BB.
>
> I have not done this before but have done Linux/PHP/MySQL web sites.
>
> What would be a realistic time estimate for me to get this running,
> including going through the documentation and learning basic administration?
>
> Thanks!
> Stephen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

    Stephen,

    That is in no way whatsoever a PHP question.  Check out the forums
at the phpBB website (http://www.phpbb.com/).  Despite the name, it's
not at all associated with the PHP project.

    On a side note, uploading, configuring, installing the databases,
et cetera, for a base installation should only take about three
minutes.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
On Thursday 06 December 2007 20:16:51 Stephen wrote:
> Hi
>
> I am considering taking on a project, part of which is setting up PHP BB.
>
> I have not done this before but have done Linux/PHP/MySQL web sites.
>
> What would be a realistic time estimate for me to get this running,
> including going through the documentation and learning basic
> administration?

You tried it before you ask, yes? It should be straight forward then, look at 
the clock.
See, the time there is quite individual, I got friends, with NO knowledge of 
php or LAMP at ALL, they DO know how to setup phpbb,
I've never done it, but I know (this have the potential to start a nice 
flamewar... the _knowing_ part I mean) php and LAMP.

Who would be using the least amount of time, and why?
I wouldn't know before trying it...
If I knew how, I bet that time would be somewhat off of what you would take, 
if you didn't know and/or never tried it.

>
> Thanks!
> Stephen



-- 
---
Børge Holen
http://www.arivene.net

--- End Message ---
--- Begin Message ---
Hi gang:

This post is related to the zip lat/long request I recently made and received such an overwhelming response -- many thanks to all.

In any event, let's say we have a end-user who is looking for services within his zip-code AND we have a dB of service providers who are willing to render service within a set distance (like 50 miles) from their location.

Now, it's a simple matter to convert the user's zip code to lat/longs and then find out how many service providers there are within their area and then show that list to the end-user. That's not the problem.

The problem is, could you guarantee to a "preferred" service provider that they would receive top-listing 25 percent of the time? Keep in mind that preferred service providers will overlap. So, the question is how to accommodate for that overlap?

If anyone has an algorithm, I would be interested in hearing it.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---

Reply via email to