- Oct 9, 2002
- 28,298
- 1,236
- 136
I have a PHP submission form that seems to work fine in both IE and Chrome. When viewing page source in Chrome, I noticed that a <script> tag was never closed:
Chrome:
IE:
From my PHP source, this is the statement that generates that bit of HTML:
I'm new to PHP and I'm not very familiar with the syntax. I understand that \' should output a single-quote, and a "." combines literal strings and string variables.
"submitted" is a hidden input element, only there to detect if the page was loading for the first time, or if the user already clicked "Submit" without completing all the required fields.
Is there some better way to do that statement?
Thanks!
...now that I think about it, PHP is pre-processed. Why would the server send different HTML to IE versus Chrome? My code has no manual browser detection.
[edit]
I used telnet to request the page without using any browser. The server definitely returns valid code with the closing tag. Why does Google Chrome omit this from the page source?!
Chrome:
Code:
<script type='text/javascript'>document.getElementById("submitted").value="yes";
IE:
Code:
<script type='text/javascript'>document.getElementById("submitted").value="yes";</script>
From my PHP source, this is the statement that generates that bit of HTML:
Code:
echo '<script type=\'text/javascript\'>document.getElementById("submitted").value="yes";</script>';
I'm new to PHP and I'm not very familiar with the syntax. I understand that \' should output a single-quote, and a "." combines literal strings and string variables.
"submitted" is a hidden input element, only there to detect if the page was loading for the first time, or if the user already clicked "Submit" without completing all the required fields.
Is there some better way to do that statement?
Thanks!
...now that I think about it, PHP is pre-processed. Why would the server send different HTML to IE versus Chrome? My code has no manual browser detection.
[edit]
I used telnet to request the page without using any browser. The server definitely returns valid code with the closing tag. Why does Google Chrome omit this from the page source?!
Last edited:
