rakesh.parimkayala Posted June 20, 2009 Share Posted June 20, 2009 Hi Guyz.. M just new to PHP. Learning stage. Been struck up in a big mess :'(. My question sounds silly, but Any help will be appreciated. My Browser is not detecting php code in test.html page. <html> <title> This is a test page </title> <br> This is a code before PHP <?php echo "This is a php code"; ?> <br> this is a code after PHP </html> When I run this page using http://localhost/test.html, it is just displaying the content between HTML tags. But does not showing the code. ??? Now I will tell you what mess did I do. First I have installed easyPhp software. It worked fine n excellent. I could create some sample php code and executed them. Later I got a brilliant idea which drowned me . I wanted to learn how to install old fashion php(installing each of the components individually, downloading the latest verisions of php, apache, mysql from their respective websites). Downloaded, installed them according to the instructions given on learning php by WROX publications. It went fine for the first step. It showed success when i executed http://localhost/ . Showed the index page. Then started a big problem.. When I try to execute a new file ex. http://localhost/test.html or test.php instead opening the content, it started asking me to download and save file!!! really surprised. So thought of reversing the situation I tried to uninstall all the php, apache, mysql from my system and installed easyPhp again. But this time php code is not executing, only html content is displayed. I know formatting the system is the easiest sollution. But want to know the error why it is not displaying the php code only html content is displayed. Please help me!!! Thanks. Rakesh Link to comment https://forums.phpfreaks.com/topic/163022-problem-running-php-code/ Share on other sites More sharing options...
rakesh.parimkayala Posted June 20, 2009 Author Share Posted June 20, 2009 My email address is [snip] please email me if possible. thanks (please do not put your email address in your posts -- moderator. Post here, get answers here) Link to comment https://forums.phpfreaks.com/topic/163022-problem-running-php-code/#findComment-860159 Share on other sites More sharing options...
kenrbnsn Posted June 20, 2009 Share Posted June 20, 2009 In order for PHP to be processed, the file should be named .php (there are ways around this, but they are more advanced). Rename your file to test.php and invoke it with http://localhost/test.php Ken Link to comment https://forums.phpfreaks.com/topic/163022-problem-running-php-code/#findComment-860172 Share on other sites More sharing options...
rakesh.parimkayala Posted June 20, 2009 Author Share Posted June 20, 2009 Hi champ. It worked.. My doubt is: then why didnt it work if i save it as html file? before it asked me to download and save the file!!! but now it is not asking if run it with .php extension!! can you please explain..Thanks!!! Link to comment https://forums.phpfreaks.com/topic/163022-problem-running-php-code/#findComment-860217 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.