Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am new to developing an website i've create a php page which prints hello world. I have used iframe tag to link that html file. But whenever browser redirect to that php file the browser ask to download that file rather than displaying hello world can any one tell me whats going wrong here. My code is as follows:

<html>
<body>

<iframe src="hello.php"></iframe>
Script executed
</body>
</html> 

I know its very silly question but i searched on so many website didn't got any clue. Thanks in advance

share|improve this question
4  
your server isn't set up to parse php then... –  Orangepill May 30 at 15:22
 
i just used google drive to upload files just because it allows you to host your website so i tried that one do i need to use domain or file hosting server?? –  Vighanesh Gursale May 30 at 15:26
 
you need a hosting platform with php installed, otherwise the php files are just plain old text and wont get interpreted. Try it locally by installing WAMP wampserver.com/en –  Waygood May 30 at 15:28

1 Answer

First you should set up a server , only then can you execute your php scripts . If you're using windows , then use WAMP , else if you're using linux , do sudo apt-get install lamp-server^ on the terminal .. In case of windows , copy paste your files to C:\wamp\www (path may differ general format - Path\to\wamp\www ) . And in case of linux copy/paste them into /var/www

share|improve this answer
 
Ya I executed,the php on wamp n but I don't have any experience of hosting a website, ok I'll try with free hosting website thanx for everyone for helping –  Vighanesh Gursale May 30 at 16:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.