June 7, 2013

How to execute a simple PHP Code?

Max’s Question:

This basic statement doesn’t work when i execute on my browser.

<?php echo "Helloworld"; ?>

I saved this statement in a file index.php and used a browser to execute. What mistake might be going through? I am new to php and please help me through it. Thanks in advance.

EDIT

Apart from syntax please tell me why this isn’t working when i save it in a .php file and open in a browser this doesn’t show anything?

PHP start tag, should be <?php and end tag should be ?> without any SPACES.

If even after removing the spaces the PHP is not working. You have to make your you can execute your PHP script from a server with application capable to executing it. Like Apahce, IIS. You can find thise application bundled with following stacks: LAMP, XAMPP, WAMP, MAMP, .IIS

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!