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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:28:11+00:00 2026-05-26T06:28:11+00:00

I´m very newbie on PHP, and programming in general, and I´m still reading my

  • 0

I´m very newbie on PHP, and programming in general, and I´m still reading my manual. I´m trying some excercises, and creating some simple tests of my own.

I have a form, with some checkboxes and select items. The user complete the form and it shows some output. It´s like a little game, where the user selects some answers, and the scripts shows a number that´s his/her score.

Now, I would like to receive an email each time a user completes the game, with all the answers.

The users completes some checkboxes and select items, so, all answers are arrays (So, I´ve tried $message_answer2 = $_POST[‘answer2’]; and it won´t work).

So, I´ve tried:

$to   = 'myown@mail.com';
$subject = 'New Game '.date("m/d/Y h:m:s");
$message_answer2 = join(', ', $_POST['answer2']);
mail($to, $subject, $message_answer2);

There are 2 issues with this:

  • There´s a PHP error that appears: Warning: join() [function.join]: Invalid arguments passed in …

  • An email is dispatched (a blank email) each time I just reload the page. The emails should be sent only after the user hits the “send” button of the form.

I would really appreciate if someone could help me out with this 🙂

Thanks!!

Rosamunda

  • 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-26T06:28:11+00:00Added an answer on May 26, 2026 at 6:28 am

    You should try this:

    if (isset($POST['answer2'])) {
        $to   = 'myown@mail.com';
        $subject = 'New Game '.date("m/d/Y h:m:s");
        $message_answer2 = join(', ', $_POST['answer2']);
        mail($to, $subject, $message_answer2);
    }
    

    I’m assuming when the user submits the form you’re having it post to the current page. If that’s the case then when you’re originally loading the page there is no data set in $_POST[‘answer2’] which is why you’re getting an error, and then its sending the blank message because there is no data to send. Adding that an email will be sent only if statement will make it so that only if there is data being posted to the page in ‘answer2’.

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

Sidebar

Related Questions

I'm not good in PHP and newbie in Kohana. I'm very interesting how Kohana
Hello Friends I am a newbie programmer and very very new to PHP. I
I am very newbie to Perl. I wrote a very simple Perl program (script):
This is probably a very newbie question but what I'm trying to do is
I'm very new to PHP so far and have been trying to learn it.
Hi im a complete newbie and this may seem very simple to any experienced
I'm a newbie and I have a very basic question about PHP arrays Code:
I'm very newbie to php and codeigniter (and smarty too). I follow a lot
i'm trying to set up a very simple rule in .htaccess file in order
This is a very newbie question and i will probably get downvoted for it,

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.