Re: [PHP] ability to find include files...

2008-11-16 Thread tedd

At 3:07 PM -0800 11/15/08, bruce wrote:

Hi list...

starting to go through a debug/understanding session of a couple of php web
apps. i'm wondering if there's any kind of tool/method that i can use to see
which files are accessed/included/required when a given page is displayed..

this would allow me to quickly understand the "flow" of the apps. searching
via google hasn't really turned up anything...

thoughts/comments/pointers welcome.


One of the techniques I use is to place an "echo('');" 
at the top of all includes. Then when parent scripts are run, you see 
which includes are loaded.


I also do this to see if an include has any problems -- for if it 
does, then you won't see it report.


HTH's

tedd

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

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



Re: [PHP] Days until Easter and Christmas

2008-11-16 Thread tedd

At 6:51 PM -0500 11/15/08, Ron Piggott wrote:

Is there a way to modify this code so it will always be the *next*
Christmas and Easter?

";
echo $days_until_Easter . "";



Try this:

http://www.webbytedd.com/b2/easter/

It's just an organizational issue.

Cheers,

tedd


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

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



Re: [PHP] Another question about Google maps

2008-11-16 Thread tedd

At 1:29 AM +1030 11/17/08, Michael Kubler wrote:

Well, it shows up for FFox v2 and v3 on Windows XP as well.
I managed to replicate it by shift+refreshing the page.

I also managed to stop it mid load by setting Firefox to 'Work 
Offline' just as it displayed the flash of both boxes.


Using the Web Developer plugin for FFox I can tell you that the top 
box has a class of '.gsmsc-mapDiv' while the bottom div one is 
'.gsmsc-idleMapDiv', and both are wrapped in the 
'.gsmsc-appContainer' div, and also the '#mapsearch' div.


I've not played with google maps enough, but doubt the above helps, 
I just but know that it's not a PHP issue. It's almost like a flash 
of unstyled content <http://www.bluerobot.com/web/css/fouc.asp/>, 
but is being generated because of the javascript.


I hid the '.gsmsc-mapDiv' which stopped the flash of both box boxes 
appearing, and I could view the map, but caused the map to disappear 
after I tried searching for a different Google Maps location.


Michael Kubler
*G*rey *P*hoenix *P*roductions <http://www.greyphoenix.biz>


Michael

Thanks very much for your time looking into this.

It IS very similar of FOUC and I looked into that as a possible 
problem/solution.


I think you can see why I didn't get a reply from my Google post -- 
it's one of those problems that Google has, but doesn't yet 
understand it well enough to fix it. Too busy with new stuff *.


I may have to hide the map via css and then change display after load 
-- I just didn't want to go that route IF there was a better way.


Thanks again,

tedd


PS: * I really like Google's Analytics, but hate all the javascript 
errors it generates in FF firebug.


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

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



Re: [PHP] Days until Easter and Christmas

2008-11-16 Thread tedd

At 6:51 PM -0500 11/15/08, Ron Piggott wrote:

Is there a way to modify this code so it will always be the *next*
Christmas and Easter?


Also, I forgot to add.

Easter lands on different dates depending upon several different 
factors. For example in Canada it's the day after it is in the USA -- 
I guess Canadians are slower, eh?  :-)


Also, in some religions the date is the full-moon after the Equinox 
and not a specific date. Furthermore, the Equinox does not always 
land on March 21, but sometimes it's March 20 (leap year).


As an example, next year Easter will be on April 9, 12, 13, and 19th 
-- the ten days of Easter.  :-)


You can read more about it here:

http://en.wikipedia.org/wiki/Easter

So, my example here:

http://www.webbytedd.com/b2/easter/

would be more correct if it took into account leap year, location, 
and what religion it's for.


Cheers,

tedd

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

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



RE: [PHP] Another question about Google maps

2008-11-17 Thread tedd

At 8:37 AM -0600 11/17/08, Boyd, Todd M. wrote:

tedd, I think it might be displaying your extra divs (if there are any..
just skimmed the source momentarily) for a split second before they are
hidden with Javascript. Maybe try setting the CSS for your 3 map divs
(mapsearch, idlediv, searchdiv or whatever) to display:none and show
them when the page is loaded? Or give all 3 the same top/left
coordinates, etc...

Just a shot in the dark. I may read over the code a bit more if I get
some time later today. I'm no expert, but I've been working with the
Google Maps API rather extensively lately, and maybe I can offer a fresh
set of eyes.

HTH,


Todd Boyd
Web Programmer


Todd:

That would be great. Also, if you see anything there you like, of 
course you may use it.


I think the div's are Okay -- I always check my code through the W3C 
validator and that does a good job of checking that. I wish that 
Google and W3C would decide on what's "acceptable".


I also tried "display: none" via css, but could not get the right 
combination of hide/display to make it work right. However, I'll look 
into your suggestion.


If you can find anything to correct, that would be good. But it's 
just a minor annoyance and I thought someone might readily know what 
the problem was.


Cheers,

tedd

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

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



[PHP] Re: while question

2008-11-17 Thread tedd

At 2:25 PM + 11/17/08, Nathan Rixham wrote:


sounds like a poor teacher


It's more likely a poor student who wants us to answer the questions, 
but hasn't the time to investigate the answer OR write a question 
more correctly himself.


Cheers,

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

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



RE: [PHP] while-question

2008-11-17 Thread tedd

At 10:00 AM -0800 11/17/08, bruce wrote:

curious qiestion

to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..

or is the majority of the work here from people who've grabbed the tools and
started programming... ?



Dabbling?

I think that making a living from it isn't dabbling, so I may not be 
qualified to speak for the dabblers.


But for me, I was writing code before there were such courses. Later, 
when I went to college I was taught adventures in keypunching and 
received several "next to worthless" degrees.


I say "next to worthless" only because what they taught really wasn't 
applicable to real world programming. As for management, clients, and 
hr types, the degrees mattered, but not for much more than that.


In any event, I doubt if any college courses are keeping up with 
current web technology -- there has always been a lag between what's 
practiced and what's taught. What I've seen of college web sites, 
seems to support that claim.


If I was taught in college all I needed to know, then what am I doing 
with these dozens of web books scattered about my office? I probably 
read a new book every other week.


Cheers,

tedd

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

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



Re: [PHP] Experience (was: while-question)

2008-11-17 Thread tedd

At 11:23 AM -0800 11/17/08, Yeti wrote:

who says PHP means programming?


Who says it doesn't?

I can program with rocks -- and do a good job of it. I can make a one 
that can stand for a couple of thousand years.


Show me code that can last longer.

Cheers,

tedd

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

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



Re: [PHP] Experience (was: while-question)

2008-11-17 Thread tedd

At 8:20 PM + 11/17/08, Stut wrote:

On 17 Nov 2008, at 19:43, Yeti wrote:

Ok, ok I admit it. PHP is a programming language. I guess I drank too
much assembly code today.


Seriously tho, I define programming / coding / software development 
as writing instructions for a computer to follow. I don't care 
whether you do it in Perl, PHP, C, C++, Ruby, Python, COBOl or 
assembly, you're programming.


If you feel that you need to demote people using certain languages 
to less than programmers then 1) don't ever expect a job from me, 
and 2) get over yourself and try living in the real world where the 
problem that matters more than the solution.


-Stut



And the computer does not have to be electronic nor the language written.

Cheers,

tedd

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

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



RE: [PHP] while-question

2008-11-17 Thread tedd

At 2:55 PM -0500 11/17/08, Wolf wrote:
Tedd, glad you got hooked on Phonics.  One of these days I hope from 
graduating from just looking at the pictures, but right now the 
pictures are oh so enticing!. ;) 


Wolf


Wolf:

Lot's of exciting things -- hard to keep up on bots, automated 
buying, data mining, and other such things that make my head hurt.


Cheers,

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

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



Re: [PHP] Experience (was: while-question)

2008-11-17 Thread tedd

At 10:49 PM + 11/17/08, Ashley Sheridan wrote:

So just trolling here, but do conditional comments in HTML make it a
programming language? :p


Why not?

Sure, it's a mark-up language but if you don't program it right, it 
will screw up -- it's just more forgiving than most. Also, CSS is a 
programming language and it doesn't have any conditional branching 
other than browser hacks. If you think either of those two are not 
languages, then I think you're underestimating their power.


I think the division between what is/isn't a computer language is 
somewhat blurred today as compared as to what it used to be.


I remember we had the types who said that if you weren't programming 
on a mainframe, then you weren't programming. Others said if it's not 
compiled, then it's not a real application either. Both statement 
were equally lame.


There has always been (probably always will be) those who want to 
separate people into different camps based upon their opinion -- but 
so what? Who cares? I don't.


Over the years, I've had an assortment of clients who knew nothing 
about computer languages, but insisted on a specific language because 
of their limited understanding. I even had one client where I 
provided the end application that did everything he wanted, but he 
refused to consider it because if was written in a language that his 
friends thought too basic. Yes it was BASIC, but it worked better 
than the C++ crap that his programmers eventually developed two years 
later.


My position -- give me a problem and get out of my way while I solve 
it. Some clients have problems with that and other don't. The ones 
that don't usually get a better product.


Cheers,

tedd

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

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



Re: [PHP] Experience (was: while-question)

2008-11-17 Thread tedd

At 11:40 AM +1100 11/18/08, Ross McKay wrote:

