Close Menu
    Facebook X (Twitter) Instagram
    Oixiesoft
    • Home
    • Services
      • WordPress Malware Removal
      • Fix WordPress Errors
      • WordPress Website Development
    • Articles
    • Contact
    Oixiesoft
    Home»Tutorial»PHP»PHP Forms Tutorial
    PHP

    PHP Forms Tutorial

    Editorial StaffBy Editorial StaffUpdated:May 2, 2022No Comments1 Min Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    PHP – A Simple HTML Form

    The PHP $_GET and $_POST variables are used to retrieve data from forms, like user information.
    PHP Form Handling

    The most significant thing to see when dealing with HTML forms and PHP is that any form element in an HTML page will automatically be available to your PHP scripts.

    Example

    The example down contains an HTML form with two or more input fields and a submit button:

    <html>
    <body>
    <form action="test.php" method="post">
    Name: <input type="text" name="name">
    Phone: <input type="text" name="phone">
    <input type="submit">
    </form>
    
    </body>
    </html>
    

    When the user fills all the form input fields above and submits the form. After that, the form information is sent to a PHP file, called “test.php“. The form information is transmitted with the HTTP POST method.

    “test.php” file looks like this and saves your system:

    <html>
    <body>
    
    Welcome <?php echo $_POST["name"]; ?><br>
    Your phone no is: <?php echo $_POST["phone"]; ?>
    
    </body>
    </html>
    

    Output

    Welcome Carrillo
    Your phone no is:6579884897
    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Editorial Staff

    Related Posts

    CodeIgniter vs Laravel: A Detailed Side-by-Side Comparison

    Python Arrays

    Python Lambda

    PHP
    • PHP Comments
    • PHP if else Statements
    • The PHP switch Statement
    • PHP Functions
    • PHP for Loop
    • PHP Arrays
    • PHP Include Files
    • PHP Date() and Time() Function
    • PHP Forms Tutorial
    Services
    • Web Development
    • Mobile Application Development
    • WordPress Malware Removal Service
    • Website Design
    • WordPress Development
    • Magento Development
    • Shopify Development
    • SEO Services
    Blog
    • How to Fix the Error Establishing a Database Connection
    • Ping List WordPress
    • How To Fix Japanese Keyword Hack
    • How to remove Malware from WordPress
    Hire Developers
    • Hire WordPress Developer
    • Hire Shopify Developer
    Contact Info
    • Oixiesoft Technologies
      A-40, Block A, I thum Tower, Sector 62, Noida
    • sales@oixiesoft.com
    • Privacy Policy
    • About Us
    • Contact Us
    © 2025 OixieSoft Technologies

    Type above and press Enter to search. Press Esc to cancel.