Skip to main content
Participant
April 25, 2024
Question

code will not work on web site will work in tryit editor

  • April 25, 2024
  • 1 reply
  • 105 views

<!DOCTYPE html>
<html>
<body>

<?php
$today = date("D");
switch($today){
case "Mon":
echo "Today is Monday.PRAY for all of our priest father James father Philips ";
break;
case "Tue":
echo "Today is Tuesday. PRAY ";
break;
case "Wed":
echo "Today is Wednesday. PRAY for family members brother sisters mother father ";
break;
case "Thu":
echo "Today is Thursday. PRAY for the men and women in uniform serving our county. Police officers EMTs, Paramedics, Nurses, Doctors, Fire Fighters ";
break;
case "Fri":
echo "Today is Friday. PRAY ";
break;
case "Sat":
echo "Today is Saturday. PRAY";
break;
case "Sun":
echo "Today is Sunday. PRAY ";
break;
default:
echo "No information available for that day.";
break;
}
?>

</body>
</html>

This topic has been closed for replies.

1 reply

Nancy OShea
Community Expert
Community Expert
April 25, 2024

My local testing server is WAMP server which supports PHP scripts. 

As you can see below, the PHP script executes just fine for me in Live View.

 

 

Did you save the file with a .php file extension?

Does your hosting plan support PHP scripts?

 

To execute PHP code, you have to designate that your file contains PHP code and run it on a PHP supporting server.

 

Hope that helps.

 

Nancy O'Shea— Product User & Community Expert