hi , i just started coding today , and i am stuck with echo ... i ve installed php today itself when i type nd run this code - <html> <head> </head> <body> <p>Static Text</p> <?php echo '<p>This text was generated by PHP!</p>'; ?> </body> </html> PHP: i get output as Static Text This text was generated by PHP! '; ?> why i am getting closing semicolon and tag as output , please guide .... also if i remove <p> tag i got nothing in output thanks
In order to run php pages locally on your pc you must install and configure apache (or something similar) and php. Do a google search to learn more... Another way is to upload your files on a free host and test them there.
PHP does'nt seem enabled or misconfigured. You can use XAMPP for your localhost they supply an auto installer.
XAMPP is a must have for beginner programmers. It also has a link to a phpinfo() page so you see how your PHP is set up. Although out of the box is fine for most folks. If you dont fancy installing XAMPP you can just create a file with the following code in, and it will render a page with all of your PHP.ini files in it. <?php echo phpinfo();?> See how you get on.