Hi everyone, I'm a newbie to this board, but I'm trying my best to learn.
I'm setting up a new domain/website to use .php. I used the following instructions given to me:
Converting your HTML flies to PHP
Opened a file in "CoffeeCup" html editor, called 'index.htm'. At the very top of the page, before even the <html> tag add this code:
<?
echo "Testing that PHP is running ok... success!";
?>
Now we have a page ready to test for PHP...lets add the PHP functionality for your HTML pages.
Download this file: (Its in a .zip)
AddType application/x-httpd-php .htm .html
and upload it to the root directory of your website, then rename it to '.htaccess'
This tells your website server to look for any .htm or .html pages and treat them as if they where a .php page... all without even renaming your pages!
Now upload the 'index.htm' page that you added the PHP code to, to your website, and open up your web browser. Type in the name of the uploaded index.htm page, eg; www.mydomain.com/index.htm
If PHP is running properly, you should see the message "Testing that PHP is running ok... success!".
I did all that........
When I tried to open up the index.htm in my browser (Mozilla Firefox 3.5.7) I got the following error message:
Parse error: syntax error, unexpected T_STRING in /home5/user/public_html/mynewdomain/index.html on line 1
here is the top of 'index.htm' page:
<? xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?
echo "Testing that PHP is running ok... success!";
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
In line one, I tried <?php xml version="1.0" encoding="UTF-8"; ?>
I still get the same parse error for line one. Can someone help me please?
Many thanks in advance...
Mike