Jump to content
Killersites Community
Aleksey

PHP echo doesnt print the result on screen

Recommended Posts

I just started Beginners PHP course, when i use echo to display the result, it shows nothing. When i open beginners course file with forms it doesnt display echo on the screen as well. Can someone help me solve this problem?

Share this post


Link to post
Share on other sites

hello,
I have a similar isue, my code looks like this

<!DOCTYPE html>
<html>
<head>
    <title>first php</title>
</head>
<body>
    <h1>The first php ever</h1>

<form method="POST" action="php-response.php">

            Name: <input type="text" name="name">

            <br>

            Password: <input type="password" name="password">

            <br>

            <input type="submit">
</body>
</html>

 

and my response code

<!DOCTYPE html>
<html>
<head>
    <title>php response</title>
</head>
<body>
<h1>PHP Form Processing</h1>

        <?php

        

        echo "The name entered: " . $_GET["name"];
        echo "<br>The password entered: " . $_GET["password"];

        ?>
</body>
</html>

greetings from Germany.


 

Share this post


Link to post
Share on other sites

Be sure you are running the page through the server and not directly loading the page in your web browser. 

... The PHP code needs to be processed. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×