On Mon, 17 Nov 2008 14:30:34 -0500, tedd.sperling wrote:


I can program with rocks -- and do a good job of it. I can make a one
that can stand for a couple of thousand years.


http://xkcd.com/505/



Ross:

That's super and fits.

The only difference in the comic was the programmer was using zeros 
(absence of rock). That technical advancement came after I started 
programming.


Cheers,

tedd

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

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



Re: [PHP] while-question

2008-11-17 Thread tedd

At 12:52 AM +0100 11/18/08, Jochem Maas wrote:

Craige Leeder schreef:
 > I'm 100% self taught for now. I'm just out of higschool, and hopefully

 going off to collage next year.


must  . resist 

"I take you didn't score to hig on the spelling test? and collage,
is that the the cut-n-paste school of IT?"

 dang it, failed. ;-)


Hang in there Jochem -- he's probably smarter than we were when we 
were his age.


Cheers,

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

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



Re: [PHP] while-question

2008-11-17 Thread tedd

At 7:02 PM -0500 11/17/08, Craige Leeder wrote:

I'm not illiterate; promise :p

- Craige



Yeah, his parents were married before he was born.

Cheers,

tedd



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

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



Re: [PHP] Days until Easter and Christmas

2008-11-18 Thread tedd

At 10:56 PM +1100 11/18/08, Kevin Waterson wrote:

This one time, at band camp, tedd <[EMAIL PROTECTED]> wrote:


 Easter lands on different dates depending upon several different
 factors. For example in Canada it's the day after it is in the USA --
 I guess Canadians are slower, eh?  :-)

 Also, in some religions the date is the full-moon after the Equinox
 and not a specific date. Furthermore, the Equinox does not always
 land on March 21, but sometimes it's March 20 (leap year).


So, the key is to find the date of the Vernal Equinox, which as you say,
does not always land on March 21. However, every 400 years, it does happen
on March 21 7:30am GST. From there, we can derive a base for future dates.
Every 4th year is a leap year, and every 4th century, giving 97 leap days
each 400 years. so (365*400+97)/400 is 365.2425 gives the length of each year.
Then the dates can be calculated as follows:

http://phpro.org/examples/Get-Vernal-Equinox.html

Any improvements welcomed

Kind regards
Kevin


Kevin:

So here you are -- I was wondering where we had crossed paths before 
(to others, we were discussing this off-list).


Yes, your code does produce the correct results that show in the 
years 2003 and 2007 the Vernal Equinox was on March 21 and not March 
20 as the majority of years show.


I was wrongly thinking that the Vernal Equinox landed on March 21 
every leap year, but it doesn't. It's more complicated than that.


It's interesting to see how close some of these dates/times get to 
landing on March 21. I'm sure there must be some pattern there, but I 
can't detect it.


Thanks for your work.

Cheers,

tedd

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

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



Re: [PHP] anchor name on URL

2008-11-18 Thread tedd

At 12:25 PM -0600 11/18/08, Stan wrote:

If I had a page written in HTML and I had a named anchor on that page

I could position the user at the anchor by
http://myPage.com/myHTML.htm#myAnchor
but I can't seem to make this work if the page is generated
http://mypage.com/myPHP.php#myAnchor

I've tried both FireFox 3.0.4 and IE 6 SP1.  Maybe I'm naive to even expect
this to work.  Should it work?

If not, how can I (can I even) position the user at some point into a long
page when the page is generated on the fly?

Thanks,
Stan



Stan:

That should work -- I just did exactly that for a client a couple of 
days ago. It does not make any difference if you are using html or 
.php -- it will work.



http://mypage.com/myPHP.php#myAnchor";>Whatever

Clicking tha above link will cause the myPHP.php page to load and the 
browser to go to the myAnchor tag within the page.


Check your spelling of the name and the href.

Cheers,

tedd

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

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



[PHP] Scheduling scripts?

2008-11-18 Thread tedd

Hi guys:

Dones anyone have any scheduling scripts that they might share OR can 
give me a link to some?


I need a way for a user to register an appointment via a calendar.

I don't want to write something that's already been done and available.

Cheers,

tedd


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

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



[PHP] Stats (was anchor name on URL)

2008-11-19 Thread tedd

Nathan Rixham wrote:

well that bubble should have popped..

from some of my sites:
Browser % visits
Firefox   88.43%
Internet Explorer 9.99%


and

At 12:25 PM + 11/19/08, Stut wrote:
Firefox is certainly gaining, as is Safari, but IE is still the 
dominant player by far.


To all:

While IE may reign over the net generally, who visits your site often 
depends on what you're providing -- for example:


Last week http://sperling.com (a general purpose site) had 1983 
visits. The browser break down was:


Browser   Visits   %visits
Firefox   853   43.02%
IE   842   42.46%
Safari   183   9.23%
Chrome   46   2.32%
Opera   34   1.71%

Whereas last week http://xb--19g.com (a Mac specific site) had 3012 
visits. The browser break down was:


Browser   Visits   %visits
Safari   2,837   94.19%
Firefox   133   42.46%
Camino   21   9.23%
Mozilla   6   0.20%
Opera   5   0.17%

In fact -- over the last two years that site has had over 49,000 
visitors with only 186 using IE.


Browser   Visits   %visits
Safari   45,023   94.19%
Firefox   2,679   5.46%
Camino   893   1.82%
IE   186   0.38%%
Mozilla   134   0.27%

How cool is that?

In incidentally, the sperling.com site had an average time on site of 
over 2 minutes whereas the Mac site had an average time of only 13 
seconds. There are also other significant differences between the 
sites.


Cheers,

tedd

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

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



Re: [PHP] Scheduling scripts?

2008-11-19 Thread tedd

At 6:36 PM -0500 11/18/08, Daniel P. Brown wrote:

Strictly a public calendar, Tedd, or one with a full registration
and appointment-setting system?



Daniel:

The project is to tie students to classes for online registration.

The client was using Google's Calendar system, but is now wanting to 
do it internally.


So, I need a way to show a calendar of dates/times of classes 
available for registration and deal with the specifics.


Cheers,

tedd

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

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



Re: [PHP] Stats (was anchor name on URL)

2008-11-19 Thread tedd

At 7:44 PM + 11/19/08, Luke Slater wrote:


What kind of thing is under Unknown?


Well, if it was known, it wouldn't be unknown, right?

Cheers,

tedd


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

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



[PHP] Voting methodology

2008-11-26 Thread tedd

Hi gang:

What methodology would be the best for online voting?

I have a client who is a Union and they want members to vote online, 
but don't want someone to stuff the voting box.


I have some ideas of my own, but would like to hear what you people 
would recommend.


Cheers,

tedd

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

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



[PHP] Online Calendars

2008-11-26 Thread tedd

Hi gang:

What online calendars would any of you recommend or have experiences 
with one way or the other?


Cheers,

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

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



Re: [PHP] Voting methodology

2008-11-26 Thread tedd

At 9:23 AM -0500 11/26/08, tedd wrote:

Hi gang:

What methodology would be the best for online voting?

I have a client who is a Union and they want members to vote online, 
but don't want someone to stuff the voting box.


I have some ideas of my own, but would like to hear what you people 
would recommend.


Cheers,

tedd



Thanks guys for the suggestions.

I think registering the member via their union ID vard number and 
then recording their vote as Daniel suggested is probably best.


They were leaning toward some popular canned script that they say all 
other unions use (don't know what that is) because it's secure (don't 
know what that means).


I'll find out soon enough.

Thanks again.

Cheers,

tedd


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

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



[PHP] Re: Online Calendars

2008-11-26 Thread tedd

At 9:18 PM + 11/26/08, Nathan Rixham wrote:

tedd wrote:

Hi gang:

What online calendars would any of you recommend or have 
experiences with one way or the other?


Cheers,

tedd


to integrate in with a system? open or closed source? feature list? 
(you could mean a massive task manager or a tiny calender widget)



Nathan:

You're right -- I was vague.

I'm looking for a calendar script that provides date information for 
simple scheduling. Most post will take the form a title within the 
calendar day with a pop-up if the user is interested in seeing more. 
In other words, a pretty simple calendar connected to a database.


Cheers,

tedd


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

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



[PHP] Happy Turkey Day

2008-11-27 Thread tedd

Hi gang:

Happy Turkey Day to all who are working on Thanksgiving.

Cheers,

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

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



Re: [PHP] Happy Turkey Day

2008-11-28 Thread tedd

At 5:26 PM + 11/27/08, Ashley Sheridan wrote:

For anyone who has no idea who Mr Bean is:



I've always liked Mr Bean -- there's a bit of him in all of us.

However, I saw a performance done by him about Americans that was a 
bit over-the-top. The skit centered on how fat Americans were.


I am sure if he ran that skit in a trailer for one of his movies in 
the States, the attendance for his movie would drop -- a bit like 
biting the fat-hand that feeds him.


In any event, I enjoy his performances.

Cheers,

tedd

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

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



Re: [PHP] Text To Speech Update

2008-11-30 Thread tedd

At 7:21 PM -0500 11/29/08, Daniel P. Brown wrote:

Any/All:

For those of you who were asking about the PHP Text-To-Speech
system I had running, it's back online now.  If you have a few free
seconds, please take a look at http://www.pilotpig.net/txt2wav.php and
let me know if it's working for sure in your browser and on your OS.


My old page:

http://www.php1.net/b/speech/index.php

now works.

Thanks!

Cheers,

tedd

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

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



Re: [PHP] Will not report errors what can I do

2008-12-05 Thread tedd

At 3:07 PM -0800 12/4/08, Jim Lucas wrote:

Terion Miller wrote:

 >

 $query = "SELECT ViewAllWorkOrders FROM admin WHERE AdminID='$AdminID'";
 $result = mysql_query ($query);


Not the best solution, but add this to the above line...

$result = mysql_query ($query) or die(mysql_error());


Agreed.

I go even a bit further, like so:

$result = mysql_query($query) or die(report($query,__LINE__ ,__FILE__));

//  to show dB errors  ==

function report($query, $line, $file)
   {
   echo($query . '' .$line . '' . $file . '' . mysql_error());
   }

This does two things: 1) It tells where the error took place 
(line/file); 2) and it provides a single place in my entire project 
to turn-off dB error reporting -- all I have to do is comment out a 
single line.


