Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8241529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:51:44+00:00 2026-06-07T20:51:44+00:00

I have 2 form in one HTML page. One form posts to a database

  • 0

I have 2 form in one HTML page. One form posts to a database and the other form sends an email with the details in the form. It is quite simple when I think of it, but tried for long without success.

HTML:

    <ul class="slides">
        <li>
            <div id="contactFormContainer" class="container">
                <div class="left">
                    <h1 class="uppercase">do you  have project inquiry??</h1>

                    <form id="contactForm" method="POST" name="contactForm" action="">
                        <fieldset>
                            <p> 
                                <label for="fullname">Fullname</label> 
                                <input name="fullname" id="fullname" type="text">
                            </p>
                            <p> 
                                <label for="email">Email</label> 
                                <input name="email" id="contact_email" type="text">
                            </p>
                            <p> 
                                <label for="fullname">Subject</label> 
                                <input name="fullname" id="fullname" type="text">
                            </p>
                            <p> 
                                <label for="fullname">Project Description</label> 
                                <textarea name="message" id="message" rows="2" cols="20"></textarea>
                            </p>
                            <p> 
                                <input class="btn" id="contactSubmit" type="submit" value="Submit">
                            </p>
                        </fieldset>
                    </form>     
                </div> <!-- end left -->

                <div class="right">
                    <span class="head">Twitter Feeds</span>
                    <div class="twitter">
                        <!-- twitter feed will be generated -->
                    </div>
                </div> <!-- end right -->
            </div> <!-- end contact form container -->
        </li>

        <li>
            <div class="head container">
                <h2>coming soon...</h2>
            </div>

            <div class="body container">
                <h1 class="uppercase">Subash.com is coming with new face.</h1>
                Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Donec id elit non mi porta gravida at eget metus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Cum sociis natoque penatibus et magnis dis parturient.
            </div>

            <div class="footer container">
                <p class="signup"><span class="cursive">sign up</span> ..be the first to be notified</p>

                <div class="inputbox">
                    <form accept-charset="UTF-8" action="" name="subscribeForm" id="subscribeForm" method="post">

                        <input class="email_field" id="email" name="email" placeholder="Type your email address..." type="email">
                        <input class="submit_button" type="submit">

                    </form>  
                    <div class="status">
                        <?php 
                            if(isset($status)){
                                echo '<p>' . $status . '</p>';
                            } else {
                                echo '<p class="spam">We will never spam you.</p>';
                            }
                        ?>
                    </div>
                 </div>
            </div>
        </li>
    </ul>

PHP

    <?php
require_once('includes/db.php');
require_once('includes/functions.php');
require_once('includes/validate.php');

if($_SERVER['REQUEST_METHOD'] == 'POST'){
// subscribe form
$email = trim($_POST['email']);

if(empty($email) || !valid_email($email)){
    $status = 'Please provide valid email address.';
} else {
    if(email_exist($email)){
        $status = 'You are already subscribed.';
    } else {
        add_email($email);
        $status = 'Thank you for subscribing.';
    }
}   
 }

require 'index.tmpl.php';
?> 

This code works exactly expected. But now I need to submit the other form. I tried adding this code inside REQUEST_METHOD check following without success:

    $fullname = $_POST['fullname'];

if(!empty($fullname)){
    $status = 'sucess';
    echo $status;
} else {
    echo $fullname;
}

I also tried doing:

if (!empty($_POST['contactForm'])) {
   //do something here;
}

if (!empty($_POST['subscribeForm'])) {
   //do something here;
}

Is there something I am missing??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:51:45+00:00Added an answer on June 7, 2026 at 8:51 pm

    You have used same id and names for fullname and subject fields, this might be causing some problem…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple HTML Form with one column having a select menu with
This is probably a basic html/css question... I have a simple one-button form that
I am creating one form in html using table. Which have one Drop down
I had developed one website purely in HTML .I have my form with fields
I have an html form and I need to populate one of the input
I have below html code in one of the opensource project. <form action=/wiki/bin/view/Main/Search> <div
I have a PHP page receiving input from an HTML form via $_POST. The
I have a form on an HTML page that a user needs to use
Lets say i have an html control of the form <input name='options' value='one' title='ABC'>
I have an html form (each form has different page, according to date), with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.