Forward slash stripped from tags

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
tlfeet
Forum Newbie
Posts: 9
Joined: Tue Mar 18, 2003 2:57 pm

Forward slash stripped from tags

Post by tlfeet »

How do I stop forward slashes from being stripped from tags?

For example, if in php script I have:
<?php
...code

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

...more code
?>

the forward slash gets stripped (towards end of meta line) when page is loaded.
Tried several ways to get around it & am stumped.
This causes validation error for xhtml

I've tried:
<?php
code
?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php
more code
?>

also:
<?php
code

echo '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />'

more code
?>
and variations...driving me bonkers
tlfeet
Forum Newbie
Posts: 9
Joined: Tue Mar 18, 2003 2:57 pm

think I found source og glitch

Post by tlfeet »

pootergeist wrote:
you need to escape the slash with another slash
been there done that:
tried "//>" and "\/>"

Actually, it is wierder and in actual page being viewed - if view source the "/>" is there as required.

I am running netscape 7.02 on Mac 10.2.3 - I think what is happening is not a PHP problem but a netscape bug.
When I save the file and the validate it the "/>" gets transformed into ">" and hence I get validation error.
I think what I need is an "escape" character for netscape :D

So, like I said not really a PHP problem...but was driving me nuts until I noticed it is with saved netscape files. :cry:
User avatar
lazy_yogi
Forum Contributor
Posts: 243
Joined: Fri Jan 24, 2003 3:27 am

Post by lazy_yogi »

for gods sake .. if ur not usin windows, use mozilla

netscape sux !
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

even if you're using windows use mozilla or at least phoenix. I'm quite happy with it.
Skyzyx
Forum Commoner
Posts: 42
Joined: Fri Feb 14, 2003 1:53 am
Location: San Jose, CA

Post by Skyzyx »

Netscape 7.02 uses Gecko 1.0.2 -- which is identical to Mozilla 1.2.1. Phoenix is a good browser, but uses an older trunk version than Moz and Netscape 7.
tlfeet
Forum Newbie
Posts: 9
Joined: Tue Mar 18, 2003 2:57 pm

they all stink big time!!!!!!

Post by tlfeet »

More:
when I browse the file and view source (Netscape or IE)
here is how the top part looks:

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
&#1111;b]</body>&#1111;/b]
&#1111;b]</html>&#1111;/b]
<title>2-leftfeet.net Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Keywords" content="2-leftfeet.net, dance, dancing, instruction" />
<meta name ="Description" content ="homepage for 2-leftfeet.net" />
<link href="weblog.css" rel="stylesheet" type="text/css" />
</head>
<body>
....blah blah blah

notice the </body> & </html> tags towards the top, lines 6 & 7

my code:
index.php contains this:

Code: Select all

<?php echo "<?xml version="1.0" encoding="iso-8859-1"?".">\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<?php 
include("tlf_inc.php");

do_html_header('Home', '2-leftfeet.net, dance, dancing, instruction', 'Home page for 2-leftfeet.net', 'Home');

?>
<br />
<br />
body placeholder<br />
</body>
</html>
as you can see it has "include("tlf_inc.php");"
which read like this (at the top - did not include all of the code):

Code: Select all

<?php 
include("pm_inc.php");

function do_html_header($page_title, $usekeywords, $usedescription, $bread_crumb_text)
&#123;
    echo '<title>2-leftfeet.net ".$page_title."</title>';
?>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta name="Keywords" content="'.$usekeywords.'" />
	<meta name ="Description" content ="homepage for 2-leftfeet.net" />
	<link href="weblog.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
my code (php or html) does not have </html> or </body> them in lines 6 or 7.
This is driving me batty...ran a test.php script and it looks fine php 4.3.1
any help would be appreciated.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Does tlf_inc.php echo those closing tags at any point?

Mac
tlfeet
Forum Newbie
Posts: 9
Joined: Tue Mar 18, 2003 2:57 pm

uggh

Post by tlfeet »

well,
it gets more ocmplicated
tlf_inc.php in turn calls another include, which calls 4 more and on and on.
I suspect in one of those I have an ending tag(s0 hanging around.
So it is going to take me a while to find them (if they exist)
I wrote my last post late last night, brain not working. :-) out of frustration, in that instead of moving forward with the point of the porject I am bogged down in chasing forward slashes and then ending tags.
You know how it goes.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Re: uggh

Post by twigletmac »

tlfeet wrote:You know how it goes.
Sometimes things just refuse to work right. Hopefully though it won't take you too long to find the errant tags...

Mac
tlfeet
Forum Newbie
Posts: 9
Joined: Tue Mar 18, 2003 2:57 pm

It's been a while

Post by tlfeet »

I haven't done html in a long while
...getting back into it.

Forgot how finicky it is - I mean all languages are - but html just does some plain wierd stuff.

Using dreamerweaver and in my includes of includes of includes...etc had let dreamweaver generate the basic page...no big deal but I had done this
<php?

blah blah blah
?>


</body>
</html>

on one of the includes and voila there are ther errant tags.

The finckyness also pops in the way netscape, explorer, safari, mozilla etc. handle errors which makes it doubly hard ot pin down...one works even w/ error type a, the others each do something different with error - e.g. ignore a row in a table vs ignore CSS refs in the row...etc
well you know how it goes.
Post Reply