By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,587 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,587 IT Pros & Developers. It's quick & easy.

php reference in <SCRIPT> tag gives "Error on page" in IE6.0

P: n/a
Hi,

I have some problems with a PHP reference in a <SCRIPTtag, but only
with the Internet Explorer, which gives a "Error on page" message in
the Status Bar.
The code is as follows :
<script>
<!--
var stat =<?php echo stripslashes($status); ?>;
window.status = stat;
//-->
</script>

The error given is :

Line:24
Char:13
Error: Syntax error
Code: 0

Char 13 is the "<" or looking to the source of the page with the IE
browser, it's ";"

I get the error message as said before only in the Internet Explorer
browser and it does not affect the display nor the functionality of
the page, but it's not good looking ...

Has anyone out there a solution to get rid of the "error" ?

Thanks in advance.

Feb 8 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 8 Feb, 13:27, "rukkie" <ruk...@belgacom.netwrote:
Hi,

I have some problems with a PHP reference in a <SCRIPTtag, but only
with the Internet Explorer, which gives a "Error on page" message in
the Status Bar.
The code is as follows :
<script>
<!--
var stat =<?php echo stripslashes($status); ?>;
window.status = stat;
//-->
</script>

The error given is :

Line:24
Char:13
Error: Syntax error
Code: 0

Char 13 is the "<" or looking to the source of the page with the IE
browser, it's ";"

I get the error message as said before only in the Internet Explorer
browser and it does not affect the display nor the functionality of
the page, but it's not good looking ...

Has anyone out there a solution to get rid of the "error" ?

Thanks in advance.
Justa guess, but try surrounding the php call with quotes.

Feb 8 '07 #2

P: n/a
On 8 Feb, 13:27, "rukkie" <ruk...@belgacom.netwrote:
Hi,

I have some problems with a PHP reference in a <SCRIPTtag, but only
with the Internet Explorer, which gives a "Error on page" message in
the Status Bar.
The code is as follows :
<script>
<!--
var stat =<?php echo stripslashes($status); ?>;
window.status = stat;
//-->
</script>

The error given is :

Line:24
Char:13
Error: Syntax error
Code: 0

Char 13 is the "<" or looking to the source of the page with the IE
browser, it's ";"

I get the error message as said before only in the Internet Explorer
browser and it does not affect the display nor the functionality of
the page, but it's not good looking ...

Has anyone out there a solution to get rid of the "error" ?

Thanks in advance.
Just re-read your post. The php script isn't outputting anything,
that's why it ends up with the = followed by the ; which is certainly
incorrect syntax.

Feb 8 '07 #3

P: n/a
rukkie wrote:
Hi,

I have some problems with a PHP reference in a <SCRIPTtag, but only
with the Internet Explorer, which gives a "Error on page" message in
the Status Bar.
The code is as follows :
<script>
<!--
var stat =<?php echo stripslashes($status); ?>;
window.status = stat;
//-->
</script>

The error given is :

Line:24
Char:13
Error: Syntax error
Code: 0

Char 13 is the "<" or looking to the source of the page with the IE
browser, it's ";"

I get the error message as said before only in the Internet Explorer
browser and it does not affect the display nor the functionality of
the page, but it's not good looking ...

Has anyone out there a solution to get rid of the "error" ?

Thanks in advance.
You shouldn't even see the php code in your script. It should have been
executed by the server. Is this what the actual source code in your
page looks like?

Is the rest of your PHP code on that page being parsed and executed?

Also, what happens if you get rid of the <!-- ... --delimiters - which
were only required for browsers which came out 15 years ago?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 8 '07 #4

P: n/a
Thank you so much ...
The page only receives a status if the page was called from another
page ...
Initially the page has not received any status ...I did not toke into
account this situation ...
So I have to implement something so that there is always some kind of
status available, no matter from where the page was called ....

Thanks !!
Feb 8 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.