php-general Digest 11 Aug 2006 12:49:32 -0000 Issue 4287

Topics (messages 240528 through 240538):

Re: List Meeting NNOT
        240528 by: tedd
        240529 by: tedd
        240534 by: Ligaya Turmelle

Re: OT? Verifying mail was received
        240530 by: tedd

Re: loop in horizontal direction (php-html)
        240531 by: tedd
        240532 by: Larry Garfield

Re: calendar Q
        240533 by: William Stokes

Re: Cron running 'Hello world' script dies with "Could not      startup."
        240535 by: Ivo F.A.C. Fokkema

Re: break up variable and put each element in an array
        240536 by: Reinhart Viane
        240537 by: Ivo F.A.C. Fokkema

problem with Firefox print preview?
        240538 by: Angelo Zanetti

Administrivia:

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

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

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
At 7:22 AM +0200 8/10/06, Paul Scott wrote:
On Wed, 2006-08-09 at 18:54 -0500, Jay Blanchard wrote:

 Yes, but not everyone can get to or goes to conferences. And this would
 stand on its own don'tcha think? I think that Chicago is perfect,
 because it is centrally located (kinda') and a neat place to boot.


Kinda...Chicago is a bit of a drive for us in Cape Town, South
Africa... ;)

--Paul

Start driving now and remember to roll up the windows.

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

--- End Message ---
--- Begin Message ---
At 1:57 PM -0400 8/10/06, John Nichel wrote:
Adam Zey wrote:
<snip>
It's still a bit of a drive when you live in Montreal and don't have a car. About an 18 hour drive, plus a few hours for bus stops and border crossings.


Canadians are welcome to come?  That's it, count me out!

:-p


LOL, eh?

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

--- End Message ---
--- Begin Message ---
tedd wrote:
At 7:22 AM +0200 8/10/06, Paul Scott wrote:

On Wed, 2006-08-09 at 18:54 -0500, Jay Blanchard wrote:

 Yes, but not everyone can get to or goes to conferences. And this would
 stand on its own don'tcha think? I think that Chicago is perfect,
 because it is centrally located (kinda') and a neat place to boot.


Kinda...Chicago is a bit of a drive for us in Cape Town, South
Africa... ;)

--Paul


Start driving now and remember to roll up the windows.

tedd
Wonder if I can get a scuba diving tank large enough...

--

life is a game... so have fun.

--- End Message ---
--- Begin Message ---
At 11:48 AM -0700 8/10/06, Chris W. Parker wrote:
Hello,

I have about 90 customers who have created accounts but not yet
activated them in the past 11 months. That's less than one every 3.6
days but compared to our total number of customers, it's right at the
edge of being a significant number.

I'm curious to find a way to determine if the mail was actually
delivered to the customer's mailbox. I know there are many factors
involved in this, the most difficult of which being spam filters.

One method I thought of was to put a web bug in the email which will
effectively tell me if the email was read or not. Perhaps by the time
the customer gets the click-this-link-to-activate-your-account email
they've lost interest and ignore it. Or maybe they do in fact read it
but they just don't click. A web bug will help me to determine this.

On the other hand, a web bug won't tell me if the mail actually reached
their inbox. The only way I can come up with to even closely determine
this is to monitor my sendmail logs for proof that their mail server (at
the very least) accepted the message.

Has anyone implemented something like this already and have code to
share with regards to parsing the sendmail log? Or are there more clever
or more simple ways to do this out there?


Thanks!
Chris.


Chris:

Not a php solution, but send them all a buck via PayPal. For $90 you'll learn if their email addresses are correct.

That should be cheaper than writing a program to figure it out for you, if it can be done.

tedd

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

--- End Message ---
--- Begin Message ---
At 2:42 PM -0400 8/10/06, Al wrote:
Marcus Bointon wrote:
On 10 Aug 2006, at 16:39, Al wrote:

<td>s don't need to be terminated with </td>s

That is, assuming you don't want your pages to validate. As closing your tags is so trivially easy, it's really not worth not doing! I recently encountered a site that contained 3500 unclosed font tags on a single page; This is a very good way of making a browser go very slowly and eat lots of memory.

Marcus
--Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
[EMAIL PROTECTED] | http://www.synchromedia.co.uk/


Best double check your facts.  W3C specs say the </td> and </tr> are optional.
http://www.w3.org/TR/html4/index/elements.html


Al & Marcus:

Validation? -- true and not true depending upon what DOCTYPE you use.

