HTML inside PHP?

I have a HTML code with a javascript tag in it and i want to insert that code in my index.php file but when i do my website cant be accessed anymore. It says something like Syntax error on line 2, unexpected<

How can i insert a HTML code inside a PHP file?Not really a master in programming so your help would be appreciated.

Thanks

Yes i can paste it but it doesnt work

You can either break out of php

<?php
// do php stuff
?>
<h1>html stuff now</h1>
<?php
// carry on with php
?>

or echo html strings

<?php
// php stuff
echo ‘<h1>html stuff</h1>’;
// more php
?>

Can you paste your code?

What doesn’t work? We need to see your code, hash just gave an example…

It most likely means that you forgot to wrap the output XHTML in quotes or something. It’s complaining about an error in syntax, so unless you can show us your code, we can’t help you find the error.

The code is-

<!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” dir=“ltr”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=UTF-8” />
<title>Title</title>
<link rel=“stylesheet” href=“http://mywebsite/css.css” type=“text/css” media=“screen” />
<script src=“http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js” type=“text/javascript”></script>
<script src=“http://mywebsite.com/popup.js” type=“text/javascript”></script>
</head>
<body>
<center>
<a href=“http://www.mywebsite.com”></a>
<div id=“button”></div>
</center>
<div id=“popupContact”>
<a id=“popupContactClose”>x</a>
<a href=“http://www.mywebsite.com”><img src=“http://mywebsite.com/advert.jpg” alt=“Go to mywebsite.com” width=“412” height=“396”/></a>
<h1><br/>
<br/>
</h1>
</div>
<div id=“backgroundPopup”></div>
</body>
</html>

Please note the post#3
There are all you need.

I tried to echo the html as the post 3 says and it worked, there is no more syntax error but my website gets a bit messed up after the code is added.

The code i posted looks something like this in action-

http:// yensdesign.com/tutorials/popupjquery/

The only difference is that the pop up loads automatically instead of pressing the button to load. And when i inserted the code in the php file my website did not look the same as before…it was really messed up and i dont know why. Any ideas?

as the post 3 says, you don’t need any echo at all.
You can break out of php. And insert any html you wish. As if it were HTML file.
Can you insert HTML code into HTML file? Well where is no difference.