First off you cant use HTML tags before your html tag. Ie. you would have to echo the script tags inside the html tag, and more preferably inside the head.
Also it is bad practice to use single quotes (') for html attributes. double quotes (") are prefered as the standard.
Try this:
<html>
<head>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.3.2.min.js"></script>
<script type="text/javascript" src="js/alertify/js/alertify.min.js"></script>
<script type="text/javascript">
function page_add_success(msg) {
alertify.success(msg);
}
</script>
<?php
if(Cookie::Exists('page-main-login-cookie')) {
echo "<script type=\"text/javascript\">page_add_success('OK');</script>";
}
?>
</head>
....
You could always use the jQuery.cookie (http://plugins.jquery.com/cookie/) plugin to read the cookie in javascript on pageload avoiding useing php at all.
<html>
<head>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.3.2.min.js"></script>
<script type="text/javascript" src="js/alertify/js/alertify.min.js"></script>
<script type="text/javascript" src="/path/to/jquery.cookie.js"></script>
<script type="text/javascript">
function page_add_success(msg) {
alertify.success(msg);
}
$(document).ready(
function() {
if($.cookie('page-main-login-cookie')) {
page_add_success('OK');
}
}
);
</script>
</head>
....