For example, if you're using HTML 4.01 Strict, Transitional, or Frameset DOCTYPE, then you can get away with not closing the <td> tag (as well as several other tags) and still validate. However, if your using XHTML DOCTYPE, then you must close all tags to validate. In other words, you can't leave off the <td> tag, or any other, and still validate.

Unfortunately, closing ALL tags also means that your code will fail validation IF you use HTML 4.01 DOCTYPE. That always seemed wrong to me, but sharper minds than mine figured it that way.

tedd

PS: <font> tags (open or closed) should never be on a page anyway.
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Thursday 10 August 2006 13:42, Al wrote:
> Marcus Bointon wrote:
> > On 10 Aug 2006, at 16:39, Al wrote:
> >> <td>s don't need to be terminated with </td>s
> >
> > That is, assuming you don't want your pages to validate. As closing your
> > tags is so trivially easy, it's really not worth not doing! I recently
> > encountered a site that contained 3500 unclosed font tags on a single
> > page; This is a very good way of making a browser go very slowly and eat
> > lots of memory.
> >
> > Marcus
> > --Marcus Bointon
> > Synchromedia Limited: Creators of http://www.smartmessages.net/
> > [EMAIL PROTECTED] | http://www.synchromedia.co.uk/
>
> Best double check your facts.  W3C specs say the </td> and </tr> are
> optional. http://www.w3.org/TR/html4/index/elements.html
>
> I do it all the time and ALL my work W3C validates.  Try it.

Many closing tags are technically optional in HTML.  They are all required in 
XHTML.

Even if you are writing HTML and not XHTML or XHTML-sent-as-html (not to start 
that fight here, really!), you should use XHTML's pickier syntax.  With the 
exception of the self-closing / (which has never broken anything for me, 
ever), everything in XHTML's requirements are simply good practice anyway.

Closing your tags makes it much easier for you, the author, and others to find 
where you're ending things.  It means you tell the browser explicitly where 
things end, so the browser doesn't have to guess.  When doing anything 
interesting with CSS or Javascript, knowing explicitly exactly where your DOM 
tree breaks down is critical.  It also means that whenever you do start 
sending XHTML as XHTML, you're 90% done with your conversion already.

Really, there's no reason in 2006 to not properly close your tags other than 
pure laziness.

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

--- End Message ---
--- Begin Message ---
Ok. Thanks.

One more question. I have dates as a datetime in DB. Like 2006-08-11 
08:20:00 and I'm playing only with date part in the calendar 2006-08-11. So 
how to compare this date to the datetime info in DB? Do I need to use 
DATE_FORMAT or someting like this in the query?

Thanks
-Will



""Richard Lynch"" <[EMAIL PROTECTED]> kirjoitti 
viestissä:[EMAIL PROTECTED]
> On Thu, August 10, 2006 12:14 pm, William Stokes wrote:
>> I have a calendar script that displays a simple mini calendar view one
>> month
>> at a time. User can click any date and the calendar opens another page
>> that
>> displays that date's events. I would like to highlight to the mini
>> calendar
>> view dates that have an event in database. So what would be a simple
>> way to
>> check for events while the selected months days are printed to screen?
>
> Depending on the number of records, the PHP<->MySQL connection speed,
> and the indexes or lack thereof on your date column...
>
> 1. You could do a query for each date like:
> select count(*) from events where whatdate = '$date'
>
> 2. You could pre-fill an array with dates that have an event:
> select whatdate from events
> where whatdate >= '$month/1/$year'
> and whatdate < '{$month+1}/1/$year' /*might need something better here*/
> group by whatdate
> order by whatdate
> while (list($whatdate) = mysql_fetch_row($result)){
>  $event_date[$whatdate] = true;
> }
> Then, while filling out the calendar, just check:
> if (isset($event_date[$date])){
>  //color it as having events
> }
>
> -- 
> Like Music?
> http://l-i-e.com/artists.htm 

--- End Message ---
--- Begin Message ---
On Thu, 10 Aug 2006 16:41:38 -0500, Richard Lynch wrote:

> On Wed, August 9, 2006 3:14 am, Ivo F.A.C. Fokkema wrote:
>> SO: Loading the GTK library in your /etc/php4/cli/php.ini, KILLS the
>> PHP-cli functionality from cron. On Ubuntu Dapper, that is. Not sure
>> about
>> other distros.
> 
> Probably because the PATH to the GTK.so file is not absolute in your
> php.ini, so your can find it from your shell environment, but the cron
> shell environment cannot find it.
> 
> If you dink around with the paths in php.ini for extension_dir and the
> GTK.so, and if you set permissions up, you should be able to make it
> work, if you want it to.

