<!DOCTYPE html>
<html lang="en">
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<p>
<?php
echo “This is a PHP line”?>;``
phpinfo();
?>
</body></html>

am newbie please help me.

Recommended Answers

All 19 Replies

i mean am using web matrix to program my first php page.thanks for your effort in advance to assist me.

how do i echo.i think i have the echo command already or there is something else.please assist.like i said am jus new to the language.just picked it up today.

See above. Make sure you use the right quotes. Unless what you pasted yourself is not what you actually have.

am now getting an error page.which says error 500.0.internal server error wheni run it from my web matrix.but when i run it from the folder(i mean the file in the folder) it still displays the html output not the php output.could it be my web matrix is not working right or not properly configured.please assist me Sir.

Member Avatar for Ralphael

What file extension did you save it as

i saved as .php.

Member Avatar for Ralphael

as pritaeas said change line 10, and check if u have configure your server correctly for php

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title>PHP Test</title>
    </head>
    <body>
    <p>This is an HTML line</p>
    <p>
    <?php echo 'This is a PHP line';
    echo phpinfo(); ?>
    </p>
    </body></html>

corrected code
doctype html5 must close or selfclose all elements
php left out a little echo

would suggest getting a code-highlight editor, these errors show up in colour changes in the code, making it easier to spot

am using aptana code editor.i have now installed wampp and unistalled xampp but it is not displaying that of the php output.it keeps printing "this is an HTML file" the suppose php.amd it only displays when i click on the file in the www root folder.when i type localhost/filrname.php.it displays an internal error message.HTTP Error 404. The requested resource is not found..please what may be causing the problem.i have been the whole day trying to get this fixed.

then perhaps a different code editor than aptana, if the errors are not being highlighted, its no use

have you corrected the code as noted
do you access the file through the local wamp server localhost, not by clicking the file, sometimes it is the silly things

when i type localhost/filrname.php.it displays an internal error message.HTTP Error 404

Probably indicates a configration problem with WAMP as it seems to not be finding the page/file. Did you configure Apache to run on port 80? Does your machine also run an IIS or other service that could be conflicting with apache?

When you open the file (even in a browser) directly from the filesystem - ie: by double clicking the file in windows explorer - it isn't being run through apache or the php engine and the php code wont be processed. A browser will simply parse it as text/html.

beafore running your file did you atrat apche serverand did you place your file in htdocs folder.and you are running correct file or not copy the file name from folder and paste it with localhost/ and try and check your php.ini file and turn on the display_error property.

don't have htdocs folder in the wampp folder.what i have is the www folder.how do i

atrat apche server.
now wamp is online.skype is disabled.yet still it is not running
.

i have now installed easy php which is working for me now.the php code are displaying.thanks for the effort every body used to assist me.but one mor thing.

my sql is not working.which should work through phpmyadmin folder.any help.cos i think that's what willl assit me connect mysql.

Do you actually have a mysql server installed and running? This is a separate component from php, it is included in WAMP but if you are no longer running that you may have to install a mysql server manually.

i have sql running.i have appache and mysql running.but when i hit easyphp adminstration console and click phpmyadmin to access the database it pops up this error instead of the sql control panel.
Error

MySQL said: Documentation

1045 - Access denied for user 'root'@'localhost' (using password: NO)

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
i was not asked for any username and password when installing easyphp as well.what username and pass is it referring to.

find the config files for the mysql server installed, or the helpscreens, and see what the default install says about passwords

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.