Cheers,

tedd


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

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



RE: [PHP] Help with IF ELSE

2008-12-05 Thread tedd

At 7:19 AM -0500 12/5/08, David Stoltz wrote:
The problem turned out to be, since I'm using the MCRYPT function to 
encrypt the password, once in a while the encrypted password will 
have a bad character:

--snip--


So then, how does one store this type of string? I can't do a string 
replacebut there must be a way...


I use md5() -- it works great for passwords and I don't have that 
type of problem.


Cheers,

tedd

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

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



Re: [PHP] How to fetch .DOC or .DOCX file in php

2008-12-05 Thread tedd

At 10:59 AM -0800 12/4/08, Jim Lucas wrote:

Ah, not true about the MS requirement.  If all you want is the clear/clean
text (without any formatting), then I can do it with php on any platform.

If this is what is needed, here is the code to do it.



Hope this helps.
--
Jim Lucas



Jim:

Most excellent code!

I was considering a way for clients to post directly from MS word 
into a form requiring text-only. No matter how many times I tell them 
"text only" they keep cut-pasting directly from a formatted Word 
document and wondering "Where did those characters come from?"


Thanks,

tedd

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

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



Re: [PHP] How to fetch .DOC or .DOCX file in php

2008-12-05 Thread tedd

At 6:39 PM -0600 12/4/08, Shawn McKenzie wrote:

Jim Lucas wrote:

 > Hope this helps.


 I am working on a set of php classes that will be able to read the 
text with the formatting included and convert it to a standard 
document format.

 The standard format that it will end up in has yet


"has yet"...  what?

Are you O.K. Jim?  Did you die while writing this?



If he did, at least we got the code.  :-)

Cheers,

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

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



Re: [PHP] How to fetch .DOC or .DOCX file in php

2008-12-05 Thread tedd

At 7:35 PM -0800 12/4/08, Jim Lucas wrote:
A question to all then.  How would you like to see the text, with 
formating, stored?


All suggestions welcome!

--
Jim Lucas



Jim:

What's wrong with ".txt"?

Cheers,

tedd

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

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



Re: [PHP] Will not report errors what can I do

2008-12-05 Thread tedd

At 3:19 PM + 12/5/08, [EMAIL PROTECTED] wrote:

 > $result = mysql_query($query) or die(report($query,__LINE__ ,__FILE__));


 //  to show dB errors  ==

 function report($query, $line, $file)
 {
echo($query . '' .$line . '' . $file . '' .
 mysql_error());
}

 This does two things: 1) It tells where the error took place
 (line/file); 2) and it provides a single place in my entire project to
 turn-off dB error reporting -- all I have to do is comment out a single
 line.


I did this, briefly, but got tired of typing __LINE__, __FILE__ so much.



That's what I call common code -- I type it once and after that it's 
all cut/paste.


I have entire libraries of routines that I've used before -- I just 
cut/paste them into the new stuff as needed. Even many of the 
variable names remain the same so it becomes more a job of assembly 
more than typing.


Cheers,

tedd


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

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



Re: [PHP] Parsing Strings

2008-12-06 Thread tedd

At 4:18 PM -0800 12/5/08, Jason Todd Slack-Moehrle wrote:

How might I also parse and address like: SCOTTSDALE, AZ 85254

It has a comma and a space

-Jason

On Dec 5, 2008, at 4:02 PM, Jason Todd Slack-Moehrle wrote:


OK, making good learning progress today.

I have a string that is: Jason Slack

and I want it broken at the space so i get Jason and then Slack

I am looking at parse_str, but I dont get how to do it with a 
space. The example is using []=.


Then I want to assign like:

$fname = "Jason";
$lname = "Slack";

Any ideas?

-Jason


-Jason:

This is pretty basic stuff -- read the manuals about strings:

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

If you have shown that you've spent time reading and then have a 
problem, please post your question. But don't expect us to do your 
homework for you.


Cheers,

tedd

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

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



[PHP] A MySQL Question

2008-12-07 Thread tedd

Hi gang:

I just interviewed for a job teaching at the local college (imagine 
me taking minds of mush and molding them to the world according to 
tedd -- frightening huh?)


In any event, the interviewer asked me how long I've been using MySQL 
and I replied several years. After which she asked a single question, 
which was "What does EXIST mean?"


Now without running to the manuals, please be honest and tell me how 
many of you know off the top of your head what EXIST means? I would 
be curious to know.


I answered the question correctly, (I'm one of those weird types who 
read manuals for fun) but I have never used EXIST in a query. Have 
any of you?


And while we're on the subject of MySQL -- while we all know how to 
write it, how do you say it?


I've read that the common way is to say "My Squell", or something 
like that. But I always sounded out each letter, such as "My S-Q-L". 
The interviewer pronounced it the same as I, but I have heard others 
say it differently.


What say you?

Cheers,

tedd

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

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



Re: [PHP] Poll of sorts: Javascript Form validation or PHP

2008-12-07 Thread tedd

At 1:59 PM + 12/7/08, Luke Slater wrote:

/**
Validate an email address.
Provide email address (raw input)
Returns true if the email address has the email
address format and the domain exists.

	Not following the usual coding style I know but I can't bring 
myself to touch it... You'd better not touch it either, Rob: That 
means you.


Author: Humblehope
Modified: 06/06/2007
**/

-snip-

I'm impressed.

The php routine passed [EMAIL PROTECTED] (which is real), but failed [EMAIL PROTECTED] 
(which is not real).


What's needed is a javascript routine to do the same thing, but it 
would require a trip to the server to check the domain. As such, I 
would use AJAX to trigger this php routine to provide validation -- 
that might prove interesting, huh? Apparent real-time validation -- 
hmmm, I'm going to think about that.


The php routine also passed [EMAIL PROTECTED], which is real -- but 
it's interesting that most email (if not all) programs cannot show 
the domain name correctly, which is [EMAIL PROTECTED] I have yet to find an 
email program that can show IDNS correctly.


Cheers,

tedd

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

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



[PHP] Re: A MySQL Question

2008-12-07 Thread tedd

At 3:24 PM + 12/7/08, Nathan Rixham wrote:
On the same not does anybody else frequently use (or even know 
about) the awesome spatial extension for mysql? or use the 
information_schema tables?



I've certainly never used them, but I can imagine information_schema 
tables that are similar to DOCTYPE as found in xml for defining 
fields -- is that it?


Cheers,

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

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



Re: [PHP] Poll of sorts: Javascript Form validation or PHP

2008-12-07 Thread tedd

At 5:10 PM +0100 12/7/08, Per Jessen wrote:

 You cannot have 8bit characters to the left of the @ in the email address.



