Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Apr 25, 2024 Apr 25, 2024

<!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>

TOPICS
Code
103
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2024 Apr 25, 2024
LATEST

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.

 

image.png

 

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 & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines