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 8692599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:20:43+00:00 2026-06-13T00:20:43+00:00

Well i am not using email verification so i am facing problem in checking

  • 0

Well i am not using email verification so i am facing problem in checking correct form of email address

suppose if user enter support or support@ it accept it as well.

So i atleast want them to enter there email or at least they enter email form correctly

Here is my code:

   <?php
    require_once 'global.php';
    if (!isset($_SESSION['logged_in'])) {
        header("Location: login.php");
    }
    $user    = unserialize($_SESSION['user']);
    $email   = $user->email;
    $message = "";
    if (isset($_POST['submit-settings'])) {
        $email       = $_POST['email'];
        $user->email = $email;
        $user->save();
        $msg = "Done!<br/>";
    }
    ?>

Solved :

if (isset($_POST['submit-settings'])) {
    $email = $_POST['email'];
    //  checking valid email
    if (!filter_var("$email", FILTER_VALIDATE_EMAIL)) {
        $msg = "Wrong Email Setting Not Saved<br/>";
    } else {
        $user->email = $email;
        $user->save();
        $msg = "Settings Saved<br/>";
    } 
}
  • 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-13T00:20:44+00:00Added an answer on June 13, 2026 at 12:20 am

    Simple use filter_var() of PHP

    if(filter_var('bob@example.com', FILTER_VALIDATE_EMAIL)) {
      //email correct
    }
    else
    {
     //email not correct
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Fist time using fancybox and it's not going so well.. starting to wish I
Well, not random, because its the same every time, but #include<iostream> using namespace std;
Suppose i have the code snippet as follows : ( clarification purpose/not well formed
I have a problem with GWT client-side validation using hibernate validation annotation @Email. I
Well for whatever reason MySQL does not support subqueries in a View. I'm stuck
Well I'm trying to send a HTML email using gmail smtp from CI, and
I'm using Devise to allow user signup as-well-as using my own user admin to
I'm using Symfony2 and CraueFormFlowBundle to create a multi-step form. Everything is going well
I am using swift-mailer to send email to user. I have implemented it and
I'm parsing a (not well formed) Apple Plist File with java. My Code looks

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.