Client access on an Earthlink-hosted server - HTM with PHP

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
scscompa
Forum Newbie
Posts: 2
Joined: Fri Dec 21, 2007 7:22 pm

Client access on an Earthlink-hosted server - HTM with PHP

Post by scscompa »

Sorry, if this entry is in the incorrect spot.

Anyway -

I have an Earthlink-hosted dot-com that I support -- via the Earthlink-provided "Control Center" and ftp.
I do not have direct access to the server.

I know nearly-zero of PHP, but have a need to install/use an application that is PHP-based.

Earthllink does not have the latest PHP for me -- they provide me with 5.0.something -- and, the application
requires 5.1 at least.... so, I have to wait until Earthlink is updated in that regard. However, that is not
the base for this query. I, just, mention this in case the answer is: Wait for 5.1 PHP before doing anything...

In my testing, I have VERY simple PHP (just prints the date when called by Firefox on my client system)
that, when I put the PHP code within an HTM file: No luck, as tried-to-describe, below:

1. Earthlink required me to place a dot-htaccess file in my directory. OK, That provided me access to PHP.
2. I searched the Web and found where it was pointed out that I had to add something to the htaccess
file to provide for HTP within HTM files. I did that.
3. When I access the simple-test of PHP within and HTP file, Firefox and IE both imply that I want to download
the code rather than the code being interpreted.

If this makes sense: Thanks for any comeback/comment!

Regards,
Dave Shogren
User avatar
Inkyskin
Forum Contributor
Posts: 282
Joined: Mon Nov 19, 2007 10:15 am
Location: UK

Post by Inkyskin »

I may have read this wrong, but are you saving your php files as myfile.htm? If so - thats wrong. Try saving them as myfile.php.

If you want a .htm file to behave as a .php file would, try adding this in your .htaccess file, and place it in your main directory:

Code: Select all

<IfModule mod_suphp.c>
AddHandler application/x-httpd-php5 .php .php5 .htm
</IfModule>
scscompa
Forum Newbie
Posts: 2
Joined: Fri Dec 21, 2007 7:22 pm

Your comeback hint about dothtaccess

Post by scscompa »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Thanks for taking the time to get back to me.

I did some further testing as per your note --- and, I think I had better leave things alone (stay "out of" php
and htm trying to co-exist within the same file).

I don't want to waste your/other's time.  Someday, "it" will work, I am sure.  For now, I just assume that the
package that I need is not mixing php-stuff within htm files and not worry about doing so.  

For your info, I wanted to test this:

-------------------

Code: Select all

<html>

<head>
<title>Example #1 PHP Script</title>
</head>
<?php
/*
This is a demo script.
All it does is output Hello Web! in your browser.
*/
print ?Hello Web!?; //outputs a message 
//is this a comment?
?>

<body>
</body>
</html>
------------------
I actually another version of the above (again, getting the php stuff off the Web), replacing the above php stuff with:

<? print(Date("1 F d, Y")); ?>

-------------------

Neither of the above work when in an htm file, but work when in a "php" file, with either the original dotaccess file that I was told to use, by Earthlink's Tech Support:

AddHandler php5-script .php
---
or when I tried to use yours, in conjunction with the above (added as a line below the above, or on its own).

Again: Thanks for your help -- and, I will stop testing the mix-of-the-two and start working with "just" php files/etc.

Since the application that I need requires PHP 5.1 or later, and Earthlink is at 5.0.something, I am at Earthlink's mercy as to when I can install the application, anyway.

Perhaps I try php on one of my GoDaddy accounts.... maybe they are at PHP 5.1
I did not think about testing there, until just now.

Thanks, again - Sorry, to waste your time.

Bye.

Regards,
Dave Shogren


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Welcome to the forums scscompa. Secondly, any inquiry you make here is absolutely not wasting anybodies time since others may also benefit from the experience.

Now, to your problem. From what I've gathered thus far you it is simply a matter of renaming your files with the .php extension. From the example script you posted there is an error also,

Code: Select all

print ?Hello Web!?; //outputs a message

Code: Select all

print "Hello Web!"; //outputs a message
however I think this is irrelevant since you replaced this with something else (just thought I'd point it out in case you were wondering what was causing the error).

Regarding your host, it is strongly recommended you upgrade to at least 5.1.2, I believe GoDaddy offers this version.
Post Reply