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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:27:13+00:00 2026-05-28T07:27:13+00:00

I have a rough php script that sees if a user has filled in

  • 0

I have a rough php script that sees if a user has filled in the html form input after they have clicked submit. I am having a problem with getting isset() and is_string() to work. If I use isset() the form is emailed even if the form inputs are left blank, is_string() throws an error messages even if the form input are filled in. I have tried !isset() and that still sends blank input. The only thing working is if I use == NULL. At this moment in time I am not going to validate the input as I am trying to understand why this isn’t working as I am pretty new to PHP.

$subject = "Feedback from Your Website.";
$email = ($_POST['email']);
$name = ($_POST['name']);
$message = ($_POST['feedback']);

if (isset($_POST["name"]))
{
    //send message
    mail($subject, $name, $email, $message);
}

else
{
    //error message
    echo "Please do not miss out any fields";
}

I also tried:

if (isset($_POST["name"], $_POST['email']))
{ }

if (isset($name, $email))
{ }

if (is_string($name || $email))
{ }

But all failed, so far all that’s working is:

if ($name == NULL || $email == NULL || $message == NULL)
{ }

Thank you in advance.

  • 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-05-28T07:27:14+00:00Added an answer on May 28, 2026 at 7:27 am

    Try to use empty(). This function return TRUE if a variabile is empty or non set, FALSE otherwise.

    if (empty($_POST["name"]) || empty($_POST["email"]) || empty($_POST["feedback"]))
    {
        //error message
        echo "Please do not miss out any fields";
    }
    else
    {
        //send message
        mail($subject, $name, $email, $message);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site that has a big form page and about half of
I have rough ideas - like dealing with singular/plural, two or more words/phrases that
I have several strings in the rough form: [some text] [some number] [some more
I have a large 150px x 150px tile that has 9 smaller 50px x
I have a simple reporting script that takes 5-10 minutes to run. It's triggered
I have an object graph serialized to xaml. A rough sample of what it
I have an issue with SQLAlchemy apparently committing. A rough sketch of my code:
I have a variable, $var , that contains a string of characters, this is
Well I have a very rough version of gomoku working now. I'm using Jquery,
I have a rough program sketched thusly: if (condition){ //redirect to some page }

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.