Jump to content

PHP not parsing


jalpro

Recommended Posts

Hey guys!

New to Heliohost.

 

This is the code that won't parse:

<div id="newscontent" class="flexcroll"> 
<?php include("php/indexnews.php");?>
</div>

 

The same code is used on my old host, which, when viewing the source, would be replaced by the html in the indexnews.php file. But instead all I see is the original code.

 

The php runs fine, because I can open the file using the browser address bar and it returns the data correctly.

 

Help!

Thanks :)

Link to comment
Share on other sites

Any pages using php need to have a .php extension. So the easiest solution would be to rename your page to index.php. If that's a problem for you and you have many pages on your site using php with a .html extension, you could add this piece of code to your root .htaccess file:

 

AddHandler application/x-httpd-php5 .html

 

Now all of your files ending in .html will be parsed for php.

 

Link to comment
Share on other sites

Thanks! That worked! :)

 

For anyone who is reading this post having the same problem, this is what my "/public_html/.htaccess" file looks like now:

 

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName jalpro.heliohost.org
AuthUserFile /home1/jalpro/public_html/_vti_pvt/service.pwd
AuthGroupFile /home1/jalpro/public_html/_vti_pvt/service.grp

AddHandler application/x-httpd-php5 .html

 

Thanks :)

Link to comment
Share on other sites

It's really not that big of a deal. I'm sure your other site was set up the same way if html pages were parsing php. All it means is that all of your html pages will be parsed for php wether they use php or not. You'll probably never notice the difference.

 

Link to comment
Share on other sites

  • 2 weeks later...
It's really not that big of a deal. I'm sure your other site was set up the same way if html pages were parsing php. All it means is that all of your html pages will be parsed for php wether they use php or not. You'll probably never notice the difference.

Very true!

My longest PHP files are only around 20-40 lines long, which I very much doubt are going to take very long to parse.

(Are comments ignored by the parser?)

Besides, my last host was really slow, so Heliohost is a big improvement nevertheless!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...