+ 4

Why its not working??

<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <script language="php"> <?php echo "hello world"; ?> </script> </body> </html>

6th Apr 2017, 3:57 PM
suraj pandey
suraj pandey - avatar
8 Answers
+ 7
PHP must be execute from a server and not your web browser. Additionaly <script> is not make to declare PHP, you have to remove them.
6th Apr 2017, 4:00 PM
Geoffrey L
Geoffrey L - avatar
+ 3
@geoffrey so this will not work in playground in web section?
6th Apr 2017, 4:06 PM
suraj pandey
suraj pandey - avatar
+ 3
no only under php not web. php is server side so if your page isnt php it wont execute the code. There's nothing wrong with your code
6th Apr 2017, 4:13 PM
Andre van Rensburg
Andre van Rensburg - avatar
+ 2
It wouldn't​ work on Playground. Setup XAMPP or WAMP
6th Apr 2017, 4:12 PM
Eranga
Eranga - avatar
+ 2
OK thnx guys ...
6th Apr 2017, 4:21 PM
suraj pandey
suraj pandey - avatar
+ 1
it's php error.. so run this code on server
6th Apr 2017, 4:33 PM
Pratul Tripathi
Pratul Tripathi - avatar
+ 1
sheet :(
6th Apr 2017, 10:06 PM
afgprogrammer
afgprogrammer - avatar
0
PHP must be execute from a server and not your web browser. Additionaly <script> is not make to declare PHP, you have to remove them.
6th Apr 2017, 7:16 PM
Ankit Yadav
Ankit Yadav - avatar