There are two files. The first

<!DOCTYPE HTML> <HTML> <HEAD> <meta charset="utf-8"> <style> .bottom_block { background-color: white; <!--border: 1px black solid;--> border-radius: 10px 10px 10px 10px; width: 20vw; height: 20vh; margin-left: 39.5vw; margin-top: 2px; } </style> </HEAD> <div class="bottom_block"> <FORM method="post" action="admin_authentication.php"> <div style="width: 90%; height: 15%; margin-left: 20%; margin-top: 5%"> <input type="text" style="width: 70%; height: 77%" placeholder="Username" name="admin_username" required> </div> <div style="width: 90%; height: 15%; margin-left: 20%; margin-top: 5%"> <input type="password" style="width: 70%; height: 77%;" placeholder="Password" name="admin_password" required> <br><br> <input type="submit" name='admin_send' style="width: 40%; height: 100%" value="Submit"> </div> </FORM> </div> </HTML> 

And the second admin_authentication.php

 <?php echo $_POST['admin_username']; echo "Yes"; ?> 

when this code works through "idle" (i.e. installed on the computer) apache, it issues both $_POST['admin_username'] and the word Yes . But when I launch it from PhpStorm, it issues only Yes from what it can be ???

  • First, you need to bring the markup to a valid state. 99% that after that the problem will disappear. - Dmitriy Simushev
  • sorry and what a valid state ??? - Samvel
  • In other words, you need to align your markup with the HTML standard. And here's a tool to help you validator.w3.org/#validate_by_input - Dmitriy Simushev
  • Start with the missing body tag;) - Dmitriy Simushev
  • Excuse me, is this a question? why, when running code not in PhpStorm, does it work and sees admin_username and admin_password ? - Samvel

1 answer 1

Here is the answer to my question. After a long search in the internet found.

Because your default is to create two development environments, one is your LAMP (mysite.com), the other is PHPStorm itself (localhost: port / projectfolder /). If you want to get rid of this, specify the correct domain name in the project settings. With the finished project is done like this:

Opened the project

1) File-> New project from existing files

2) Next, select the project folder

3) Then we specify the domain name

A source

  • one
    Although the link can find the answer to the question, it is better to point out the most important thing here, and give the link as a source. If the page to which the link leads will be changed, the response link may become invalid. - From the queue of checks - MihailPw
  • totally agree with you - Samvel


Source: https://ru.stackoverflow.com/questions/677252/


All Articles