This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
View Entire Thread
Re: php script not functioning in html

We can't see your code, and in general it's not helpful to post more than a couple of lines of code here, even if you know how.

Best: a link to the page with the problem.

And of course, PHP code will not work in a .htm or .html file (as a rule). It needs to be in a file with an extension like .php

And of course if it's a Bravenet-hosted site, Pro Hosting is required.

But that's enough guesswork.

Let us know more details -- mainly, the URL of the page with the problem -- and help may be forthcoming.

Re: php script not functioning in html

sorry the code got actually executed. Here's the actual code:

/*
$test1="read me";
?>




*/

Re: php script not functioning in html

The link to my problem page is:

http://codemonkees.bravehost.com/testphp.html

I think I'm subscribing to Pro Hosting cause I can use php in other files.

Re: php script not functioning in html

Are you saying that you have used PHP code in .htm or .html files in that account, and it has worked properly?

Re: php script not functioning in html

Incidentally, I don't think PHP and JavaScript can work together the way you're trying to do.

Here's a reference for some ideas that will work:

http://www.javascriptkit.com/javatutors/externalphp.shtml

Or, just try a Google search for

php javascript

and see what you find out.

Good luck!

Re: php script not functioning in html

I have used php in php files but not mixing php in html. I know it's doable. Is it not possible in Bravenet hosting?

Re: php script not functioning in html

I don't know what you mean by "mixing". The extension has to be .php (or a variant of that, like .php3 or 4 or 5 or something -- not sure of the options, on Bravenet), or else you have to play games with .htaccess, which is probably not advisable.

But .php files are executed on the server, and JavaScript is executed on a web browser, so I don't think what you are trying to do would work. I think there's probably a way of doing it, or something similar, if you check out the reference I posted above.

Re: php script not functioning in html

I copied the example from below. I've done some research, I've seen a lot of other sites giving similar examples.

http://www.webmasterworld.com/php/3462437.htm

Re: php script not functioning in html

OK -- that code should work. You just have to change to .php

Re: php script not functioning in html

It sure does!
Big misunderstanding on my part.

Thanks!