using php integrated into my html script

Status
Not open for further replies.

askjames.lmx31

New Member
Messages
3
Reaction score
0
Points
0
at my www i have an HTML file called index.html which is the only file so far i have uploaded. I put a basic bit of php script into it (using <?php ?>) and it will not run it? it is a simple echo hello world, and the browser picks up other parts of the page? if you go to the site ( http://fbacs.x10.mx ) it reveals why; right click view source, and it shows that the php script insertion has been miss-interpreted as a comment? but i didn't actually put <!--? i put <? ???? whats going on here? do i have to install php? how do i get it to run php scripts?
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
Hello,

Unless a file has a php extension the server does not parse the code. You need to remodel the script so that it's a php file with html, rather than the other way around.

Thanks.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Minor correction, rename it to index.php, problem should be solved. You can embed php into an html page that way, but it has to be a .php extension for the server to parse it as php.

The PHP parser will leave everything NOT between <?php ?> tags alone; everything between them will be processed as php :)
 
Status
Not open for further replies.
Top