Jump to content

Code not working as desired


Eric

Recommended Posts

I was making a page in which you type of some code in one frame and it is displayed in the other frame.The problem is, if quotes are added, either single or double, then they are escaped.If I put <h1 style="color:red;">Hello World</h1> or <h1 style='color:red;'>Hello World</h1> then it just displays as black text because the source comes out like this:<h1 style=\"color:red;\">Hello World</h1> or <h1 style=\'color:red;\'>Hello World</h1>The only time it works is if I write it like this:<h1 style=color;red>Hello World</h1> (with no quotes)Can someone please fix this for me?This is what I have in left.php

<?phpecho <<<HTML<table cellpadding="10" class="center">	<tr>	<td style='background-color: #f8dcc8; color:#000000; width: 200px;'>	<span style="font-family:arial, serif; font-size:15px;">	Type in the HTML code you would like to see, then submit	</span><hr/><form action='right.php' method='post' target='right'><table cellpadding='4' cellspacing='0' border='0'><tr>	<td>	<span style='font-size: 15px; font-family: Verdana, Arial, Helvetica, sans-serif;'>	<strong>Your HTML:</strong>	</span>	</td>		<td>		<textarea cols='40' rows='12' name='htmldata'>$htmldata</textarea>		</td></tr><tr><td align='center'><input type='submit' value='Submit' /></td></tr></table></form></td></tr></table>HTML;?>

This is what I have in right.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /><title>View Your HTML</title></head><frameset rows="75,*"><frame src="top.php" name="top" /><frameset cols="500,*"><frame src="left.php" name="left" /><frame src="right.php" name="right" /><noframes><body><p><a href="noframes.php">This explains why you can't see this page</a></p><p><a href='java script:history.go(-1)'>Or you can go back to the page you left</a></p></body></noframes></frameset></frameset></html> 

Here's the page http://www.clifford.excelitehost.com/tests/showcode/frames/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...