I'm currently using a small input form with a javascript calendar (jquery datepicker).
However I would like to have this page restricted to users who have logged into my application.
So what I've tried to do is resave the page from form.html to form.php and added the checkLogin function to check what user rank they are. However its giving me a:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/grads/public_html/computing_project/login2/extra/booking.php:1) in form.php on line 1
So I guess I should assume javascript and php won't work on the same page? Is there a way around this?
Code: Select all
<?php session_start(); checkLogin('1'); ?>
<head>
<title>Form</title>
<!-- Main stylesheet -->
<script type="text/javascript" src="extra/javascripts/jquery.js"></script>
<script type="text/javascript" src="extra/javascripts/jquery.form.js"></script>
<script type="text/javascript" src="extra/javascripts/jquery.ui.js"></script>
<script type="text/javascript">
// wait for the DOM to be loaded
$(document).ready(function() {
// bind form using ajaxForm
$('#myForm').ajaxForm({
// target identifies the element(s) to update with the server response
target: '#form_results',
// success identifies the function to invoke when the server response
// has been received; here we apply a fade-in effect to the new content
success: function() {
$('#form_results').fadeIn('slow');
}
});
$(function(){
// Datepicker
$('#datepicker').datepicker({
inline: true
});
//hover states on the static widgets
$('#dialog_link, ul#icons li').hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
});
});
</script>
</head>
<body>