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

  • SEARCH
  • Home
  • 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 8113467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:50:20+00:00 2026-06-06T02:50:20+00:00

I want to display error message or alert message after checking the condition. here

  • 0

I want to display error message or alert message after checking the condition.

here is my code

    session_start();

    $plan = @$_GET['plan'];
    $plan = +$plan; 
    include('connect.php');

            If (isset($_POST['submit']))
            {
            $CompanyName = $_POST['CompanyName'];

            $CompanyEmail = $_POST['CompanyEmail'];
            $CompanyContact = $_POST['CompanyContact'];
            $CompanyAddress = $_POST['CompanyAddress']; 

            $RegistrationType = $_POST['RegistrationType'];
            $Plans = $_POST['plan'];
            $Status = "Active";
    $query1 = "select count(CompanyEmail) from ApplicationRegister where CompanyEmail = '$CompanyEmail'" ;
    $result1 = mysql_query($query1) or die ("ERROR: " . mysql_error());
    //$result1 = mysql_result($query1, 0, 0);
    //echo $result1;
     while ($row = mysql_fetch_array($result1))

                {
                    //$companyemail = $row['CompanyEmail'];
                    //if($companyemail != '' || $companyemail!= 'NULL')
                    //{
                        if($row['count(CompanyEmail)'] > 0)
                        {


        echo "This E-mail id is already registered ";
    }
    else
    {

    $sql = "INSERT INTO ApplicationRegister(CompanyName, CompanyEmail, CompanyContact, CompanyAddress, RegistrationType, ApplicationPlan, ApplicationStatus, CreatedDate) VALUES ('$CompanyName', '$CompanyEmail', '$CompanyContact', '$CompanyAddress', '$RegistrationType', '$Plans', '$Status', NOW() )";
$result = mysql_query($sql) or die(mysql_error());

$id = mysql_insert_id(); 

$_SESSION['application_id'] = $id;


//if(isset($plan == "trail"))
if($plan == "trail")
{

header("Location: userRegister.php?id=$id");
exit();
}
else
{
    header("Location : PaymentGateway.php");
    exit();
}


    }
    }
                }

?>

and after this i have placed my html form

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style.css" rel="stylesheet" type="text/css" />


<title>Welcome</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><h2><br />
                  Application Registration</h2>
                  <p>&nbsp;</p></td>
              </tr>
              <tr>
                <td><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" name="form1" id="form1"  onsubmit="return Validate();">
                <input type="hidden" name="plan" value="<?php echo $plan ?>"/>
    Company Name: 
        <input type="text" name="CompanyName" style="width:230px; height:20px;" /><br /><br />
    Company E-mail : 
    <input type="text" name="CompanyEmail" style="width:230px; height:20px;" /><br /><br />
     Company Contact <input type="text" name="CompanyContact" style="width:230px; height:20px;" /><br /><br />
     Company Address: <input type="text" name="CompanyAddress" style="width:230px; height:20px;" /><br /><br />
    Select Your Registration Type : <br /><br />
Trail: <input type="radio" name="RegistrationType" value="Trail" /><br />
                                     Paid<input type="radio" name="RegistrationType" value="Paid" /><br /><br />

     <input type="hidden" name="form_submitted" value="1"/> 
     <input type="submit" value="REGISTER" name="submit" />



</form> 


    </td>
              </tr>

            </table>

When the user entered companyemail is already exists it should display the alert message just below the company email field in the form. But now its displaying in the starting of the page. I dont know what to use and how to use. Please suggest

  • 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-06T02:50:22+00:00Added an answer on June 6, 2026 at 2:50 am
    $msg = "";
    if($row['count(CompanyEmail)'] > 0)
                        {
    
    
        $msg = "This E-mail id is already registered ";
    }
    

    and HTML

    <input type="text" name="CompanyEmail" style="width:230px; height:20px;" /><br />
    <?php echo $msg; ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want display data from database in Listbox...Here is my code, It is not
I want to display the error message generated by jQuery validation plugin at a
I just want to display Start or End Error Message on my msg column
How can I display an alert or a message after a user clicks a
I have a multi-lingual page where I want to display form validation error in
I want to display script errors in a popup alert instead of showing them
I want to display the error messages beside the text fields. I am able
I want to display a message box with an OK button. I used the
I use CodeIgniter 2.1.0, i want after insert data in database get a message
This is my ajax image uploade code.Here i want also check size of the

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.