Forum Moderators: coopster

Message Too Old, No Replies

Opera & Navigator don't show page after PHP handles form data

Normal pages, and initial view of form page display fine. IE fine in both.

         

zollerwagner

7:01 am on Feb 11, 2004 (gmt 0)

10+ Year Member



I've got a problem that shows up in Navigator 7 and Opera 7 but not IE 6.

Most of my pages use PHP. They load fine--unless I have a form on the page. In that case, it displays fine when empty, but after I validate it with JavaScript and send it to itself to process the data (more validation and sending of emails) the page doesn't display. The symptom is that although the page seems to finish loading (view source shows what appears to be the complete page), in Opera and Navigator, all I see is the css background image. The text, forms, etc. aren't there.

Oddly, these pages still send the emails, which is one of the last steps before display.

In Opera there is a status bar at the bottom of my window that reports:

document: 100%
images: 4/4
total: 0 b
speed:?
time: 105:20 (minutes and seconds)
completed request to wwWebmasterWorldebsite.com

The clock is still counting 2 hours later, as though it's waiting for something.

My error logs don't show any problems, that I can tell. The status codes were 304 and 200, so it's possible, I suppose, that a dated version of the files is being accessed.

I don't get quite as much info from Navigator, but the same basic behavior.

Internet Explorer seems to ignore whatever the problem is and shows the pages just fine.

I've tried using a blank css file, stripping out lots of the code. I think next I'll try looking in the common .ssi files for the header and footer for irregularities.

Does anyone have any other ideas? It's had me stumped all day!

jatar_k

4:59 pm on Feb 11, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe try validating the page with [validator.w3.org...]

zollerwagner

6:19 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



I was surprised, but the w3.org tools didn't show any issues, either on the css or xhtml validation.

But--I did find the problem by taking the downloaded page's view source and slowly cutting out parts.

It's this:

<script type="text/javascript">
//<![CDATA[
document.location="#signup";
//]]>
</script>

That stumps Opera and Netscape Navigator.

Knowing the problem is half way to a solution. Any ideas?

I've tried location.hash and I've tried using the hash in the form tag:

<form action="staffTraining.php#signup"....
. Neither of those works. (Netscape seems more tolerant, than Opera and at least displays the page.)

Is there another way to use php or javascript to go to a specific place on a page? (Using the body tag didn't work because Symantec's software corrupts the quotes in the onload.)

fenix_ds

9:35 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



Have you tried posting this at Opera forums?

[my.opera.com...]

I guess they can have an idea there.

zollerwagner

10:28 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



That's a very good idea. I'll post what I learn there here.

zollerwagner

7:56 am on Feb 14, 2004 (gmt 0)

10+ Year Member



After working with the Opera people I've settled on a solution that is probably a variation on something we talked about here. So far it appears to work:

<?php 
$goTo = "'#signup'";
if (isset($_POST['submit'])) // if form was submitted, use onload body tag
{
?>
<body id="top" onload="location.href=<?=$goTo?>;">
<?php
}
else // form not submitted, use plain body tag
{
?>
<body id="top">
<?php
}
?>

Symantec adds an extra ";", but that doesn't seem to hurt.

<body id="top" onload="var SymTmpWinOpen = window.open; window.open = SymWinOpen; location.href='#signup';; window.open = SymTmpWinOpen;">

Thanks for helping!

mep00

7:00 am on Feb 15, 2004 (gmt 0)

10+ Year Member



As a language, I find javascript interesting. On a practical level of Web development, I avoid it like the plague! It's too unreliable; you have almost no control over the enviroment. I'd rather do what I can on the server side with php. Client side, HTML is stable and safe to use; CSS, if it breaks, rarely is the problem worse tham the page not looking right. In my book, looks, while important, are secondary to functionality.

zollerwagner

8:03 pm on Feb 15, 2004 (gmt 0)

10+ Year Member



If anyone is using this thread to fix the same problem, it's worth visiting this other thread for an updated solution:
[webmasterworld.com...]

mep00

5:34 am on Feb 16, 2004 (gmt 0)

10+ Year Member



Symantec adds an extra ";", but that doesn't seem to hurt.
location.href='#signup';;
Curious. It does absolutly nothing--quite literally (beyond wasting some nanoseconds). It's adding a null statement. The only time I can think of when a null statement is of any value is for an empty loop.

zollerwagner

6:51 am on Feb 16, 2004 (gmt 0)

10+ Year Member



Given the way Symantec also tends to corrupt onload attributes, I'd say Symantec has introduced a bug.