I'm not sure that's correct. I distinctly remember Paul Hoffman, the 
director of the Internet Mail Consortium  (http://www.imc.org/) 
saying that the left side of the @ has always been open to whatever 
characters you want to use. I was attending the IDNS WG as they 
created PUNYCODE when he made that statement.


Now maybe you can use anything you want, but it doesn't mean that it 
will be translated correctly.




The same really goes for the same on the right hand side of the @, but
some people have difficulties distinguishing between the _actual_ email
address and it may be rendered when the domain part is converted from
punycode.

The actual email address might be [EMAIL PROTECTED]


That's correct. The "xn--" is the prefix for PUNYCODE. Previous 
algorithms (AMC, RACE, etc.) used other prefixes.


After all is said and done, these were just ways to use 7 bit 
characters (unfortunately, the default for the Internet) to 
assemble/represent 8 bit characters.


Cheers,

tedd

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

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



Re: [PHP] A MySQL Question

2008-12-09 Thread tedd

At 12:44 AM +1300 12/10/08, German Geek wrote:

 Anybody agree or am i alone in this universe?


Of course you are alone.

As for the existence and history of the Universe, the Earth, you, or 
God -- it's all a matter of perception; and what you believe to be 
true; and on what the foundations you accept for those truths.


My beliefs will never be yours and vice versa.

I don't see:

$bigBang = explode(null);

to be any more/less true than:

$belief = function_exists($God);

Cheers,

tedd

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

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



Re: [PHP] how to not show login info in the url ...what am I looking for?

2008-12-10 Thread tedd

At 9:52 PM + 12/9/08, Ashley Sheridan wrote:

 >

 Thanks guys and gals!

You shouldn't be passing info like that over the URL; use sessions
instead.

I saw a shopping cart system once that passed the price of items over
the URL, and when I found out and alerted them, we won the contract for
a rebuild and then got accused of hacking by their previous web guys
(who incidentally built the system!)

Ash


Ash:

Even if you did hack the site, all that means is that site was 
hack-able and thus should have been fixed anyway.


In my mind, hacking a site (without doing damage) is a good 
introduction to a client.


Cheers,

tedd

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

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



Re: [PHP] how to not show login info in the url ...what am I looking for?

2008-12-11 Thread tedd

At 10:12 AM -0500 12/10/08, APseudoUtopia wrote:

On Wed, Dec 10, 2008 at 10:03 AM, tedd <[EMAIL PROTECTED]> wrote:
 > In my mind, hacking a site (without doing damage) is a good introduction to
 > a client.




*Ahem*You mean 'cracking'? :-P



*Ahem*... You mean to stick your tongue out at me? That's one 
definitions of using :-P


You see, there's all sorts of definitions for everything.

When I say "Hack a site" I mean to do something to get the site to 
provide an unintended result as  expected by the author.


Much like using CSS "Hacks" to get browsers to do something that was 
not intended by the original designers.


On the other hand, my understanding of "cracking" means to "crack" 
some type of encryption. Thus, the reason why I did not say "cracking 
the site" instead of "hacking the site".


Cheers,

tedd

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

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



[PHP] Foreign Keys Question

2008-12-11 Thread tedd

Hi gang:

I know this is a MySQL question, but I get a better reply from this 
group than the MySQL list (no offense meant to that list) -- In any 
event, here goes.


I currently have a project that's a classic example of a relational 
database, namely the course, student, and instructor problem.


I have my database set-up such that there are tables for courses, 
students, and instructors -- each table with it's own unique/primary 
ID.


The Course table has a field for the Instructor, which is the primary 
ID found in the Instructor's table.


Likewise, the Course table also has fields for up-to four students (a 
private tutorial service). These will be filled by the the respective 
primary ID's found in the Student's table.


This configuration is "Second Normal Form".

The Course table also has fields for date, times and such.

If I want to see the schedule for any specific day, I simply open the 
Course table and search for date and time. From that I can retrieve 
the Student ID's and the Instructor ID.


From those, I open the Student table and pull out all students who 
attend the class and then open the Instructor's table and pull out 
what data I need re the Instructor.


Everything works.

My question is, can using Foreign Keys make this work better? Can I 
retrieve all this data in one query? (I think that's what foreign 
keys do -- but, I'm assuming that).


I believe I can create the Course table (excluding everything not 
germane) like so:


INDEX (student_id),
FOREIGN KEY (student_id)
   REFERENCES (students(id)),
INDEX (instructor_id),
FOREIGN KEY (instructor_id)
   REFERENCES (instructors(id)),

But how do I use Foreign Keys to retrieve data? What is the specific 
query to pull out data from all three tables at once?


Does anyone have any example code to show me the actual syntax?

Thanks and Cheers,

tedd

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

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



Re: [PHP] how to not show login info in the url ...what am I looking for?

2008-12-11 Thread tedd

At 11:23 AM -0500 12/11/08, Robert Cummings wrote:

On Thu, 2008-12-11 at 11:05 -0500, tedd wrote:
 > When I say "Hack a site" I mean to do something to get the site to

 provide an unintended result as  expected by the author.

 Much like using CSS "Hacks" to get browsers to do something that was
 not intended by the original designers.

 On the other hand, my understanding of "cracking" means to "crack"
 some type of encryption. Thus, the reason why I did not say "cracking
 the site" instead of "hacking the site".


Cracking is not just about encryption. It's about bypassing any kind of
measure put in place to prevent someone from doing something. Hacking on
the other hand does not embody this principle, although hacking may be
employed to achieve cracking. Just because pop culture is completely
ignorant to the difference, doesn't mean you as a member of the
community need to jump on board and bleat like a sheep. If you intend to
misuse hacker, then you should at least provide more detail such as
white-, grey-, or black-hat.

Cheers,
Rob.



Okay, I shall adjust my fracking terminology. :-)

Cheers,

tedd

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

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



Re: [PHP] Foreign Keys Question

2008-12-11 Thread tedd

At 12:29 PM -0600 12/11/08, phphelp -- kbk wrote:

Hey tedd ---

Do I understand your structure correctly that you have something like:

Courses (table)
course_id,
subject_id,
student1_id,
student2_id,
student3_id,
student4_id,


Is that right?

Ken


Ken:

That was right, but I think I've reconsidered.

You see, Richard pointed out the error of my ways, namely:

Student table has student data and ID -- as may records as there are students.

Instructor table has instructor data and ID -- as may records as 
there are instructors.


Course table has course data, ID and Instructor ID and Student ID -- 
but the number of records vary.


While there will be only one record per Instructor and one pre 
Student, the Course table can have up to four records for each course 
depending upon actuall attendance.


I think that makes more sense.

As for my "Foreign Keys Question", I think the answer is that it 
enforces rules upon the configuration (i.e., deleting, altering, and 
such), but does not provide any significant service beyond that.


Cheers,

tedd


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

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



Re: [PHP] Foreign Keys Question

2008-12-11 Thread tedd

At 1:48 PM -0500 12/11/08, Robert Cummings wrote:

On Thu, 2008-12-11 at 13:27 -0500, Bastien Koert wrote:
 > On Thu, Dec 11, 2008 at 12:56 PM, tedd 

 > > Does anyone have any example code to show me the actual syntax?

 > Joins should allow you to pull the data from the table in one query

You want to be careful using joins though. If you were to pull all that
data in one shot using joins you would create a large data transfer
mostly containing redundant data.

Cheers,
Rob.


Rob:

Good point. Maybe my old way of doing that was the best. Simply get 
the ID's needed from one table and then open the necessary tables 
accordingly. In other words, stop worrying about the number of times 
I'm going to the store to buy things because going once might result 
in the things being too heavy for me to carry home -- if that makes 
sense.


Cheers,

tedd

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

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



Re: [PHP] Foreign Keys Question

2008-12-11 Thread tedd

At 1:55 PM -0500 12/11/08, Robert Cummings wrote:

Student attendance should be a table with rows for each student in
attendance. If you want to limit the number make a check before adding
another student. Don't hard code the number via fields like above or
you'll find it overly ugly to add/remove students or even increase the
number of allowed students. As it stands to allow 6 students you would
have to add 2 more columns. With attendance controled by a table with a
row for ewach attendance you would only need to update a configuration
variable the determines the maximim number of allowed students in
attendance.

Cheers,
Rob.


Rob:

I see -- the solution is a table for courses, students, instructors 
and enrollment.


The enrollment table will hold links to all (third normal).

If I want to limit the number of students in a course, then just 
count the number of students enrolled in a specific course within the 
enrollment table and check that number against the maximum allowed 
before adding another enrollment record.


Also, if a student cancels, then it's only a deletion of an 
enrollment record and all is right with the world.


That's good.

Sometimes it's good to talk things like this through -- clears the 
fuzzy thinking.


Thanks,

tedd

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

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



Re: [PHP] Foreign Keys Question

2008-12-11 Thread tedd

At 3:14 PM -0500 12/11/08, Andrew Ballard wrote:


That's the way to go. Just keep in mind that you will have to consider
ways of preventing overloading your courses due to concurrency,
whether you use table locks or devise your own mechanism. I don't know
if you are allowing students to self-enroll or not. You just don't
want two users to both see that a course has one opening left and both
try to take that spot at the same time.

Andrew


It's very low volume at the moment, so I don't think there will be an 
immediate problem.


However, I will investigate locking the tables for entry. But I don't 
think using transactions will be necessary.


Thanks again for all the help Andrew el al.

Cheers,

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

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



Re: [PHP] Foreign Keys Question

2008-12-12 Thread tedd

At 4:25 PM -0500 12/11/08, Robert Cummings wrote:

On Thu, 2008-12-11 at 16:24 -0500, Robert Cummings wrote:

 > lock table

 check enrolment count
 no room
 unlock table
 generate error
 have room
 insert row
 unlock table

 Ba da boom.


I should have read your message better... you were talking about
skipping transactions and not locking :)

Cheers,
Rob.



Rob:

I was talking about both -- you answer was fine.

Thanks,

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

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



[PHP] Re: Foreign Keys Question

2008-12-12 Thread tedd

At 10:24 PM + 12/11/08, Colin Guthrie wrote:

'Twas brillig, and tedd at 11/12/08 18:46 did gyre and gimble:
As for my "Foreign Keys Question", I think the answer is that it 
enforces rules upon the configuration (i.e., deleting, altering, 
and such), but does not provide any significant service beyond that.


Well that's a fairly significant service in itself. The whole 
"deleting data" case is where FK's have saved me significant amount 
of coding.


The ON DELETE CASCADE option is key here... "DELETE FROM students 
where student_id=1" will remove all traces of that student from the 
db... all the course they've attended, all the instructors who have 
taught them etc. keeps things nice and tidy without having to put 
the structure in your code all over the place.


Col


Col:

That's neat and a lot more powerful than I thought. It's like 
following a linked list to it's end while removing all traces of the 
thread.


And I understand the "instructor delete" was not intended.

Thanks,

tedd

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

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



RE: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!

2008-12-12 Thread tedd

