Submit a question to our community and get an answer from real people.
Submit

My program consists of both html and php code. How can i run the file such that both code should be worked correctly.pls help me. Thank you.

How to run php and html code together in a single file.

Report as

To execute PHP on a .html page, you have to modify your .htaccess file. Adding a .php extension might also help your program when being accessed by the server. Check out some tips on php.about.com/od/advancedphp/p/html_php.htm, and talk to a web developer for professional advice.

Helpful (1) Fun Thanks for voting Comments (1)
Report as
Thank you for your response. I just tried in that way but i unable to find the .htaccess file in my laptop. I'm using windows 8. Can you tell me where do i find .htaccess file?
Report as
Add a comment...

That's what php is good for. You make a simple file, give it a .php extension, and make sure it is sent correctly from the server:

<?PHP
echo "This is a good file";
?>

Anything not marked as PHP is sent without change, whether it is HTML, XML, or plain text.

Helpful (1) Fun Thanks for voting Comments (0)
Report as
Add a comment...
Do you have an answer?
Answer this question...
Did you mean?
Login or Join the Community to answer
Popular Searches