Getting started with Php

robray

New Member
Messages
11
Reaction score
0
Points
0
hi,

I had read on the Site (under Php help) that all accounts are now on 'Intermediate level' of php.

However, when i put the following lines of code into a html file.. i get the results shown beneath the code snippet.

code snippet:
1<br>
<?php echo( "<h1>Php is alive and kicking!</h1>" ); ?>
2<br>
<?PHP echo "hello"; ?>
3<br>
<pre>

Results in:
1
Php is alive and kicking!" ); ?> 2
3

This is exactly the same response when i open this file off the file system from my Firefox browser. My conculsion is that php is not running for my account.

So my question is: How do i turn it on ?

Thanks for your help... :)

have a nice day

Robray.
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
PHP:
1<br>
<?php echo  "<h1>Php is alive and kicking!</h1>"; ?>
2<br>
<?PHP echo "hello"; ?>
3<br>
<pre>
also, when posting code, use the appropriate code tags.
[ QUOTE ] [ /QUOTE ]
[ CODE ] [ /CODE ]
[ HTML ] [ /HTML ]
[ PHP ] [ /PHP ]
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
A. PHP is "on" for every hosting account
B. When put into atestpage.php and requested from the web, it shows

1

Php is alive and kicking!

2
hello3

for me.

C. If you put it in ashtml.html, you just get the numbers
D. Perhaps you corrected a mistake in your original when you posted it here.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
However, when i put the following lines of code into a html file..
That's the problem right there. Only files with a .php extension are processed by PHP. It's an unnecessary drain on server resources to have all html files processed by PHP.

If you're worried about ".php" extensions in URLs, turn on MultiViews with Options +MultiViews in your root .htaccess and leave extensions completely out of URLs.

My conculsion is that php is not running for my account.
You're jumping to conclusions.
 
Top