FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » IE8 crashes when back button clicked after sending email from PHP script
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
IE8 crashes when back button clicked after sending email from PHP script [message #172178] Thu, 03 February 2011 09:33 Go to next message
P E Schoen is currently offline  P E Schoen
Messages: 86
Registered: January 2011
Karma: 0
Member
I just finished a simple HTML form which asks for a password to access (and
add to) an email list maintained in an SQlite database. The emails are
displayed as <a href="mailto:Addy(at)example(dot)com">, so the addresses are
clickable. It brings up my Windows Live Mail (which is part of IE8 in a
way), but if I send an email or cancel, and then click the BACK <- button, I
get a message that IE has stopped working. The email is sent OK, but this
crash happens consistently. I have everything on my Apache xampp localhost.
IE8 recovers and reloads the tab with my HTML form. The list of names and
emails are just echoed to STDIN.

Any ideas where to look or how to test for what's causing this?

BTW, I'm beginning to like PHP now that I got my feet wet. But I had a
really hinky bug where I got errors of "unexpected T_CONST_ENCAPSED_STRING
and T_ENCAPSED_AND_WHITESPACE". The error occurred on a line that was
perfectly fine, and even when I commented the line with // or */ .. /*.
Finally I found an unpaired single and or double quote, and a missing ). But
the -l lint was not much help in this case. Any better tools that might
catch this sort of error?

Thanks,

Paul
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172179 is a reply to message #172178] Thu, 03 February 2011 10:19 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
On Feb 3, 9:33 am, "P E Schoen" <p...@pstech-inc.com> wrote:
> I just finished a simple HTML form which asks for a password to access (and
> add to) an email list maintained in an SQlite database. The emails are
> displayed as <a href="mailto:A...@example.com">, so the addresses are
> clickable. It brings up my Windows Live Mail (which is part of IE8 in a
> way), but if I send an email or cancel, and then click the BACK <- button, I
> get a message that IE has stopped working. The email is sent OK, but this
> crash happens consistently. I have everything on my Apache xampp localhost.
> IE8 recovers and reloads the tab with my HTML form. The list of names and
> emails are just echoed to STDIN.
>
> Any ideas where to look or how to test for what's causing this?

Whatever is causing this is nothing to do with php per se, since the
browser has no knowledge of what causes a page to be delivered to it.
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172180 is a reply to message #172178] Thu, 03 February 2011 11:43 Go to previous messageGo to next message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
El 03/02/2011 10:33, P E Schoen escribió/wrote:
> I just finished a simple HTML form which asks for a password to access
> (and add to) an email list maintained in an SQlite database. The emails
> are displayed as <a href="mailto:Addy(at)example(dot)com">, so the addresses
> are clickable. It brings up my Windows Live Mail (which is part of IE8
> in a way), but if I send an email or cancel, and then click the BACK <-
> button, I get a message that IE has stopped working. The email is sent
> OK, but this crash happens consistently. I have everything on my Apache
> xampp localhost. IE8 recovers and reloads the tab with my HTML form. The
> list of names and emails are just echoed to STDIN.
>
> Any ideas where to look or how to test for what's causing this?

I'd dare say it's a bug in some Microsoft product: Internet Explorer,
Windows Live Mail or Windows itself. The only imaginable way to crash a
browser with a server side language is to send HTML from an infinite loop.


> BTW, I'm beginning to like PHP now that I got my feet wet. But I had a
> really hinky bug where I got errors of "unexpected
> T_CONST_ENCAPSED_STRING and T_ENCAPSED_AND_WHITESPACE". The error
> occurred on a line that was perfectly fine, and even when I commented
> the line with // or */ .. /*. Finally I found an unpaired single and or
> double quote, and a missing ). But the -l lint was not much help in this
> case. Any better tools that might catch this sort of error?

The -l option should tell you the exact error message, file and line
number. But I assume you are referring to errors are detected several
lines later, such as mismatched parenthesis and the like:

<?php
foreach($foo as $i){
blah();
// Missing bracket here

if($bar){
blah();
blah();
}
// Error reported here

Well... You basically need to understand the error messages and gather
some experience. Error messages are normally self-explanatory but they
may also refer to parser tokens and that makes them difficult to
understand them. Tokens are explained here:

http://es.php.net/manual/en/tokens.php

Curiously, T_CONST_ENCAPSED_STRING does not appear to be documented
(:-!) but there is T_CONSTANT_ENCAPSED_STRING. If you look at both
definitions, it's clear that something failed when building a complex
double-quoted string.

For an automated parser, it's extremely difficult to figure out what you
actually had in mind. Any decent editor should feature syntax
highlighting and thus warn you about unmatched quotes but the editor
doesn't really have a reliable way to figure out where you intended to
close the string. Whatever, it's worth noting that the JetBrains
PhpStorm IDE (written in Java and non-free) does a very good
mind-reading job anyway.



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172181 is a reply to message #172178] Thu, 03 February 2011 12:20 Go to previous messageGo to next message
Beauregard T. Shagnas is currently offline  Beauregard T. Shagnas
Messages: 154
Registered: September 2010
Karma: 0
Senior Member
P E Schoen wrote:

> ... It brings up my Windows Live Mail (which is part of IE8 in a way),

S'far as I know, WLM is a standalone application these days.

> The error occurred on a line that was perfectly fine,

Frequently, the error reports the line number _after_ the line that
actually contains the misteak.

> and even when I commented the line with // or */ .. /*.

A block comment is: /* ... */ (not the other way)

> Finally I found an unpaired single and or double quote, and a missing
> ).

I've always found that typing both the start/end quotes, parentheses, or
whatever at the same time, then filling in the middle eliminates most of
those kinds of errors.

--
-bts
-Four wheels carry the body; two wheels move the soul
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172183 is a reply to message #172181] Thu, 03 February 2011 13:40 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
Beauregard T. Shagnasty wrote:
> P E Schoen wrote:
>
>> ... It brings up my Windows Live Mail (which is part of IE8 in a way),
>
> S'far as I know, WLM is a standalone application these days.
>
>> The error occurred on a line that was perfectly fine,
>
> Frequently, the error reports the line number _after_ the line that
> actually contains the misteak.
>
>> and even when I commented the line with // or */ .. /*.
>
> A block comment is: /* ... */ (not the other way)
>
>> Finally I found an unpaired single and or double quote, and a missing
>> ).
>
> I've always found that typing both the start/end quotes, parentheses, or
> whatever at the same time, then filling in the middle eliminates most of
> those kinds of errors.
>
Or use and editor with some kind of smarts. I have gotten used to Geany.

If my whole page turns orange, I have an unclosed quote somewhere.
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172192 is a reply to message #172183] Thu, 03 February 2011 18:26 Go to previous messageGo to next message
P E Schoen is currently offline  P E Schoen
Messages: 86
Registered: January 2011
Karma: 0
Member
"The Natural Philosopher" wrote in message
news:iieb8j$qu8$2(at)news(dot)albasani(dot)net...

> I've always found that typing both the start/end quotes,
> parentheses, or whatever at the same time, then filling in
> the middle eliminates most of those kinds of errors.

> Or use and editor with some kind of smarts. I have gotten
> used to Geany.

> If my whole page turns orange, I have an unclosed quote
> somewhere.

I have been using PerEdit, and it does work well with Perl scripts, but not
so much for PHP. I'll try Geany. Thanks for the tip.

Also, I tried using Firefox, and I did not have any problem with the back
button. Same with Google Chrome.

The error message indicates that IE8 believes it is a problem with the web
page. Would that be the page generated by the script, or the HTML containing
the form?

Another problem I have had is running SQLite on my live server Dreamhost.
The documentation indicates that I need to download and install SQLite on
the server. But my Perl script uses SQLite and I didn't have to do anything
special. I did, however, need to add this:

use DBI;
my $db = DBI->connect( # connect to your database, create if
needed
"dbi:SQLite:dbname=$dbfile", # DSN: dbi, driver, database file

While for PHP I have only:

$db = new SQLite3($dbFile);

The exact error message:

Fatal error: Class 'SQLite3' not found in
/home/pes1949/pauleschoen.com/cgi-bin/BGFemail.php on line 52

Any way to fix this?

Thanks,

Paul
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172194 is a reply to message #172192] Thu, 03 February 2011 19:32 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/3/2011 1:26 PM, P E Schoen wrote:
> "The Natural Philosopher" wrote in message
> news:iieb8j$qu8$2(at)news(dot)albasani(dot)net...
>
>> I've always found that typing both the start/end quotes,
>> parentheses, or whatever at the same time, then filling in
>> the middle eliminates most of those kinds of errors.
>
>> Or use and editor with some kind of smarts. I have gotten
>> used to Geany.
>
>> If my whole page turns orange, I have an unclosed quote
>> somewhere.
>
> I have been using PerEdit, and it does work well with Perl scripts, but
> not so much for PHP. I'll try Geany. Thanks for the tip.
>

Eclipse with the PHP plugin is a pretty good editor PHP environment.
It's in Java, though, so it will be a bit slow on older machines.

> Also, I tried using Firefox, and I did not have any problem with the
> back button. Same with Google Chrome.
>
> The error message indicates that IE8 believes it is a problem with the
> web page. Would that be the page generated by the script, or the HTML
> containing the form?
>

The error message doesn't say. But since it works with FireFox and
Chrome, I would think it's an IE problem, and you'll need to track it
down from that end.

> Another problem I have had is running SQLite on my live server
> Dreamhost. The documentation indicates that I need to download and
> install SQLite on the server. But my Perl script uses SQLite and I
> didn't have to do anything special. I did, however, need to add this:
>
> use DBI;
> my $db = DBI->connect( # connect to your database, create if needed
> "dbi:SQLite:dbname=$dbfile", # DSN: dbi, driver, database file
>
> While for PHP I have only:
>
> $db = new SQLite3($dbFile);
>
> The exact error message:
>
> Fatal error: Class 'SQLite3' not found in
> /home/pes1949/pauleschoen.com/cgi-bin/BGFemail.php on line 52
>
> Any way to fix this?
>
> Thanks,
>
> Paul

You'll have to get your host to install the SQLite3 PHP extension.

Alternatively, go with a better database such as MySQL or PostGreSQL,
whichever might be available on your host.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172195 is a reply to message #172192] Thu, 03 February 2011 21:12 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
On 03/02/11 18:26, P E Schoen wrote:

> Another problem I have had is running SQLite on my live server
> Dreamhost. The documentation indicates that I need to download and
> install SQLite on the server. But my Perl script uses SQLite and I
> didn't have to do anything special. I did, however, need to add this:
>
> use DBI;
> my $db = DBI->connect( # connect to your database, create
> if needed
> "dbi:SQLite:dbname=$dbfile", # DSN: dbi, driver, database file
>
> While for PHP I have only:
>
> $db = new SQLite3($dbFile);
>
> The exact error message:
>
> Fatal error: Class 'SQLite3' not found in
> /home/pes1949/pauleschoen.com/cgi-bin/BGFemail.php on line 52
>
> Any way to fix this?

I had to install the php5-sqlite package to obtain sqlite3 functionality.

Might it be that although your development environment has sqlite3
support your hosting company doesn't?

Dreamhost hosting website doesn't say it supports sqlite. Of course,
this doesn't mean that it doesn't, but my experience (above) is that
it's not "compiled-in" to _all_ flavours of PHP5.

Rgds

Denis McMahon
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172200 is a reply to message #172194] Thu, 03 February 2011 21:29 Go to previous messageGo to next message
P E Schoen is currently offline  P E Schoen
Messages: 86
Registered: January 2011
Karma: 0
Member
"Jerry Stuckle" wrote in message
news:iievs6$dmf$1(at)news(dot)eternal-september(dot)org...

On 2/3/2011 1:26 PM, P E Schoen wrote:

>> Also, I tried using Firefox, and I did not have any problem with
> the back button. Same with Google Chrome.
>
>> The error message indicates that IE8 believes it is a problem with
>> the > web page. Would that be the page generated by the script, or
>> the HTML containing the form?

> The error message doesn't say. But since it works with FireFox and
> Chrome, I would think it's an IE problem, and you'll need to track it down
> from that end.

Actually, it only had a problem when run from the Apache localhost server.
But I also made some changes so it would run on the Dreamhost server using
SQLite (version 2.x) rather than SQLite3, which is apparently not installed.

>> Another problem I have had is running SQLite on my live server
>> Dreamhost. The documentation indicates that I need to download
>> and install SQLite on the server. But my Perl script uses SQLite
> and I didn't have to do anything special.

> You'll have to get your host to install the SQLite3 PHP extension.

> Alternatively, go with a better database such as MySQL or
> PostGreSQL, whichever might be available on your host.

Dreamweaver seems to be mostly MySQL, and apparently the SQLite is an older
version. There are instructions on how to install SQLite3, but they are
considered "advanced" and warn about possibly screwing things up. Apparently
SQLite3 is installed for Perl, but not for PHP. One reason I want to stay
with SQLite3 is a database browser utility I have for that version. But I'm
sure there are some for version 2.

Maybe I'll just bite the bull and switch over to MySQL. I doubt that it is
really any more difficult than SQLite, and it seems a bit more universal.
Might as well learn something new again, now that I've become an expert at
PHP...

Just kidding. I've only scratched the surface of CGI scripting, but I do
think PHP is best for my purposes.

One quick question: If I include my HTML form along with the PHP script that
is now called to process the CGI variables, and put it in the cgi-bin folder
where outside users only have execute permission, does that work? And does
it also serve to hide the HTML as well as the PHP code? I have seen that
when I have a web page generated by PHP, the View Source only shows what is
generated to STDIN. I don't care so much about the HTML form, but the PHP
has the password hard-coded in the script.

Which also brings up the question of how secure that is, and if perhaps it
should be encrypted in some way?

You can see my efforts (so far) for this second project at:
www.baltimoregreenforum.org.

Many thanks,

Paul
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172201 is a reply to message #172195] Thu, 03 February 2011 22:53 Go to previous messageGo to next message
P E Schoen is currently offline  P E Schoen
Messages: 86
Registered: January 2011
Karma: 0
Member
"Denis McMahon" wrote in message
news:4d4b1aff$0$28115$bed64819(at)gradwell(dot)net...

> I had to install the php5-sqlite package to obtain sqlite3
> functionality.

> Might it be that although your development environment has
> sqlite3 support your hosting company doesn't?

> Dreamhost hosting website doesn't say it supports sqlite. Of
> course, this doesn't mean that it doesn't, but my experience
> (above) is that it's not "compiled-in" to _all_ flavours of PHP5.

I think you are correct, although the Perl implementation seems to be
SQLite3 as default. Lately I have been developing on my localhost and it has
SQLite3. When I ran phpinfo(); I got:

SQLite
SQLite support enabled
PECL Module version 2.0-dev $Id: sqlite.c 298697 2010-04-28 12:10:10Z iliaa
$
SQLite Library 2.8.17
SQLite Encoding iso8859

I don't know why SQLite3 is not just configured on Dreamhost for everyone.
It seems like an unnecessary hassle for each user to install it themselves.

Thanks,

Paul
Re: IE8 crashes when back button clicked after sending email from PHP script [message #172205 is a reply to message #172201] Fri, 04 February 2011 03:31 Go to previous message
P E Schoen is currently offline  P E Schoen
Messages: 86
Registered: January 2011
Karma: 0
Member
"P E Schoen" wrote in message news:plG2p(dot)34244$Pi6(dot)28370(at)newsfe01(dot)iad...

> I don't know why SQLite3 is not just configured on Dreamhost for
> everyone. It seems like an unnecessary hassle for each user to
> install it themselves.

Well, I finally got it working, after I had changed the PHP script to use
SQLite2. What was required? I found a thread in the forum that mentioned
using PHP 5.3 instead of 5.2. And along with that, the SQLite3 was included
in the list.
http://discussion.dreamhost.com/thread-128627.html?highlight=sqlite

I'm not really sure the post was 100% correct, but I was able to configure
my site to the 5.3 Fast version, and within 5 minutes the change was
implemented and I'm off and ruining. (I can't run, but I'm pretty good at
ruining) :)

Case in point, the back button still crashes IE8... on localhost ONLY

Thanks,

Paul
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: REQ: Looking for a script program called paCheckbook
Next Topic: json and non UTF8
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 14:20:47 GMT 2024

Total time taken to generate the page: 0.02329 seconds