The GTK.so is in the same path all the other extensions are... Also, when
logged in through X it works, when using SSH to my machine, it doesn't.

I asked on the php.gtk.general list, and I was told this behaviour is
expected; the module needs a X environment. It's not going to be fixed in
GTK2 either. For now, I've got two php.ini files. One with the extension
loaded, one without. I will just have to use the PHP-cli -c flag (specify
.ini file)...

--- End Message ---
--- Begin Message ---
Actually, I know that it's browser/OS dependent, cuz I had a bunch of
Mac users who sent only \r all the time.

This may be true only of OS 9, and you may not care about them
anymore, but there it is.

I also would not be so quick to claim that Linux sends \r\n -- It
could be dependent on the browser, the OS version, the OS distro, some
OS settings, ...

Better safe than sorry, and I *know* I ran into this with some Mac users.

Plus I hate trying to edit the text chunks in vi with those icky \r
thingies that turn into ^M :-)

What would you suggest to use then?

--- End Message ---
--- Begin Message ---
On Thu, 10 Aug 2006 17:17:23 -0500, Richard Lynch wrote:

> On Tue, August 8, 2006 3:47 pm, Fokkema, I.F.A.C. \(HKG\) wrote:
>>>> If the user separates the dates by an enter in the textarea, you
>>>> need
>>>> to
>>>> explode on "\r\n". To be able to handle both, you need to use
>>>> split()
>>>> or
>>>> preg_split().
>>>>
>>>>
>>>> When I use
>>>> $datelist=$_POST[datelist];
>>>>   $string=explode('\r\n',$datelist);
>>>
>>> '\r\n' and "\r\n" are not anything alike...
>>>
>>> \r\n only have special meaning inside of ", not '
>>>
>>> If you want to cover all browser/OS combinations, you'd want to
>>> pre-treat the text area input like:
>>> $datelist = $_POST['datelist'];
>>> $datelist = str_replace("\r\n", "\r", $datelist);
>>> $datelist = str_replace("\r", "\n", $datelist);
>>>
>>> Now all the date are separated by "\n" and you can reliably use
>>> explode("\n", $datelist); on them.
>>
>> Actually, I know that both Windows and Linux send a linebreak in a
>> textarea as "\r\n", not "\n". I assume it's all the same for all
>> platforms, and that Mac would send "\r\n", too.
> 
> Actually, I know that it's browser/OS dependent, cuz I had a bunch of
> Mac users who sent only \r all the time.
> 
> This may be true only of OS 9, and you may not care about them
> anymore, but there it is.
> 
> I also would not be so quick to claim that Linux sends \r\n -- It
> could be dependent on the browser, the OS version, the OS distro, some
> OS settings, ...

I've tested this on different distros and browsers, all had sent \r\n and
in years I've not had any problems with not receiving \r\n. But I did some
extensive searching, and I found this in the W3C specifications:

"Line breaks, as in multi-line text field values, are represented as "CR
LF" pairs, i.e., `%0D%0A'."

(http://www.w3.org/TR/WD-html40-970917/interact/forms.html)

> Better safe than sorry, and I *know* I ran into this with some Mac users.
> 
> Plus I hate trying to edit the text chunks in vi with those icky \r
> thingies that turn into ^M :-)

Well, if it's true that some browsers on some platforms ignore the W3C
standard, I guess we could use:

$datelist = str_replace(array("\r\n","\n","\r"),'<BR>',$_POST['datelist']);

Ivo

--- End Message ---
--- Begin Message ---
Hi all,

I've developed this site in PHP and its basically finished, now I have a problem with the printing and print preview. I have a dynamic table that can span various pages depending on the number of records pulled from the database.

The print preview (and printed page) doesnt print the first few rows but instead just prints blank then only prints the last line of the table on a new page. The table is embedded inside a fieldset component. Im not sure if its a mozilla/firefox bug because it seems fine in IE.

Has anyone come across this problem before?

Thanks in advance
Angelo

--
------------------------------------------------------------------------
Angelo Zanetti
Systems developer
------------------------------------------------------------------------

*Telephone:* +27 (021) 469 1052
*Mobile:*       +27 (0) 72 441 3355
*Fax:*            +27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

--- End Message ---

Reply via email to