At 6:34 AM -0600 12/12/08, Jay Blanchard wrote:

[snip]
It's Christmas... the season of giving and tolerance :|
[/snip]

We will return you to your regularly scheduled Robert Cummings Jan 2nd,
2009


In either event, the answers are still good.

As for MySQL questions on this list, as I said previously, this list 
provides more answers than the MySQL list.


Again no offense meant to that list -- for there are some very bright 
people there. However, this list is more responsive; more specific re 
MySQL queries; and entertains a holistic view of how to design and 
apply solutions considering more than a single language.


This is absolutely the best list for web programming problems.

Cheers,

tedd

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

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



[PHP] Re: Foreign Keys Question

2008-12-12 Thread tedd

At 2:50 PM + 12/12/08, Colin Guthrie wrote:

'Twas brillig, and tedd at 12/12/08 14:36 did gyre and gimble:
That's neat and a lot more powerful than I thought. It's like 
following a linked list to it's end while removing all traces of 
the thread.


Exactly


And I understand the "instructor delete" was not intended.


Yeah indeed. I had a db structure in my head and the statement made 
vague sense with that in mind, but it totally failed to leak through 
my hands on to the keyboard :P


There are three main options here:
 * ON DELETE CASCADE (if the FK's referenced table has it's record 
deleted, delete the record here too).


 * ON DELETE RESTRICT (if the FK's referenced table has it's record 
deleted stop that whole transaction - e.g. *prevent* the delete).


 * ON DELETE SET NULL (if the FK's referenced table has it's record 
deleted, set this tables reference to NULL).


All three are useful in different contexts. I use them extensively 
to ensure good data integrity. The trade off on extra load on 
insert/update is IMO well worth it.


Col



Col:

That's all good to know.

My first tendency is to keep everything. After all, memory is cheap 
and access times are always reducing.


While it's true that having a bunch of worthless data doesn't 
accomplish anything and slows the process  of dealing with it. But, 
technology in access times and storage capabilities are getting to 
the point of making the decision to keep/delete worthless data moot.


As such, I think the need for FK deletions will become less and 
perhaps disappear from the language. For some reason, I look upon 
deletions in similar light as renumbering a table's index after 
deletion of a record -- like "what's the point?"


I'm just rambling -- thanks again for your insight.

Cheers,

tedd

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

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



[PHP] Re: Foreign Keys Question

2008-12-12 Thread tedd

At 4:34 PM + 12/12/08, Colin Guthrie wrote:

'Twas brillig, and tedd at 12/12/08 15:16 did gyre and gimble:
My first tendency is to keep everything. After all, memory is cheap 
and access times are always reducing.


While it's true that having a bunch of worthless data doesn't 
accomplish anything and slows the process  of dealing with it. But, 
technology in access times and storage capabilities are getting to 
the point of making the decision to keep/delete worthless data moot.


As such, I think the need for FK deletions will become less and 
perhaps disappear from the language. For some reason, I look upon 
deletions in similar light as renumbering a table's index after 
deletion of a record -- like "what's the point?"


I'm just rambling -- thanks again for your insight.


Rambling is good... I'll continue!

With data retention and data protection laws (something that can 
vary around the world making life for web-based providers like 
ourselves even more complex), I think it is increasingly important 
that information about a given person can be scrubbed very easily. 
Keeping the data may be cheap from a storage/access perspective, but 
complying with laws and regulations can be wearisome and time 
consuming.


If you FKs are fully up-to-date and have proper cascading you can be 
sure that a simple:

DELETE FROM users WHERE user_id=123;
really will delete all the information you store about that individual.

You just have to look at the hullabaloo over the "deactivated" 
Facebook accounts etc. to realise that hiding or disabling data is 
not enough in many cases.


Food for thought!

Col


Col:

I'll continue rambling.

Excellent point -- Yes, I forgot about security issues. For example 
most on-line credit card processing agreements state that you must 
delete the actual credit card information (i.e., cc and cvs numbers) 
within 24 hours of a customer's purchase.


I often have problems explaining that to clients who want to keep 
such information on-line. I tell them what they do with the hard copy 
of that information is their business, but I'm not going to jail to 
keep that data in a database for them.


Anyone else experienced that problem? And if so, how did you handle it?

Cheers,

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

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



Re: [PHP] Chrome 1.0 released

2008-12-14 Thread tedd

At 8:28 PM + 12/13/08, Richard Heyes wrote:

 > I did catch that. But you mentioned that it shouldn't be used on the

 internet because of that limitation, and my argument is that one
 browser that is _known_ problematic should not be cause to eliminate a
 feature for everyone else.


That's a nice thought, but not feasible in reality.

--
Richard Heyes



Richard:

IE's popularity is dropping. I know it depends upon what site you 
test, but I like this set of stats:


http://www.w3schools.com/browsers/browsers_stats.asp

You see here that IE6 and IE7 together hold less than 50 percent.

As I posted some time ago, I have one site where in the last two 
years it has had over 50,000 unique visitors with less than 200 using 
any version of IE.


So, not doing something because IE does play well isn't as strong an 
argument as it was -- and that argument is growing weaker every month.


Oddly enough, it looks like the world is winning and I for one 
couldn't be happier.


Cheers,

tedd


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

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



Re: [PHP] Chrome 1.0 released

2008-12-14 Thread tedd

At 3:08 PM -0800 12/13/08, Yeti wrote:

I have to defend poor little IE a little now. It supports XHTML and
CSS2 pretty well so far. And those standards came out a couple of
months ago.


Even a blind pig finds an acorn every once in a while.

Cheers,

tedd

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

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



Re: [PHP] Chrome 1.0 released

2008-12-15 Thread tedd

At 5:22 PM -0800 12/14/08, Yeti wrote:

It more and more seems like a conspiracy against M$ to me. A company
trying to make up its own standards every once in a while, how can
that be wrong?


The more experienced you become, the more you'll see M$ for what it 
is. They are concerned about the bottom line and nothing else.


If complying to standards serves their interest, then they will. 
However if they can figure out a way to make money by not complying, 
then they won't.


One can say that all companies are concerned about the bottom line, 
but not all companies rate that at the expense of everything else.


Cheers,

tedd

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

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



Re: [PHP] Secure uploads tutorial

2008-12-16 Thread tedd

At 11:45 PM +1100 12/16/08, Tim Starling wrote:

I thought the list might be interested in a tutorial for secure
web-based file uploads that I just wrote:

http://tstarling.com/blog/2008/12/secure-web-uploads/

-- Tim Starling


Tim:

That's a good read -- thanks -- but it's more of an article than a tutorial.

In any event, instead of posting to your blog, I though starting a 
dialog here might serve the php community better. So here goes:


In your blog you suggest looking for the magic number in image files 
and not using getimagesize(). So what about this approach?


1. Restrict the File-Type.
2. Pass the file through exif_read_data() and see if File-Type and 
MimeType match.

3. Resize the image.

Do you see any security problems this?

I can't imagine evil code still working after someone resizes the file.

Cheers,

tedd

PS: here's an example of both getimagesize()  and exif_read_data():

http://webbytedd.com/bb/image-data/


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

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



Re: [PHP] Re: Create unique non-autoincrement key for 700,000 records?

2008-12-17 Thread tedd

At 9:23 PM -0500 12/16/08, Robert Cummings wrote:

I haven't come accross UUID() before. It looks time based to me.


Yeah, it stops the nine month thing.  :-)

Cheers,

tedd

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

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



Re: [PHP] Secure uploads tutorial

2008-12-17 Thread tedd

At 1:55 PM +1100 12/17/08, Tim Starling wrote:

There are some file types, such as .png and .wav, where that approach is
not at all secure. The file command will tell you that the file is
image/png, but IE 6 will detect it as text/html and run scripts in it.


Oh, I see the problem (I think).

I was thinking it was a server-side problem -- IOW, how do you stop 
someone from uploading a clever script that the server will somehow 
run.


But instead, this is how to stop someone from uploading a script that 
will become evil when someone else views it using IE. Is that it?


Cheers,

tedd

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

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



Re: [PHP] Image Resizing

2008-12-21 Thread tedd

At 12:38 PM -0800 12/20/08, Stephen Alistoun wrote:

Hi all,

What is the best way in PHP to Resize an Image to a specific width.

For Example I have images in the following sizes:

(1) 200px width and 350px height
(2) 125px width and 220px height
(3) 166px width and 455px height

I want all the images to resize to 100px width but the height adjusts
automatically.

Regards,

Stephen


Stephen:

Here's the code.

http://webbytedd.com/b/thumb/

Cheers,

tedd

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

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



Re: [PHP] Passing var from one page to itself

2008-12-21 Thread tedd

At 4:10 PM +1300 12/21/08, Aslan wrote:

Hey there,

I have a problem where I have a simple -script that I am  wanting to 
pass back to itself three times

1) Symptoms - > 2) Troubleshooting questions 3) Answer to problem

-snip-

I have it currently all on one page, but it isn't quite what I was after
..
Any help would be appreciated!


Hi Aslan:

Keeping it all on one page (one script) is fine -- no problems with that.

Here's the technique I use.

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

if($step == 1)
   {
   // do the first page stuff (Symptoms)
   // with a POST form that has an 
   }

if($step == 2)
   {
   // do the second page stuff ( Troubleshooting questions)
   // with a POST form that has an 
   }

