How to Run PHP Code?

Asked by David Williams

This is going to seem really simple and silly of me but I am really struggling to get this code running on my Xibo setup :(

<meta http-equiv="refresh" content="600">
<?php
date_default_timezone_set('Europe/London');
echo('<div align="center"><b><U>');
/*
print(Date("l"));
echo('<br/>');
print(Date("F d, Y"));
echo('<br/>');
echo('<br/>');
*/
$hour=Date("G");
$minute=Date("i");

if (($hour < "8") || ($hour == "8" && $minute <= "40"))
{
echo("Before School");
}
if (($hour == "8" && $minute > "40"))
{
echo("Registration");
}
if (($hour == "9"))
{
echo("Period 1");
}
if (($hour == 10))
{
echo("Period 2");
}
if ($hour == 11 && $minute < 20)
{
echo("Morning Break");
}
if (($hour == 11 && $minute > 20) || ($hour == 12 && $minute < 20))
{
echo("Period 3");
}
if (($hour == 12 && $minute > 20))
{
echo("Lunch");
}
if (($hour == 13))
{
echo("Period 4");
}
if (($hour == 14))
{
echo("Period 5");
}
if (($hour == 15) || ($hour > 15))
{
echo("After School");
}

echo('</U></b></div>');
?>

This is the script as I have found it.. but I would really like to get it running on our Xibo setup :)

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Xibo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Alex Harrington (alexharrington) said :
#1

You'd have to put the php in a script on a webserver somewhere and add it
to your layout as a webpage media. You can't embed PHP inside Xibo itself.

Alex

Can you help with this problem?

Provide an answer of your own, or ask David Williams for more information if necessary.

To post a message you must log in.