Questions about html and php
(Since I don't know about html and php, I can't fully understand it, but I will do my best)
We are creating a service that can be used by opening an html file in a browser without using a web server.
I am coding for the face-up display displayed in the browser in htmlTest.html.
In htmlTest.html, create a form button, specify phpTest.php for action, and use the submit button to pass the value entered in the form input field to phpTest.php for processing.
(specifically
Create input fields and submit button in htmlTest.hrml
Processing to receive the number entered in the input field in phpTest.php and return the calculated result
)
But if you open htmlTest.html on your browser,
Both the input field and the send button are displayed.
When you press the send button, all the code written in phpTest.php is displayed on the browser as it is.
I have investigated a lot,
What about web server, how about localhost, how about ESET, how about XAMPP, etc.
There was nothing that fits my situation. (It may be just not found)
By the way, I'm trying to use it by opening the file in the browser, so
The URL when opened in a browser is
file: /// ~.
I'd like you to tell me anything that seems obvious.
-
Answer # 1
-
Answer # 2
Look for past questions. A question that has been posted many times.
In the first place, since php is a server side language, it will not work unless it is executed on the web server.
In other words, it does not execute directly in a file like file: // ~, but it must be placed on a Web server and accessed in the form of http: // ~.
XAMPP is an easy way to build a web server on a Windows PC.
By the way, "MAMP" is more appropriate for MacOS.
It is better to read the commentary. First, from "Hello World" in php* In other words, it's impossible to use "without a web server"
Related articles
- php - png image is not displayed
- php - list is displayed by select, but insert is not possible
- php - "display option" is not displayed in the post list on the wordpress administration screen
- php - some web pages are displayed normally, and some pages have sidebars and image files not loaded
- i want to get the name of the laravel php zip file
- the tag of html is displayed as a string
- c # long code breaks in the middle
- java - what the junit code is doing
- i want to pass the php path
- call any php file in the sidebar with a shortcode
- php - all items are displayed in the monthly list of custom post types
- php - i want to pass the image file to the server
- php - i want to be able to use the validate function
- php - the refined search checkbox is not displayed
- php - if you make it smartphone size, the text will be displayed above the footer
- i want you to see the error contents of php
- php - [wp] an error is displayed in the item part added to the user information in advanced custom field
- php - what is the significance of array_key_exists?
- vscode php% is displayed without permission
- php - i want the link to open in chrome
- Cannot specify the link destination with an absolute path in PHP
- php : Remove duplicate pages
- php : Why is a picture of another news sent when sharing from a website to Facebook?
- javascript : Refreshing the HTML page
- php : How to display product category thumbnail in wordpress woocommerce?
- php : Woocommerce. How can I change the html markup of the checkout fields on the checkout page?
- How to correctly form a checkbox into a database array (Checkbox + Php + mysql)
- javascript : How to connect a custom registration form to the database?
- php : JSON message encoding
- PHP Server error: "The requested resource /was not found on this server."
To display in a browser, you need to start a server that runs PHP and place PHP there.
"What about XAMPP" is when you are using a local server environment.