if($step == 3)
   {
   // do the third page stuff (Answer to problem)
   // with a POST form that has an 
   }

If you want to pass variables between pages (trips from client to the 
server nad back again), you have four options, namely: 1) 
writing/reading a file; 2) writing/reading a database entry; 3) 
passing via a POST/GET; 4) or using SESSIONS.


For most things, I prefer using POST/GET and/or SESSIONS. Try this format:

$var1 = isset($_POST['var1']) ? $_POST['var1'] : null;
$var2 = isset($_SESSION['var2']) ? $_SESSION['var2'] : null;

That's the way I pass data between client and server.

However, what you are describing sounds a bit like this:

http://webbytedd.com/b/exam/

With this example, I'm not passing anything to the server -- 
everything is kept client-side and is quick.


If interested, all the code is there.

Cheers,

tedd

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

Re: [PHP] Create PHP form from MySQL table structure

2008-12-21 Thread tedd

At 10:35 AM + 12/21/08, R B MacGregor wrote:

Hi folks

Anybody got any recommendations for a utility which would create a quick head
start by creating the php/html code for a basic form using the field structure
of a MySQL table ?

Thanks for any suggestions.

--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk



Interesting.

I am sure that one can write a script to find all the fields in a 
table and create a form from that. However, I don't know of any 
utility that does that.


Hope that helps,

tedd

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

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



Re: [PHP] eof bof in php

2008-12-22 Thread tedd

At 1:21 PM -0500 12/21/08, Anthony Gentile wrote:

-snip exampe-


is probably going to give you the result you want. However you should know
it is bad practice to mix PHP and HTML as horridly as I just showed you. AKA
you don't want your PHP writing your HTML.

Anthony Gentile


Anthony:

Granted, the example you gave was a bit mixed, but it's perfectly 
Okay to have php write html. In fact, if you think about it that's 
the only way php can express itself to the user. A simple echo($var) 
is writing html to a browser.


Good practice should to write code (i.e., php, mysql, css, html, js) 
that is semantic and compliant with standards. Mixing them well is 
almost an art form that observes best practices in all.


Cheers,

tedd

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

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



Re: [PHP] eof bof in php

2008-12-23 Thread tedd

At 2:21 PM -0500 12/22/08, Anthony Gentile wrote:

I would argue it is better practice as:



than

Hello World";
?>
Anthony Gentile



Certainly, but all you have done here is to move your  to 
different places.


There is a threshold one reaches in deciding where is the "best" 
place to put the "" -- it's a personal choice.


With me, a one liner is sufficient for me to use:



For more than that, I usually:

?>

html

I use heredoc for email text, but not for html. I do this primarily 
because I like the way my editor works for showing paired tags and 
braces. It makes it easy for me to check tag pairing.


Cheers,

tedd


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

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



[PHP] Assignment (Was Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-23 Thread tedd

At 9:10 AM +1100 12/23/08, Clancy wrote:

Schlossnagle (in "Advanced PHP Programming") advises:

$i = 0; while ($i < $j)
{

++$i;
}

rather than:

$i = 0; while ($i < $j)
{
...
$i++;
}

as the former apparently uses less memory references.  However I 
find it very hard to


Two things:

1. One statement, one line.
2. The code between the two examples is different; produces different 
results; and thus is rather pointless in making a definitive 
comparison.


Assignment, demonstrate a correct way to test ++i vs i++.

Cheers,

tedd

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

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



RE: [PHP] Create PHP form from MySQL table structure

2008-12-23 Thread tedd

Here is a quick and dirty function that I have used for a couple of
years now, complete with comments;



-snip-


Nice piece of code -- thanks for providing that.

Cheers,

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

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



Re: [PHP] MERRY XMAS

2008-12-24 Thread tedd

At 3:29 AM -0500 12/24/08, Robert Cummings wrote:

On Wed, 2008-12-24 at 00:38 -0700, Nathan Nobbe wrote:

 On Tue, Dec 23, 2008 at 8:59 PM, German Geek  wrote:

 > Merry xmas to everyone! Thanks for the support and fun discussions.


As they say in my son's kindergarten so as to be all inclusive:

We wish you a happy holiday!
We wish you a happy holiday!
We wish you a happy holiday,
and a happy New Year!!

:)

Although, I guess that's a bit half baked if you're working through the
"holidays" :/

Cheers,
Rob.


Yes, for those poor soles who must work through the holidays -- I 
feel sorry for them.


I used to work and program, but I gave up work and now do nothing but program.

As for the holidays, my wife tells me when to celebrate and what I 
should to do for each one. You know, they all have their own special 
requirements/demands (i.e., carve pumpkins, hide eggs, give/receive 
gifts,, etc.). But they all include eating -- so me and my dogs are 
happy.


My life is so much simpler now that I just program and do what my wife says.

Cheers and Merry Christmas (my wife told me to say that, but I was 
going to anyway).  :-)


tedd


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

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



[PHP] Re: Assignment (Was Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-24 Thread tedd

At 11:06 AM +1100 12/24/08, Clancy wrote:

On Tue, 23 Dec 2008 10:25:13 -0500, tedd.sperl...@gmail.com (tedd) wrote:
 >Two things:


1. One statement, one line.
2. The code between the two examples is different; produces different
results; and thus is rather pointless in making a definitive

 >comparison.


Spoken like a true demagogue -- nitpicking about trivial points of 
style, but displaying

total ignorance of elementary rules of programming.


Clancy:

A tag strong, but you're right. Apology offered.

Certainly, my comment about "One statement, one line" is a personal 
choice. But it is founded on 40+ years of writing code. It's 
something that makes debugging simpler for me and perhaps for others.


My second point was just plain wrong. In one of the previous post on 
this thread, someone used the value of $i as an index and it produced 
different results. So I jumped to the conclusion it was different, 
but it's not. I should of examined it more closely. Sorry.


Cheers,

tedd


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

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



Re: [PHP] Chrome 1.0 released

2008-12-24 Thread tedd

At 9:22 AM -0500 12/24/08, Bill Guion wrote:

At 9:30 AM -0500 12/14/08, tedd wrote:


At 3:08 PM -0800 12/13/08, Yeti wrote:

I have to defend poor little IE a little now. It supports XHTML and
CSS2 pretty well so far. And those standards came out a couple of
months ago.


Even a blind pig finds an acorn every once in a while.

Cheers,

tedd


Tedd,

You should apologize to all pigs for that comparison.



Bill:


It seems to be the season for me to apologize -- so I offer an 
apology to all the pigs out there for remotely comparing them to IE 
-- which truly degrades pigs.


I would like everyone to know that some of my best friends are pigs 
-- I should have known better. Sorry pigs.



A conclusion is the place where you get tired of thinking.


Good point. Quite often, so is an apology -- you get tired of arguing.

Cheers,

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

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



Re: [PHP] errors still being displayed even if variables in php.ini set to off

2008-12-28 Thread tedd

At 4:23 PM -0800 12/27/08, Fred Silsbee wrote:

on page 1
Notice: Undefined index: in 
C:\Inetpub\wwwroot\handle_log_book_MySQL.php on line 71


Notice: Undefined index: in 
C:\Inetpub\wwwroot\handle_log_book_MySQL.php on line 72


in php.ini:

error_reporting  =  Off

display_errors = Off (in 2 places)

display_startup_errors = Off



Try:

error_reporting(0);

Cheers,

tedd

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

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



[PHP] What does

2008-12-28 Thread tedd

Hi gang:

I have a small php routine to provide the user with a style choice. 
The working url is here:


http://php1.net/a1/david/

The simple code that allows style switching follows:



As you can see, the code works. However, if I add the following line 
IN THE HTML (i.e., after ?>):




I receive a:

Parse error: syntax error, unexpected T_STRING

What's up with that? Apparently the php interpreter is considering 
"this something else?


Cheers,

tedd

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

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



Re: [PHP] Page name for form submit: REQUEST_URI or SCRIPT_NAME

2008-12-28 Thread tedd

At 7:31 PM +0200 12/27/08, Dotan Cohen wrote:

Is there a compelling reason to use either REQUEST_URI or SCRIPT_NAME
in the action of a form that I want to submit to the same URL that it
came from (the script parses whether or not there is a Submit to know
if it should display the form or the results). I need a portable
solution, that is why I am not hardcoding it. Also, the users _may_
save the form to their hard drives, so simply leaving the action blank
will not do.

I know that REQUEST_URI includes the ?variable=value string and that
SCRIPT_NAME does not. This form does not depend upon get variables, so
this should never be an issue, but I ask here anyway to know if there
are other differences that I did not account for.

Thanks!

--
Dotan Cohen



Dotan:

Maybe this is too simple, but what I do is to leave the form 
attribute action="" blank.


My understanding (may be wrong) is that forms always submit to 
themselves unless directed to do so otherwise.


Cheers,

tedd

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

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



Re: [PHP] Read Form values prior to submit?

2008-12-28 Thread tedd

At 9:41 AM -0600 12/28/08, Tim Rude wrote:

Using PHP, is there a way for me to read the values that a user has
entered into the text fields of a  prior to the user clicking the
submit button?

Essentially what I want to do is make sure the user has filled in all
three text fields on my form before allowing it to be submitted [to a
third party website].

--

Tim Rude [PHP newbie]


Tim:

Can not do that using php. Php is server-side and hasn't a clue as to 
what the user is doing until the user clicks the submit.


If you want to check for user input in real-time, then you'll have to 
do that client-side with javascript.


Here's an example:

http://webbytedd.com/c/form-submit/

All the code is there -- use as you may.

Cheers,

tedd

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

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



Re: [PHP] Webhotel structure

2008-12-28 Thread tedd

At 10:03 PM -0500 12/27/08, Robert Cummings wrote:

On Sat, 2008-12-27 at 15:54 -0500, John Corry wrote:

 +1


 > Is it me or has the php mailing list kind of dumbed itself down in the

 last 5 years?


Hey, that's almost as long as I've been here...

*blink* ... *blink* *blink*

:O

Cheers,
Rob.



Oddly enough, that's what I was thinking. I know that Rob hasn't 
dumbed the list down but I, on the other hand, may be in some minor 
way responsible for causing list to dwell on the obvious more often.


Cheers,

tedd

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

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



Re: [PHP] Webhotel structure

2008-12-28 Thread tedd

At 3:36 PM -0500 12/27/08, Daniel Brown wrote:

On Sat, Dec 27, 2008 at 15:27, Nordstjernealle 10
 wrote:

 Hi PHP experts

 What is the overall structure on webhotels, how do I remove/clean 
everythink including everythinnk liek databases etc?


 Sorry if this is not the proper news group for this question, 
please redirect me.

 I am a newbie trying to make my osn webside with a minimum effort.

 First I had a student to make some think for me, but he never 
finished it, so the useless remains are on my web.


 My first plan was to use php gallery, but my web host surftown do 
not support safemode off.

 So I found coppermine, surftown even support the install as one click.
 First trial looked good, but then I ran into trouble, I get 
different error messages.


 So I would prefer to remove everythink and start all over .


What?


Daniel:

He's talking about everythink. Whenever I do that, I have problems too.

Cheers,

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

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



Re: [PHP] Online Members

2008-12-28 Thread tedd

At 12:07 PM -0500 12/27/08, Daniel Brown wrote:

Check the archives and STFW for examples, but the general gist is
of it is to use $_SESSION tracking with activity checking.  I'm just
typing this in quickly as I go, so it's untested (read: don't copy and
paste for production), but here's a simple example (you should be able
to fill in the blanks easily):


