First of all, let me show you a bit of code:
index.php
<a href="new-directory-dialog.php" data-role="button" data-rel="dialog" data-transition="slidedown"><?php echo localize('New directory'); ?></a>
So, as you can see, I use new-directory-dialog.php as a dialog window. All works fine on local machine, using Wamp server on Win 7 x64. But on my web host server, every dialog page is displayed with ?> (or ?>) chars.
HTML tab in Firebug shows this output:
<html class="ui-mobile">
<head>
<base href="http://pantljika-online.info/link/new-directory-dialog.php">
</head>
<body class="ui-mobile-viewport ui-overlay-a">
?>
<title>Novi direktorij</title>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
I have no clue why is this happening.
Here is entire code for dialog page:
<?php
include('localize.php');
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo localize('New directory'); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
<div data-role="page" data-theme="<?php echo $_SESSION['data-theme']; ?>" >
<form action="index.php" method="post">
<fieldset>
<div data-role="header">
<h1><?php echo localize('New directory'); ?></h1>
</div>
<div data-role="content">
<label for="new-directory-name">
<?php echo localize('Name'); ?>:
</label>
<input type="text" id="new-directory-name" name="new-directory-name" />
</div>
<div data-role="footer">
<h4>
<button type="submit" name="submit" value="submit-value"><?php echo localize('Create'); ?></button>
</h4>
</div>
</fieldset>
</form>
</div>
</body>
</html>
OK, problem solved. I deleted PHP closing tag (?>) in one of the included php files and it stopped showing up on dialogs. Also I had to encode all php files from UTF8 to UTF8 without BOM. Otherwise jQuery puts head metatags and title tag inside body element…