0
Php basic problem
I am not able to run php code properly. I have xampp server html is working good. But when I run php it displays source code. Please tell me what to do.
4 Answers
+ 1
hmmm, well the browser runs html by himself so u can run it with xampp or without it, but in the other hand php needs a server to run it and here xampp comes, if you opened it as a file (C:\xamp\htdocs\YourFile.php) it's gonna show you the source code, the question is how did u open your file ?
+ 4
Save a copy of the code in SL and share the link in your thread Description. It's hard to tell what the problem is without looking at the code.
Follow this guide in case you didn't know how to share links.
https://www.sololearn.com/post/75089/?ref=app
+ 2
first put your php file into ..xampp/htdocs then run your Apache from xampp console, after that go to your browser and enter your localhost ( localhost/Myphp.php )
+ 1
I had done everything if I change the file name to hello.html then it runs the code but when It is hello.php then it doesn't work show source code.