php inside html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Jef Patat
Forum Newbie
Posts: 8
Joined: Tue Oct 03, 2006 1:59 pm

php inside html

Post by Jef Patat »

Hi all,

lately i moved hosting, but now for some reason php inside html is not processed anymore
I searched all over the net and tried various .htaccess configurations but none of them worked

Can it be something else?

kind regards, Jef
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

first off... is php installed?

second... are you using short tags (ie: <? and ?>)
Jef Patat
Forum Newbie
Posts: 8
Joined: Tue Oct 03, 2006 1:59 pm

Post by Jef Patat »

The Ninja Space Goat wrote:first off... is php installed?
Yes it is, if I rename the index.html file to index.php everything works correctly
But that would mean I have to rename every page and update all links.
I extremely prefer not to do that.
The Ninja Space Goat wrote:second... are you using short tags (ie: <? and ?>)
Yes, this is an excerpt out of the document:

Code: Select all

<div class="interface-02"> 
<?php
	if ($stylesheet == "visualstyle3"){ 
    	echo '			   <img src="http://www.jefspalace.be/images/logo.gif" alt="Jefs Palace Logo" height="80" width="80" />	';
	} 
?>			
		</div>
the site is jefspalace.be
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Yes it is, if I rename the index.html file to index.php everything works correctly
The .html is not associated with the php module.
Do you have access to the webserver's configuration? What kind of webserver is it?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

those aren't short tags. <?php is long and <? is short.

post your htaccess file
Jef Patat
Forum Newbie
Posts: 8
Joined: Tue Oct 03, 2006 1:59 pm

Post by Jef Patat »

volka wrote:
Yes it is, if I rename the index.html file to index.php everything works correctly
The .html is not associated with the php module.
Do you have access to the webserver's configuration? What kind of webserver is it?
correct, but it at least proves that php is working

It is a paid server, I'm just an amature programmer eager to learn

the .htaccess file used to just include

Code: Select all

AddType application/x-httpd-php .php .htm .html
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

is it a windows server?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Jef Patat wrote:the .htaccess file used to just include

Code: Select all

AddType application/x-httpd-php .php .htm .html
used? past tense? Or is this .htaccess still there? And is it still an apache webserver?

Maybe you do not have the proper permissons to change values in .htaccess. But that usually leads to a fatal error. see http://httpd.apache.org/docs/2.0/mod/co ... owoverride
And the name of the file apache is looking for might have been changed as well, see http://httpd.apache.org/docs/2.0/mod/co ... ssfilename
Jef Patat
Forum Newbie
Posts: 8
Joined: Tue Oct 03, 2006 1:59 pm

Post by Jef Patat »

It is still an apache server, i'm using www. one. com
Apache 1.3.31 with security patches from 1.3.33
I can choose to use php 5.1.5 configuration at http://www. testdomainet. com/info.php
or 4.4.4 configuration at http://www. testdomainet. dk/info.php

indeed used to be as in: for the moment there is no .htaccess file since it does not make any difference

they do support .htaccess, i'm quite sure of that

thanks for the quick responses
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Jef Patat wrote:indeed used to be as in: for the moment there is no .htaccess file since it does not make any difference
:?:

Ask your provider if and how you can link .html files to the php module.
Jef Patat
Forum Newbie
Posts: 8
Joined: Tue Oct 03, 2006 1:59 pm

Post by Jef Patat »

Hello again,
volka wrote:
Jef Patat wrote:indeed used to be as in: for the moment there is no .htaccess file since it does not make any difference
:?:

Ask your provider if and how you can link .html files to the php module.
I did, they have online help, and this is result
Please wait for a site operator to respond.
You are now chatting with 'lee'
lee: Thank you for using One.com 24/7 Interactive Online Support. My name is Lee. How may I assist you?
you: how can I link .html files to the php module
you: ?
you: sorry, hello
lee: Hi there
lee: Please hold on for a moment
you: ok
lee: I do not have information on this
lee: You can check google for more information.
you: lolz
you: google is not hosting my site
lee: What exactly are you looking for?
you: I have inline php in a html file
you: the php engine cannot know to interprete the html
you: so most often you tell it by using the .htaccess file
you: but not on yours
you: take a look at the result at jefspalace.be
you: quite <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> up
lee: Unfortunately I cannot assist you on this as we do not offer technical assistance on scripts and programming.
you: this is not programming
you: this is supporting
you: the code is correct otherwise it wouldn't have worked on the previous host
lee: Are you using includes?
you: amongst others yes
lee: I am sorry i have no information regarding this
lee: Please send an email regarding this to support@one.com
you: ok
lee: Will there be anything else I can help you with?
you: you mean can not help me with :p
you: no thanks
lee: ser
lee: You are welcome.
lee: Please feel free to contact us again for any further assistance. Good Bye and have a nice time.
So I will send them an email and keep you guys updated

however I do not see what can be the issue for a hosting company that claims 250,000 customers in 149 countries.

Am I the only one trying this?
Z3RO21
Forum Contributor
Posts: 130
Joined: Thu Aug 17, 2006 8:59 am

Post by Z3RO21 »

key word claims, I see it all the time people putting false info up to boost amount of customers they get.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

your host sucks @ss get a new one... that's terrible support
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post by akimm »

Guys, just to make sure he does indeed have php, why not try a phpinfo

Code: Select all

<?php
phpinfo();
?>
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

because of
Jef Patat wrote:
The Ninja Space Goat wrote:first off... is php installed?
Yes it is, if I rename the index.html file to index.php everything works correctly
;)
Post Reply