Jump to content
Stef's Coding 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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...