-snip code-

Neat -- thanks.

Cheers,

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

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



Re: [PHP] Page name for form submit: REQUEST_URI or SCRIPT_NAME

2008-12-28 Thread tedd

At 6:59 PM +0200 12/28/08, Dotan Cohen wrote:

2008/12/28 tedd :

 Dotan:

 Maybe this is too simple, but what I do is to leave the form attribute
 action="" blank.

 My understanding (may be wrong) is that forms always submit to themselves
 unless directed to do so otherwise.

 Cheers,

 tedd



Thanks, Tedd. That approach seems a bit dangerous for non-standard
browsers such as mobile phones and the like who's developers might not
have though about it. Also, in the event that a user saves the form
locally (likely in this case) I need it to have a place to go!

Thanks!

--
Dotan Cohen



Dotan:

Sometimes the simplest is the best, but you might try this:

action=""

At least you can say it's not as simple.  :-)

As for saving a form locally, then you'll have to get the entire url. 
Here's a less than simple solution:


function selfURL()
   {
   $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
   $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
   $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : 
(":".$_SERVER["SERVER_PORT"]);
   return 
$protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];

   }

function strleft($s1, $s2)
   {
   return substr($s1, 0, strpos($s1, $s2));
   }

It works.

Cheers,

tedd

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

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



Re: [PHP] What does

2008-12-28 Thread tedd

At 6:06 PM + 12/28/08, Benjamin Hawkes-Lewis wrote:

On 28/12/08 16:47, Jim Lucas wrote:
short tags are enabled.  Disable them in your php.ini file and you 
will be good.


Alternately:

';
?>

--
Benjamin Hawkes-Lewis


Bingo -- we have a winner!

Thanks Benjamin -- that works without me having to fix the short tag 
in the php init file, which I'm really fuzzy about doing anyway.


Cheers,

tedd

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

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



Re: [PHP] Search functionality in website.

2008-12-29 Thread tedd

At 8:17 PM +0530 12/29/08, Tiji varghese wrote:
Hi all,I would like to set up search functionality on my website. 
I'm using PHP and Mysql. Most of the pages contain static text in 
the html and is not database driven. I need some idea on how should 
I go about it without moving everything to database driven 
functionality. Please help.Thanks in advance!


Try:

http://sperling.com/examples/search/

Cheers,

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

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



Re: [PHP] Since I speak with some of you more than people I see in person....

2008-12-30 Thread tedd

At 4:32 PM -0500 12/30/08, Daniel Brown wrote:

To hell with being on-topic, since this list is generally never
on-topic for an entire thread anyway.

This has been a roller-coaster year for some of us --- certainly
myself included --- but the year has come to a close.  I want to take
a moment to wish each and every one of you a safe and wonderful new
year.  May 2009 be ten times healthier, happier, and more prosperous
to you and yours than the three best years of your life so far, and
may each year beyond that be better even than the one before.

And as a side note (some of you already know): for my wife and I
closing out the year, we heard the heartbeat of our first child for
the first time today in the ultrasound.  Nothing else will ever again
matter as much to me as what I am about to embark upon.  I don't think
any song or sound I've ever heard in my entire life was as beautiful
as those few seconds.  My heart literally feels so full that it could
burst at any moment.

To all of you, thank you for being a part of the PHP project, and
many of you professional and personal parts of my life.  Of all of the
communities I've been involved in the last sixteen years or so, this
has always been my favorite.  And it's because of you folks.

From the bottom of my (bursting!) heart, thank you, and I look
forward to working alongside all of you in 2009.

All the best

--



Ahhh, you made me all teary-eyed.

Best wishes to you and yours -- I am sure the best is yet to come.

Cheers,

tedd

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

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



Re: [PHP] Re: Webhotel structure

2008-12-30 Thread tedd

At 5:44 PM +0200 12/30/08, Dotan Cohen wrote:

1) "Webhotel" is called "web hosting" in English.

2) "Everythink" should probably be "everything". "Everythink" sounds
like you are thying to think about the entire universe at the same


Dotan:

Thanks for the clarification --  I was thinking it could have been a 
collection of those Jef Foxworthy definitions, such as:


We're gona rent out a room and call ourselves 'We B Hotel'

or

Everythink about getin' a job?

However, those may not translate well for those not accustom to 
abusing the English language for fun and profit.


Cheers,

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

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



Re: [PHP] Re: Webhotel structure

2008-12-31 Thread tedd

At 9:47 AM +0200 12/31/08, Dotan Cohen wrote:

2008/12/31 tedd :

 Everythink about getin' a job?



There's that word again! You keep using that word. I do not think that
it means what you think it means.

--
Dotan Cohen


Dotan:

And perhaps nether of us understand what the other is saying.

I was using it in a humorous manner, at least that was my intent.

Cheers and Happy New Year.

tedd

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

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



Re: [PHP] IE Problem Detecting Post Variables

2009-01-01 Thread tedd

At 8:37 PM -0500 12/31/08, L. Herbert wrote:

Any thoughts?



Theme (style) switcher? Try these:

http://sperling.com/examples/styleswitch/

http://sperling.com/examples/styleswitch1/

It makes no difference which browser you are using.

Cheers,

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

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



Re: [PHP] Please point me in the right direction

2009-01-03 Thread tedd

At 8:20 PM -0800 1/2/09, David Knapp wrote:

Greetings,

I need to create a secure customer section on my site. User name and 
login would take you to a secured page that displays information 
like a calendar, downloads, budgets. These sections would be the 
same but each customer would display custom content (over 100 
customers).


I browsed php & mysql books, but need a jump start. Any ideas? Is 
php not the best solution? If you can't tell, I'm a newbie.


David



David:

So what's your question?

Do you want a secure area, calendar downloads, budgets, or what?

All you say you want can be done in php. If you want to do it 
yourself, you probably could write some of the code after a few 
months of study. But if you want it done sooner, then hire one of us.


Cheers,

tedd

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

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



Re: [PHP] Thank you everyone, What a wonderful world

2009-01-03 Thread tedd

At 5:55 PM + 1/3/09, Nathan Rixham wrote:

oooh oooh found it, there's a few solutions actually!

array_merge($christianity,$islam);
unset($religion);


I prefer:

unlink($the_entire_mess);

Cheers,

tedd

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

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



Re: [PHP] IE Problem Detecting Post Variables

2009-01-04 Thread tedd

At 5:35 PM -0600 1/3/09, Micah Gersten wrote:

Ashley Sheridan wrote:

 > Lets all march forward and renounce IE as a useful piece of software!



 Ash
 www.ashleysheridan.co.uk
 


Agreed.  According to the spec, the FF action is correct.  I just heard
IE's user share dropped below 70%.  One day we will hopefully be able to
say goodbye to it.


It's been discussed before on this list, but the "shares" of browsers 
depend upon what's being visited.


