My PHP Not Working?

Status
Not open for further replies.

kockinfo

New Member
Messages
2
Reaction score
0
Points
1
I am a novice attempting to run my first PHP Script. This is my web page...
<!DOCTYPE html>
<html>
<body>
<h1>Testing PHP!</h1>
<?php
echo "My first PHP script!";
?>
</body>
</html>

The h1 tag works but the php script does not show up. This is straight from W3Schools tutorial and works in their mini-editor. Is there something basic I haven't done?
 

sebandf2

Member
Messages
35
Reaction score
0
Points
6
what did you name your file?

because if your file name is test.html it wont work it must be test.php or whatever you named it .php
 

kockinfo

New Member
Messages
2
Reaction score
0
Points
1
It was named index.html. Changed it to index.php and all worked! Thanks. It's little things like this that make starting learning a new language/environment frustrating.
 

sebandf2

Member
Messages
35
Reaction score
0
Points
6
No Problem Glad to have been some help to you
 
Last edited:
Status
Not open for further replies.
Top