Page 1 of 1

Forward slash stripped from tags

Posted: Mon Mar 24, 2003 11:56 am
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

think I found source og glitch

Posted: Mon Mar 24, 2003 12:46 pm
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:

Posted: Mon Mar 24, 2003 3:46 pm
by lazy_yogi
for gods sake .. if ur not usin windows, use mozilla

netscape sux !

Posted: Mon Mar 24, 2003 6:35 pm
by volka
even if you're using windows use mozilla or at least phoenix. I'm quite happy with it.

Posted: Mon Mar 24, 2003 8:03 pm
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.

they all stink big time!!!!!!

Posted: Tue Mar 25, 2003 3:21 am
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.

Posted: Tue Mar 25, 2003 4:28 am
by twigletmac
Does tlf_inc.php echo those closing tags at any point?

Mac

uggh

Posted: Tue Mar 25, 2003 9:52 am
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.

Re: uggh

Posted: Tue Mar 25, 2003 2:05 pm
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

It's been a while

Posted: Tue Mar 25, 2003 3:46 pm
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.