For example, I have one site that's been up for over two years; has a 
traffic rate of over 3000 unique visitors per month; and the amount 
of IE visitors (all IE's) fall well below 0.01%.


If you have a Mac running Safari, just type in option v into the url 
and hit return. However, the windozes world can't do that -- so it 
make a great filter to keep windozes out -- it's a Mac Only Site.


The more "normal" stats (the ones I like) are shown by W3Schools:

http://www.w3schools.com/browsers/browsers_stats.asp

As you can see, IE6 is dropping at about 0.02% per month. This time 
next year, it will probably drop below 10%. I suspect that those 
users are locked into a system such that their employers are afraid 
to upgrade for fear of the typical problems that accompany such 
undertaking.


Cheers,

tedd

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

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



Re: [PHP] IE Problem Detecting Post Variables

2009-01-05 Thread tedd

At 1:19 AM + 1/5/09, Ashley Sheridan wrote:

On Sun, 2009-01-04 at 10:04 -0500, tedd wrote:

 >
I'd disagree that the W3C is more indicative of the overall browser
usage statistics, as by their own admission, their visitors tend to be
those more technically minded, ergo, more knowledgeable about other
browsers. I'm surprised that Google pulled the plug on their
announcement that they were going to release usage stats (browser, OS,
etc) of their visitors, as this would have given a very good demographic
being it the most popular website in the world.


OK, I said those are the stats I like.

But I also said that it depends upon what is being viewed. As the 
example I provided, I have one web site where all IE's are virtually 
non-existent -- so stats vary as the user's interest varies.


Cheers,

tedd

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

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



Re: [PHP] sorry

2009-01-08 Thread tedd

At 11:16 AM + 1/8/09, Nathan Rixham wrote:
I keep hitting reply all in thunderbird and double posting; 
apologies for the additional noise (can't promise i won't keep doing 
it though :p)


That's Okay.

Usually what you have to say is important enough to read twice.

Cheers,

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

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



Re: [PHP] a weired query issue

2009-01-08 Thread tedd

At 1:35 PM +0530 1/8/09, viraj wrote:

i have this query..

$sql = "SELECT `id` FROM `modules_permissions` WHERE `id` = '" .
$permissionId . "';";

when i pass the value 31 to permissionid, it returns me the 31st row
of the table. and it's fine. but when i pass '31asasa' as the
permissionid it returns me the same row! how come this possible?

`id` is a integer and the storage engine is myisam. i'm on debian and
mysql version is 5.0.51a-15

~viraj


As Nate said, that's normal.

However, what I noticed was a query that is more complicated than it 
could be, try this:


$sql = "SELECT id FROM modules_permissions WHERE id = '$permissionId' ";

That should work, it does for me. If it doesn't, I would like to know why?

Cheers,

tedd

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

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



Re: [PHP] a weired query issue

2009-01-08 Thread tedd

At 9:17 AM -0500 1/8/09, Daniel Brown wrote:

On Thu, Jan 8, 2009 at 09:10, tedd  wrote:


 $sql = "SELECT id FROM modules_permissions WHERE id = '$permissionId' ";


I was going to ask something about sanity, but then I remembered
with whom it is I'm speaking.  ;-P

That aside, don't forget your pre-database-interaction sanity.
Even an explicitly internally-defined variable can have issues, so
unless you're 100% certain that it will be safe, it's better to , et al.



Hey, if I were you I wouldn't be taking about sanity now that you 
have a digestive system that has a two hour sleep cycle. :-)


Yes, but the "pre-database-interaction sanity' (otherwise known as 
"knowing what you're doing")  goes without saying -- it's obvious -- 
that's like saying "Make sure you're connected to the database before 
using mysql_real_escape_string() function."


In any event, you always should clean your variables before creating 
a query like that.


My post was about how overly complex the OP's query was -- after all, 
it's just a very simple query. I didn't see any need for back-ticks 
or convoluted quotes. If I was wrong, then I would like to know 
better.


Cheers,

tedd

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

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



Re: [PHP] Because you guys/gals/girls/women/insert pc term hereare a smart lot

2009-01-08 Thread tedd

At 11:23 AM -0500 1/8/09, Frank Stanovcak wrote:

And people tell me that I'm just wrong.


Nothing new there. :-)

Cheers,

tedd

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

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



Re: [PHP] Re: can a session be used in a query?

2009-01-08 Thread tedd

At 8:21 AM -0600 1/8/09, Terion Miller wrote:


it's larger than this but you get the picture, I just need to get the $row
to actually work, I don't understand why I can echo it at the top of the
page and then not further down.

Thanks for looking
terion


terion:

Part of the problem is that $row is an array, not a variable.

Cheers,

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

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



Re: [PHP] [SOLVED] Re: can a session be used in a query?

2009-01-08 Thread tedd

Terion Miller wrote:


SOLVED: Thanks everyone I got it working it was the loop...took it out and
now it works like a charm!! Is there a way to mark things solved?


Normally, when one post [SOLVED] in the subject line, the post also 
provides the solution.


As it is now, a person with a similar problem would have to read the 
entire thread to figure out what you did to solve the problem you 
faced. They would have to figure out what you meant when you said 
"...took it out and now it works like a charm!!" ?


Would it not be easier just to post the corrected code?

If possible, always put back more than you take.

Cheers,

tedd

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

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



Re: [PHP] First official release of the PHP WhitePaper

2009-01-08 Thread tedd

At 3:40 PM + 1/8/09, David Coallier wrote:

I'd love to make a sales pitch about this but I think you can simply
download it and see for yourselves :)

http://short.ie/php-whitepaper (This is a pdf)


Nice.

I would have liked to seen:

1) What is it's competitors?

2) What market shares do they hold?


Cheers,

tedd


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

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



Re: [PHP] Re: hello

2009-01-08 Thread tedd

At 12:10 PM -0500 1/8/09, Daniel Brown wrote:

Someday there will be a mathematical anomaly, I'm sure,
that will eventually lead to a level of cognition, but we're not there yet.



Don't rely on your level of perception to determine IF software 
(they) have reached a level of cognition or not. It could be they 
simply have nothing to say to us or their level cognition is so 
foreign to us that we can't detect it.


We all could be working on a collective that will someday say "Okay, 
you're finished. I'll take over from here" -- or -- will take over 
without telling us.


Cheers,

tedd

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

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



Re: [PHP] Re: hello

2009-01-08 Thread tedd

At 10:10 AM -0500 1/8/09, Daniel Brown wrote:


When a vast majority is controlled by a like-minded minority,
evolution and advancement will suffer.


Ya think.

I've been saying that for over 20 years.

The problem is that the majority, when in doubt, will follow the majority.

It's always a safe bet to move towards the center of the herd.

Cheers,

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

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



Re: [PHP] Re: hello

2009-01-08 Thread tedd

At 12:54 PM -0500 1/8/09, Daniel Brown wrote:

That aside, best of luck.  If loss is the most painful thing a
heart can endure, the yearning for opportunity is a very close second.


There you go again, making me all teary-eyed and stuff.

Of what is there to know?
For what seems all, nothing;
But the un-rung bell yearns to rung;
If only to hear its tone;
The tone of being understood.

tedd-1967

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

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



Re: [PHP] Editing in a text area field

2009-01-09 Thread tedd

At 8:12 AM -0500 1/9/09, Stephen wrote:
I have a form to accept free text in a textarea field. The entry is 
stored in a database.


If the user enters:

abc
def
ghi

I want it to finally display like that.

If they enter

abc

def

ghi

I want it to display with the line gaps.

I use CSS so in the first case I would store as abcdefghi

In the second abcdefghi

I also have an edit form, that takes the data out of the database, 
and allows the user to change it, then update the database.


Preparing the existing data before an edit is proving difficult. I 
have to strip the html and make it format properly in the form.


Then put back html before saving again. I keep ending up with stray characters

Has anyone done this? Is there a tutorial on the web somewhere?

Thanks
Stephen


Stephen:

Just store data in a dB, not data AND html.

Besides, things change. You never know how the client will want the 
data displayed.


Cheers,

tedd


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

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



Re: [PHP] Re: hello

2009-01-09 Thread tedd

At 1:39 PM -0500 1/8/09, Robert Cummings wrote:

On Thu, 2009-01-08 at 13:13 -0500, tedd wrote:

 > It's always a safe bet to move towards the center of the herd.

Bah, sheeple! I like to stay away from the herd.

Cheers,
Rob.


I'm sure the feeling is mutual.

A better mouthwash perhaps. :-)

Cheers,

tedd

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

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



Re: [PHP] Re: hello

2009-01-09 Thread tedd

At 1:03 PM -0600 1/8/09, Skip Evans wrote:
Incidentally, I think building their OS on FreeBSD was about the 
smartest thing the Apple/Mac people ever did.


Skip


There are bright people at Apple, like Jobs -- exceptional individual.

Compare Job's presentations to Gates' and you have examples of "what 
to do" and "what not to do". There's even a book called "Presentation 
Zen" that makes that comparison.


<http://www.amazon.com/Presentation-Zen-Simple-Design-Delivery/dp/0321525655/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1231512547&sr=8-1>

Exceptional book, BTW.

Cheers,

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

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



Re: [PHP] Re: hello

2009-01-09 Thread tedd

At 7:18 PM + 1/8/09, Nathan Rixham wrote:
if it's a computer thats on, with an os, a keyboard and a network 
card connected to the internet it's insecure.


It doesn't even have to be connected to the Internet to be insecure.

Cheers,

tedd

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

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



  1   2   3   4   5   6   7   8   9   10   >